Skip to content

Commit f5f03ce

Browse files
fix(clusterfuzzlite): ASan-only fuzzing — drop unsupported undefined sanitizer (#130)
## What Follow-up to #129. #129 fixed the ClusterFuzzLite **build** (clean `Dockerfile` + `build.sh`), and CI confirmed it works — the image builds and `fuzz_main` compiles + stages. The only remaining red was the **`undefined` sanitizer** matrix variant: ``` BAD BUILD: UBSan build of fuzz_main seems to be compiled with ASan. ERROR: 100.0% of fuzz targets seem to be broken. ``` This is fundamental, not a config typo: **Rust/cargo-fuzz cannot emit a valid UndefinedBehaviorSanitizer binary** — it links ASan regardless — so OSS-Fuzz's `bad_build_check` rejects it. The `undefined` job could never produce real UBSan coverage. Standard Rust OSS-Fuzz practice is ASan-only. ## Changes - `cflite_pr.yml` / `cflite_batch.yml`: matrix `sanitizer: [address]` — removes the broken `PR (undefined)` job. - `.clusterfuzzlite/project.yaml`: `sanitizers: [address]`. - `.clusterfuzzlite/build.sh`: pass `--sanitizer "${SANITIZER:-address}"` explicitly. Each change carries an inline comment explaining the Rust/UBSan limitation. The `address` variant (whose build already works per #129) is retained, so ASan fuzzing continues. ## Verification `bash -n .clusterfuzzlite/build.sh` OK; config greps confirm `[address]` everywhere. The full OSS-Fuzz image build isn't runnable in this environment, so this is correct-by-spec — the `address` job exercises it in CI. ## Out of scope (separate, tracked) The `Validate Hypatia Baseline` red is the pre-existing Hypatia backlog (issue #34): the now-working analyzer reports 25 findings ≥ medium against an empty `.hypatia-baseline.json`. Resolving it needs the actual findings (artifact `hypatia-scan-findings`/the Security tab), which aren't reachable from the CI sandbox — to be fixed at source once the list is in hand, per the repo's fix-don't-suppress discipline. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01BwV2DWsjkBiNP3oscimMLV --- _Generated by [Claude Code](https://claude.ai/code/session_01BwV2DWsjkBiNP3oscimMLV)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent f31b9b5 commit f5f03ce

4 files changed

Lines changed: 14 additions & 4 deletions

File tree

.clusterfuzzlite/build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
# `fuzz/` and stage each binary into $OUT. Run by `compile` inside the
77
# base-builder-rust image (see .clusterfuzzlite/Dockerfile).
88
cd "$SRC/my-lang"
9-
cargo +nightly fuzz build -O
9+
# Build for the sanitizer OSS-Fuzz requests (defaults to address). NOTE: only
10+
# `address` is configured — Rust/cargo-fuzz cannot emit a valid UBSan binary
11+
# (it links ASan regardless), which `bad_build_check` rejects; see project.yaml.
12+
cargo +nightly fuzz build -O --sanitizer "${SANITIZER:-address}"
1013

1114
release="$SRC/my-lang/fuzz/target/x86_64-unknown-linux-gnu/release"
1215
for target in fuzz/fuzz_targets/*.rs; do

.clusterfuzzlite/project.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
homepage: "https://github.com/hyperpolymath/my-lang"
22
language: rust
33
main_repo: "https://github.com/hyperpolymath/my-lang"
4+
# Only ASan: Rust/cargo-fuzz does not produce a valid UndefinedBehaviorSanitizer
5+
# build (it links ASan regardless), which OSS-Fuzz's `bad_build_check` rejects
6+
# ("UBSan build ... seems to be compiled with ASan"). ASan is the supported,
7+
# meaningful sanitizer for Rust fuzzing here.
48
sanitizers:
59
- address
6-
- undefined

.github/workflows/cflite_batch.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
sanitizer: [address, undefined]
14+
# ASan only: Rust/cargo-fuzz can't emit a valid UBSan binary (links ASan
15+
# regardless), so `undefined` failed bad_build_check. See project.yaml.
16+
sanitizer: [address]
1517
steps:
1618
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
1719
- uses: google/clusterfuzzlite/actions/build_fuzzers@884713a6c30a92e5e8544c39945cd7cb630abcd1 # v1

.github/workflows/cflite_pr.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
sanitizer: [address, undefined]
17+
# ASan only: Rust/cargo-fuzz can't emit a valid UBSan binary (links ASan
18+
# regardless), so `undefined` failed bad_build_check. See project.yaml.
19+
sanitizer: [address]
1820
steps:
1921
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
2022
- uses: google/clusterfuzzlite/actions/build_fuzzers@884713a6c30a92e5e8544c39945cd7cb630abcd1 # v1

0 commit comments

Comments
 (0)