Kaydet (Commit) cc68b830 authored tarafından Caolán McNamara's avatar Caolán McNamara

afl-event-testing: afl-1.93b has a new persistent pattern

some testing shows that I can reliably hit at least 1000 pseudo-restarts
without failures, so bump from 100 to 1000

Change-Id: Ib72c74068793ea1090a7b99a566372dc943641e6
üst a9c3e2d2
...@@ -1274,31 +1274,21 @@ struct ExecuteGlobals ...@@ -1274,31 +1274,21 @@ struct ExecuteGlobals
static ExecuteGlobals* pExecGlobals = NULL; static ExecuteGlobals* pExecGlobals = NULL;
#define PERSIST_MAX 100
unsigned int persist_cnt;
//This just calls Execute() for all normal uses of LibreOffice, but for //This just calls Execute() for all normal uses of LibreOffice, but for
//ui-testing if AFL_PERSISTENT is set then on exit it will pseudo-restart (up //ui-testing if built with afl-clang-fast++ then on exit it will pseudo-restart
//to PERSIST_MAX times) //(up to 100 times)
void Desktop::DoExecute() void Desktop::DoExecute()
{ {
try_again: #if !defined(__AFL_HAVE_MANUAL_CONTROL)
Execute();
#else
while (__AFL_LOOP(1000))
{ {
Execute(); Execute();
/* To signal successful completion of a run, we need to deliver OpenDefault();
SIGSTOP to our own process, then loop to the very beginning
once we're resumed by the supervisor process. We do this only
if AFL_PERSISTENT is set to retain normal behavior when the
program is executed directly; and take note of PERSIST_MAX. */
if (getenv("AFL_PERSISTENT") && persist_cnt++ < PERSIST_MAX)
{
OpenDefault();
#if defined UNX
raise(SIGSTOP);
#endif
goto try_again;
}
} }
#endif
} }
int Desktop::Main() int Desktop::Main()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment