fix(op-service/eth): make FuzzDetectNonBijectivity deterministic#20939
Closed
ajsutton wants to merge 1 commit into
Closed
fix(op-service/eth): make FuzzDetectNonBijectivity deterministic#20939ajsutton wants to merge 1 commit into
ajsutton wants to merge 1 commit into
Conversation
The fuzz function captured a shared *rand.Rand outside the f.Fuzz closure and used it to pick which bit to flip on each iteration. Go's fuzz engine requires fuzz targets to be deterministic for the same input — it re-runs inputs to verify reproducibility, to gather baseline coverage, and during minimization. A shared rand source meant the same input produced different behavior on re-execution, which causes worker subprocesses to stall during minimization and ultimately exit with EOF (#20936). Derive the bit to flip from a SHA-256 of the input instead, so the target is a pure function of its input. The shared Blob buffer outside the closure is fine — within one worker subprocess the fuzz callback runs sequentially.
990719f to
b1e2a28
Compare
Contributor
Author
|
Claude: Combined into #20940 — CI on this branch alone was failing because the load-bearing fix (the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claude: Authored by Claude on Adrian's behalf.
The shared
*rand.Randadvanced state between calls, so the fuzz target was not a pure function of its input. Go's fuzz engine stalls when re-execution of an input differs, producingprocess hung ... while minimizing: EOF. Replace withsha256(d)-derived bit selection.Closes #20936