aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordergoegge <n.goeggi@gmail.com>2023-09-13 16:27:45 +0100
committerdergoegge <n.goeggi@gmail.com>2023-09-14 16:58:19 +0100
commit508d05f8a7b511dd53f543df8899813487eb03e5 (patch)
tree87aaac46b062c1b70c1135d241243efc32462803 /src
parentf5c5ddafbcaad7225312cb032b108a3527f0ac0f (diff)
[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.
Diffstat (limited to 'src')
-rw-r--r--src/test/fuzz/fuzz.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/test/fuzz/fuzz.cpp b/src/test/fuzz/fuzz.cpp
index f5697f14b1..32bd00ec03 100644
--- a/src/test/fuzz/fuzz.cpp
+++ b/src/test/fuzz/fuzz.cpp
@@ -192,17 +192,11 @@ int main(int argc, char** argv)
{
initialize();
static const auto& test_one_input = *Assert(g_test_one_input);
-#ifdef __AFL_HAVE_MANUAL_CONTROL
- // Enable AFL deferred forkserver mode. Requires compilation using
- // afl-clang-fast++. See fuzzing.md for details.
- __AFL_INIT();
-#endif
-
#ifdef __AFL_LOOP
// Enable AFL persistent mode. Requires compilation using afl-clang-fast++.
// See fuzzing.md for details.
const uint8_t* buffer = __AFL_FUZZ_TESTCASE_BUF;
- while (__AFL_LOOP(1000)) {
+ while (__AFL_LOOP(100000)) {
size_t buffer_len = __AFL_FUZZ_TESTCASE_LEN;
test_one_input({buffer, buffer_len});
}