Skip to content

ci(fuzz): build fuzz harness for gnu target, not musl#97

Merged
madmax983 merged 1 commit into
mainfrom
fuzz-target-fix
Jul 16, 2026
Merged

ci(fuzz): build fuzz harness for gnu target, not musl#97
madmax983 merged 1 commit into
mainfrom
fuzz-target-fix

Conversation

@madmax983

Copy link
Copy Markdown
Owner

Before

The fuzz smoke job was red on every PR. cargo-fuzz is installed on the runner as a musl binary, and it derives its default build target from its own host triple — so the fuzz harness was being built for x86_64-unknown-linux-musl. Static musl libc is incompatible with the AddressSanitizer instrumentation the harness requires (-Zsanitizer=address), so mtl-core failed to compile, libFuzzer exited non-zero, and no crash/timeout artifact was ever produced. The job failed for pure-infra reasons — it never actually fuzzed anything.

After

The harness is built for x86_64-unknown-linux-gnu (the runner's own rustc host), which links against glibc where ASan works. The smoke build compiles and the targets actually fuzz. Gate semantics are unchanged: crash-* still fails the job, timeout-*/oom-* remain advisory.

How

Single-line change in .github/scripts/fuzz-smoke.sh (the cargo fuzz run invocation, ~line 46): pin --target x86_64-unknown-linux-gnu on the command line so cargo-fuzz overrides its musl-derived default target. The gnu target is the runner's rustc host default, so no extra rustup target add is needed. A comment documents the musl/ASan incompatibility. bash -n on the script passes.


Unrelated to PR #96 (paper branch). This is a standalone CI-infra fix.


Generated by Claude Code

cargo-fuzz derives its default build target from its own host triple.
It is binstalled as a musl binary, so the harness defaulted to
x86_64-unknown-linux-musl. Static musl libc is incompatible with the
required AddressSanitizer (-Zsanitizer=address), so mtl-core failed to
compile and libFuzzer exited non-zero with no artifact, turning the fuzz
smoke job red on every PR.

Pin --target x86_64-unknown-linux-gnu (the runner's rustc host) on the
cargo fuzz run invocation so the harness builds against glibc where ASan
works. Gate semantics are unchanged.
@madmax983
madmax983 marked this pull request as ready for review July 16, 2026 15:04
@madmax983
madmax983 merged commit 257210d into main Jul 16, 2026
3 checks passed
@madmax983
madmax983 deleted the fuzz-target-fix branch July 16, 2026 15:04
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