Skip to content

Commit c273fff

Browse files
maltesanderclaude
andcommitted
ci: pin fuzz builds to the gnu target
Newer cargo-fuzz (as installed on the runner) defaults to x86_64-unknown-linux-musl, whose statically linked libc is incompatible with AddressSanitizer and is not installed on the runner anyway. Pin --target to x86_64-unknown-linux-gnu, which uses a dynamic libc and ships with the nightly toolchain. Document the same workaround in fuzz/README.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent c7795a7 commit c273fff

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

‎.github/workflows/build.yaml‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,16 @@ jobs:
122122

123123
# A short smoke run per target: long enough to shake out an ASAN overrun
124124
# in the pointer-marshalling paths, short enough for per-PR CI.
125+
#
126+
# --target is pinned to the gnu triple explicitly: newer cargo-fuzz
127+
# defaults to x86_64-unknown-linux-musl, whose statically linked libc is
128+
# incompatible with AddressSanitizer ("sanitizer is incompatible with
129+
# statically linked libc"). gnu uses a dynamic libc and ships with the
130+
# nightly toolchain.
125131
- name: Fuzz utf16
126-
run: cargo +nightly fuzz run utf16 -- -max_total_time=30
132+
run: cargo +nightly fuzz run utf16 --target x86_64-unknown-linux-gnu -- -max_total_time=30
127133
- name: Fuzz column_value
128-
run: cargo +nightly fuzz run column_value -- -max_total_time=30
134+
run: cargo +nightly fuzz run column_value --target x86_64-unknown-linux-gnu -- -max_total_time=30
129135

130136
# Single required check for branch protection rules.
131137
finished:

‎fuzz/README.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ cargo +nightly fuzz run utf16
2626
cargo +nightly fuzz run column_value
2727
```
2828

29+
If cargo-fuzz fails with "sanitizer is incompatible with statically linked
30+
libc", it defaulted to a musl target; pin the gnu triple explicitly (this is
31+
what CI does):
32+
33+
```bash
34+
cargo +nightly fuzz run utf16 --target x86_64-unknown-linux-gnu
35+
```
36+
2937
`cargo fuzz run` runs **indefinitely** until it finds a crash or you stop it. To
3038
bound a run, pass a libFuzzer flag after `--`:
3139

0 commit comments

Comments
 (0)