mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-13 11:35:20 +01:00
[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.
This commit is contained in:
parent
f5c5ddafbc
commit
508d05f8a7
1 changed files with 1 additions and 7 deletions
|
@ -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});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue