Skip to content

Backport support for fuzz runs in debug builds#80

Merged
ajtowns merged 4 commits intobitcoin-inquisition:29.xfrom
ajtowns:202507-inq29-fuzzdebug
Jul 12, 2025
Merged

Backport support for fuzz runs in debug builds#80
ajtowns merged 4 commits intobitcoin-inquisition:29.xfrom
ajtowns:202507-inq29-fuzzdebug

Conversation

@ajtowns
Copy link

@ajtowns ajtowns commented Jul 9, 2025

From bitcoin#32113 with some older patches from bitcoin#32158 and bitcoin#31841.

MarcoFalke and others added 4 commits July 9, 2025 04:05
Threads may execute their function any time after they are spawned, so
coverage could be non-deterministic.

Fix this,

* for the script check worker threads by disabling them while fuzzing.
* for the scheduler thread by waiting for it to fully start and run the
  service queue.
When building with

 BUILD_FOR_FUZZING=OFF
 BUILD_FUZZ_BINARY=ON
 CMAKE_BUILD_TYPE=Debug

allow the fuzz binary to execute given test cases (without actual
fuzzing) to make it easier to reproduce fuzz test failures in a more
normal debug build.

In Debug builds, deterministic fuzz behaviour is controlled via a runtime
variable, which is normally false, but set to true automatically in the
fuzz binary, unless the FUZZ_NONDETERMINISM environment variable is set.
Co-Authored-By: Ryan Ofsky <ryan@ofsky.org>
@ajtowns ajtowns added this to the 29.x milestone Jul 9, 2025
@ajtowns ajtowns merged commit 75a129c into bitcoin-inquisition:29.x Jul 12, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant