Skip to content

Commit 508d05f

Browse files
committed
[fuzz] Don't use afl++ deferred forkserver mode
Deferring the forkserver initialization doesn't make sense for some of our targets since they involve state that can't be forked (e.g. threads). We therefore remove the use of __AFL_INIT entirely. We also increase the __AFL_LOOP count to 100000. Our fuzz targets are meant to all be deterministic and stateless therefore this should be fine.
1 parent f5c5dda commit 508d05f

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/test/fuzz/fuzz.cpp

+1-7
Original file line numberDiff line numberDiff line change
@@ -192,17 +192,11 @@ int main(int argc, char** argv)
192192
{
193193
initialize();
194194
static const auto& test_one_input = *Assert(g_test_one_input);
195-
#ifdef __AFL_HAVE_MANUAL_CONTROL
196-
// Enable AFL deferred forkserver mode. Requires compilation using
197-
// afl-clang-fast++. See fuzzing.md for details.
198-
__AFL_INIT();
199-
#endif
200-
201195
#ifdef __AFL_LOOP
202196
// Enable AFL persistent mode. Requires compilation using afl-clang-fast++.
203197
// See fuzzing.md for details.
204198
const uint8_t* buffer = __AFL_FUZZ_TESTCASE_BUF;
205-
while (__AFL_LOOP(1000)) {
199+
while (__AFL_LOOP(100000)) {
206200
size_t buffer_len = __AFL_FUZZ_TESTCASE_LEN;
207201
test_one_input({buffer, buffer_len});
208202
}

0 commit comments

Comments
 (0)