Skip to content

Commit fd8caa5

Browse files
committed
all: replace collide mode by async call property
Replace the currently existing straightforward approach to race triggering (that was almost entirely implemented inside syz-executor) with a more flexible one. The `async` call property instructs syz-executor not to block until the call has completed execution and proceed immediately to the next call. The decision on what calls to mark with `async` is made by syz-fuzzer. Ultimately this should let us implement more intelligent race provoking strategies as well as make more fine-grained reproducers.
1 parent 4d4ce9b commit fd8caa5

32 files changed

+436
-206
lines changed

executor/common.h

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -514,10 +514,6 @@ static void loop(void)
514514
fprintf(stderr, "### start\n");
515515
#endif
516516
int i, call, thread;
517-
#if SYZ_COLLIDE
518-
int collide = 0;
519-
again:
520-
#endif
521517
for (call = 0; call < /*{{{NUM_CALLS}}}*/; call++) {
522518
for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0])); thread++) {
523519
struct thread_t* th = &threads[thread];
@@ -534,8 +530,8 @@ static void loop(void)
534530
th->call = call;
535531
__atomic_fetch_add(&running, 1, __ATOMIC_RELAXED);
536532
event_set(&th->ready);
537-
#if SYZ_COLLIDE
538-
if (collide && (call % 2) == 0)
533+
#if SYZ_ASYNC
534+
if (/*{{{ASYNC_CONDITIONS}}}*/)
539535
break;
540536
#endif
541537
event_timedwait(&th->done, /*{{{CALL_TIMEOUT_MS}}}*/);
@@ -547,12 +543,6 @@ static void loop(void)
547543
#if SYZ_HAVE_CLOSE_FDS
548544
close_fds();
549545
#endif
550-
#if SYZ_COLLIDE
551-
if (!collide) {
552-
collide = 1;
553-
goto again;
554-
}
555-
#endif
556546
}
557547
#endif
558548

0 commit comments

Comments
 (0)