Repository navigation
fix(fuzz): run cargo-fuzz without a sanitizer on macOS - #77
Merged
Merged
Conversation
On recent macOS, the nightly AddressSanitizer runtime hangs at startup in __asan::InitializeShadowMemory, before any input is run: libFuzzer prints nothing and the process spins at 100% CPU, ignoring -max_total_time. The fuzz Makefile targets now pass --sanitizer none on Darwin (the crate has no unsafe code); other platforms keep ASan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Claude finished @matthieugouel's task in 12s —— View job Review of PR #77No important findings. The change looks correct and small.
One optional point, not blocking: the README's "reproduce a crash" command, |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Summary
On recent macOS,
make fuzz-*hangs forever with no output. The nightly AddressSanitizer runtime deadlocks during process startup (__asan::InitializeShadowMemory→ dyld →mallocre-entering ASan, seen withsample), before libFuzzer runs a single input. Since libFuzzer only checks-max_total_timebetween inputs, the 60s limit never triggers.The fuzz targets now pass
--sanitizer noneon Darwin via aFUZZ_FLAGSMakefile variable. ASan matters little here, because the crate has nounsafecode. Other platforms keep ASan.tests/fuzz/README.mddocuments the flag for directcargo fuzzuse.Same fix as in nxthdr/ipfix-parser.
Test plan
fuzz_singlebinary hangs with no output (killed after 15s)make fuzz-singleruns 377K inputs in 60s;fuzz_multipleandfuzz_structuredalso run (147K and 393K inputs in 20s); no crashes🤖 Generated with Claude Code