diff --git a/src/test/fuzz/fuzz.cpp b/src/test/fuzz/fuzz.cpp index 7fba26ddb0b..8c1def4338a 100644 --- a/src/test/fuzz/fuzz.cpp +++ b/src/test/fuzz/fuzz.cpp @@ -231,7 +231,7 @@ int main(int argc, char** argv) // 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(100000)) { + while (__AFL_LOOP(100'000)) { size_t buffer_len = __AFL_FUZZ_TESTCASE_LEN; test_one_input({buffer, buffer_len}); } diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index bcf637784d7..8c832976722 100644 --- a/src/test/util/setup_common.cpp +++ b/src/test/util/setup_common.cpp @@ -307,8 +307,10 @@ ChainTestingSetup::ChainTestingSetup(const ChainType chainType, TestOpts opts) .check_block_index = 1, .notifications = *m_node.notifications, .signals = m_node.validation_signals.get(), - // Use no worker threads while fuzzing to avoid non-determinism + // Use no worker threads while fuzzing to avoid racy non-determinism + // and dangling thread handles if AFL forks after initialization. .worker_threads_num = EnableFuzzDeterminism() ? 0 : 2, + .prevoutfetch_threads_num = EnableFuzzDeterminism() ? 0 : 2, }; if (opts.min_validation_cache) { chainman_opts.script_execution_cache_bytes = 0;