8000 cargo-fuzz: new package (0.13.2) by bryan-minimal · Pull Request #1614 · gominimal/pkgs · GitHub
[go: up one dir, main page]

Skip to content

cargo-fuzz: new package (0.13.2) - #1614

Merged
bryan-minimal merged 1 commit into
mainfrom
cargo-fuzz
Nov 21, 2026
Merged

bryan-minimal merged 1 commit into
mainfrom
cargo-fuzz

Conversation

@bryan-minimal
Copy link
Copy Markdown
Member

New package cargo-fuzz 0.13.2 (rust-fuzz/cargo-fuzz) for the fv-lab loadout.

Package

  • Built from source with the stable rust package, following the cargo-mutants pattern (cargo-mutants 27.1.0 (new): mutation testing for Rust (fv-lab) #1609): cargo fetch --locked against upstream's Cargo.lock, then cargo build --frozen under detbuild, with codegen-units=1, v0 mangling and --remap-path-prefix. Source is the tag archive mirrored create-only to gs://minimal-staging-archives/rust-fuzz/cargo-fuzz/0.13.2.tar.gz (sha256 88e17980…6f46).
  • Runtime deps are glibc + subsetOf gcc ["libgcc"]. build.sh fails closed if the binary NEEDs anything else; it NEEDs libgcc_s.so.1 and libc.so.6.
  • It ships no toolchain and has no toolchain runtime dep. It drives the cargo/rustc on PATH, which must be a nightly (it passes -Zsanitizer). For fv-lab that is rust-nightly-charon, so the loadout still has exactly one cargo.

What the loadout needs alongside it

  1. rust-nightly-charon (or another nightly). Its rust-std has the sanitizer runtimes on both arches. I listed the mirrored 2026-09-17 rust-std tarballs:
    • amd64: librustc-nightly_rt.{asan,lsan,msan,tsan}.a, plus ubsan, rtsan, safestack, dfsan
    • arm64: librustc-nightly_rt.{asan,lsan,msan,tsan}.a, plus ubsan, rtsan, hwasan
    • In an arm64 session they are installed under lib/rustlib/aarch64-unknown-linux-gnu/lib/.
  2. toolchain (gcc + binutils + headers). libfuzzer-sys compiles libFuzzer's C++ with the cc crate when you fuzz (c++, libstdc++), and rustc needs a linker.
  3. CARGO_TARGET_<TRIPLE>_LINKER=gcc (for example CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=gcc, or the x86_64 one). gcc ships no cc link (see packages/gcc/build.sh), and cc is rustc's default linker on linux-gnu. Without the override, the first build script fails with linker `cc` not found. Appending -C linker=gcc to RUSTFLAGS also works, because cargo-fuzz appends the user's RUSTFLAGS.
  4. Network the first time a fuzz crate builds, to fetch libfuzzer-sys and its deps. Alternatively, vendor them.
  5. -s thread needs --build-std, which works because charon's nightly ships rust-src. Without it the current nightly rejects the sanitizer ABI mismatch with the prebuilt std. -s memory turns on build-std by itself.

Verification

  • min package build --rebuild --verbose cargo-fuzz on arm64: build finished. min check --packages cargo-fuzz passes every check, standalone tests included.
  • Standalone tests (offline):
    • version_check runs cargo fuzz --version.
    • init_list runs cargo fuzz init + cargo fuzz list on a one-function crate with rust-nightly-charon. Nothing is compiled, because libfuzzer-sys would have to come from crates.io and the test sandbox has no network.
    • Negative control: with the expectations broken (cargo-fuzz 9.9.9, target nope), both tests fail.
  • End-to-end on arm64 only, done by hand in a networked min session with packages cargo-fuzz rust-nightly-charon toolchain ca-certificates …:
    • cargo fuzz run parse -- -runs=1000 (ASan, the default): Done 1000 runs. The binary has the asan + sancov symbols.
    • A target with an injected heap OOB read: ERROR: AddressSanitizer: heap-buffer-overflow is reported.
    • -s leak, -s memory and -s none build and run.
    • -s thread --build-std builds and runs, and ThreadSanitizer reports the injected bug.
    • Without the linker override: linker `cc` not found (item 3 above).
  • Not verified: amd64 end-to-end. I have no amd64 session from this host. The amd64 sanitizer runtimes were checked only by listing the tarball, and the amd64 build plus offline tests rely on build-bot.

🤖 Generated with Claude Code

libFuzzer-driven fuzzing for Rust, built from source with the stable rust
package (--locked fetch, --frozen build under detbuild, remap-path-prefix).
Ships no toolchain: it drives the nightly cargo on PATH (rust-nightly-charon
for the fv-lab loadout). Runtime deps glibc + libgcc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bryan-minimal
bryan-minimal requested a review from a team as a code owner November 20, 2026 20:56
@coderabbitai
coderabbitai Bot commented Nov 20, 2026
Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 17 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 67 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 03aa958 and bf6fda4.

Files selected for processing: 2

  • packages/cargo-fuzz/build.ncl
  • packages/cargo-fuzz/build.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@bryan-minimal
bryan-minimal added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 411b613 Nov 21, 2026
16 checks passed
@bryan-minimal
bryan-minimal deleted the cargo-fuzz branch November 21, 2026 17:05
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.

2 participants

0