Skip to content

fix(op-service/eth): make FuzzDetectNonBijectivity deterministic#20939

Closed
ajsutton wants to merge 1 commit into
developfrom
aj/fix/flake-fuzz-detect-non-bijectivity
Closed

fix(op-service/eth): make FuzzDetectNonBijectivity deterministic#20939
ajsutton wants to merge 1 commit into
developfrom
aj/fix/flake-fuzz-detect-non-bijectivity

Conversation

@ajsutton
Copy link
Copy Markdown
Contributor

@ajsutton ajsutton commented May 20, 2026

Claude: Authored by Claude on Adrian's behalf.

The shared *rand.Rand advanced 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, producing process hung ... while minimizing: EOF. Replace with sha256(d)-derived bit selection.

Closes #20936

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.
@ajsutton ajsutton force-pushed the aj/fix/flake-fuzz-detect-non-bijectivity branch from 990719f to b1e2a28 Compare May 20, 2026 23:17
@ajsutton ajsutton marked this pull request as ready for review May 20, 2026 23:19
@ajsutton ajsutton requested a review from a team as a code owner May 20, 2026 23:19
@ajsutton
Copy link
Copy Markdown
Contributor Author

Claude: Combined into #20940 — CI on this branch alone was failing because the load-bearing fix (the %v%d change in blob.go) lives on that PR. Merging the determinism change into the same PR so both fixes land together.

@ajsutton ajsutton closed this May 21, 2026
@ajsutton ajsutton deleted the aj/fix/flake-fuzz-detect-non-bijectivity branch May 21, 2026 00:08
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.

Flaky test: FuzzDetectNonBijectivity (op-service/eth)

1 participant