From 054cc535f14faa763cfd325cf7b819fbc1fe6cc4 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 27 Jun 2026 21:49:33 +0000 Subject: [PATCH] fix(clusterfuzzlite): drop unsupported `undefined` sanitizer (Rust = ASan only) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #129 fixed the ClusterFuzzLite *build* (Dockerfile + build.sh), but the `undefined` matrix variant still failed bad_build_check: BAD BUILD: UBSan build of fuzz_main seems to be compiled with ASan. That's fundamental, not a misconfig to paper over: Rust/cargo-fuzz cannot emit a valid UndefinedBehaviorSanitizer binary — it links ASan regardless — so the `undefined` job could never produce real UBSan coverage. Restrict fuzzing to the supported, meaningful sanitizer: - cflite_pr.yml / cflite_batch.yml: matrix `sanitizer: [address]` (removes the broken `PR (undefined)` job); - project.yaml: `sanitizers: [address]`; - build.sh: pass `--sanitizer "${SANITIZER:-address}"` explicitly. ASan fuzzing (the `address` variant, whose build already works as of #129) is retained. NOTE: the full OSS-Fuzz image build isn't runnable locally, so this is correct-by-spec; the `address` job exercises it in CI. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01BwV2DWsjkBiNP3oscimMLV --- .clusterfuzzlite/build.sh | 5 ++++- .clusterfuzzlite/project.yaml | 5 ++++- .github/workflows/cflite_batch.yml | 4 +++- .github/workflows/cflite_pr.yml | 4 +++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.clusterfuzzlite/build.sh b/.clusterfuzzlite/build.sh index 8f7cb8a1..14342132 100755 --- a/.clusterfuzzlite/build.sh +++ b/.clusterfuzzlite/build.sh @@ -6,7 +6,10 @@ # `fuzz/` and stage each binary into $OUT. Run by `compile` inside the # base-builder-rust image (see .clusterfuzzlite/Dockerfile). cd "$SRC/my-lang" -cargo +nightly fuzz build -O +# Build for the sanitizer OSS-Fuzz requests (defaults to address). NOTE: only +# `address` is configured — Rust/cargo-fuzz cannot emit a valid UBSan binary +# (it links ASan regardless), which `bad_build_check` rejects; see project.yaml. +cargo +nightly fuzz build -O --sanitizer "${SANITIZER:-address}" release="$SRC/my-lang/fuzz/target/x86_64-unknown-linux-gnu/release" for target in fuzz/fuzz_targets/*.rs; do diff --git a/.clusterfuzzlite/project.yaml b/.clusterfuzzlite/project.yaml index 565a66e0..78f17ce6 100644 --- a/.clusterfuzzlite/project.yaml +++ b/.clusterfuzzlite/project.yaml @@ -1,6 +1,9 @@ homepage: "https://github.com/hyperpolymath/my-lang" language: rust main_repo: "https://github.com/hyperpolymath/my-lang" +# Only ASan: Rust/cargo-fuzz does not produce a valid UndefinedBehaviorSanitizer +# build (it links ASan regardless), which OSS-Fuzz's `bad_build_check` rejects +# ("UBSan build ... seems to be compiled with ASan"). ASan is the supported, +# meaningful sanitizer for Rust fuzzing here. sanitizers: - address - - undefined diff --git a/.github/workflows/cflite_batch.yml b/.github/workflows/cflite_batch.yml index 9cd88072..f902698f 100644 --- a/.github/workflows/cflite_batch.yml +++ b/.github/workflows/cflite_batch.yml @@ -11,7 +11,9 @@ jobs: strategy: fail-fast: false matrix: - sanitizer: [address, undefined] + # ASan only: Rust/cargo-fuzz can't emit a valid UBSan binary (links ASan + # regardless), so `undefined` failed bad_build_check. See project.yaml. + sanitizer: [address] steps: - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 - uses: google/clusterfuzzlite/actions/build_fuzzers@884713a6c30a92e5e8544c39945cd7cb630abcd1 # v1 diff --git a/.github/workflows/cflite_pr.yml b/.github/workflows/cflite_pr.yml index f6f4f607..e84d5b0a 100644 --- a/.github/workflows/cflite_pr.yml +++ b/.github/workflows/cflite_pr.yml @@ -14,7 +14,9 @@ jobs: strategy: fail-fast: false matrix: - sanitizer: [address, undefined] + # ASan only: Rust/cargo-fuzz can't emit a valid UBSan binary (links ASan + # regardless), so `undefined` failed bad_build_check. See project.yaml. + sanitizer: [address] steps: - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 - uses: google/clusterfuzzlite/actions/build_fuzzers@884713a6c30a92e5e8544c39945cd7cb630abcd1 # v1