-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Fix fuzzing workflow failure caused by ASAN sanitizer incompatibility with musl target.
Problem
Fuzzing workflow fails with error:
error: sanitizer is incompatible with statically linked libc, disable it using `-C target-feature=-crt-static`
error[E0463]: can't find crate for `std`
= note: the `x86_64-unknown-linux-musl` target may not be installed
= help: consider downloading the target with `rustup target add x86_64-unknown-linux-musl`
Root cause: cargo-fuzz automatically selects x86_64-unknown-linux-musl target which uses static libc linking, incompatible with ASAN sanitizer (-Zsanitizer=address).
Failed run: https://github.com/RAprogramm/cstring-array/actions/runs/18640282197
Solution
Use x86_64-unknown-linux-gnu target instead of musl:
- Add target installation step
- Set
CARGO_BUILD_TARGETenvironment variable - Or use
--targetflag in cargo-fuzz command
Implementation
Add to workflow before fuzzing step:
- name: Add gnu target
run: rustup target add x86_64-unknown-linux-gnu
- name: Run fuzzer
run: cargo fuzz run ${{ matrix.target }} --target x86_64-unknown-linux-gnu -- -max_total_time=300Benefits
- Fuzzing works with ASAN sanitizer
- Better memory safety testing
- CI passes successfully
Metadata
Metadata
Assignees
Labels
No labels