Repository navigation
test: a fuzz target names the promise it broke before it stops - #421
Merged
Merged
Conversation
siracozmen01
commented
Nov 8, 2026
siracozmen01
left a comment
Collaborator
Author
There was a problem hiding this comment.
Review at 6738ce7: ready.
- Every stop now names its promise. The four fuzz targets' local
Require(a bareabort()) is replaced byfuzz_scene.h's macro, which each of them includes. Before it aborts, the macro printsFILE:LINE: expectation failed: <the condition's own text>, andRequireStatusadds the status value. The line carries the source text and an integer, never input bytes. - Nothing is left bare. At the head, no
abortor__builtin_trapremains infuzz_journal.c,fuzz_replay.c,fuzz_restore_step.c,fuzz_snapshot.corfuzz_oracle.h. The onlyabortis the macro's own, infuzz_scene.h.fuzz_seeds.cis the seed writer, not a target, and itsexit(1)calls already print what failed. - No check is weaker. Every converted condition is the same expression as before. The four status checks wrap the same condition and only add the value to the message. The
Requirecalls elsewhere keep their conditions and now print too. - The title and body follow the standard. No body line opens a commit header.
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.
Problem
When a fuzz target's promise broke, the harness called
abort()with nothing on stderr. A finding's report showed only libFuzzer's "deadly signal" and a stack, so the reader had to map the stack back to a line to learn which promise failed and which status the call returned. The family convention from .github v0.0.55 is that a target prints one "FILE:LINE: expectation failed: ..." line first, andtools/fuzz_target.shkeeps that line in the report.Change
test/fuzz_scene.hdefinesRequireandRequireStatus. When the condition is false they print the file, the line and the promise's own text, plus the returned status forRequireStatus, and then abort. The line never holds the input's bytes.fuzz_journal,fuzz_replay,fuzz_restore_stepandfuzz_snapshotdrop their private silentRequireand use the shared one. Each check on a returned status usesRequireStatus.Verification
tools/check.sh pron 6738ce7: format, the family checks, the build, the tests, the bindings and clang-tidy, with the fuzz pass.tools/fuzz_target.shwith no finding.Require(size < 0)at the top offuzz_journal, a promise that always breaks: the report holdstest/fuzz_journal.c:20: expectation failed: size < 0before libFuzzer's deadly signal line.