Skip to content

CI: ThreadSanitizer fails on Rust 1.92 - ABI mismatch enforcement #20

@27Bslash6

Description

@27Bslash6

Summary

The ThreadSanitizer (TSan) job fails because Rust 1.92.0 now enforces sanitizer ABI mismatch checks. TSan requires the standard library to be built with sanitizer support.

Error

error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `cfg_if`
  |
  = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with
          different values of this flag cannot be used together safely
  = note: `-Zsanitizer=thread` in this crate is incompatible with unset
          `-Zsanitizer` in dependency `core`
  = help: unset `-Zsanitizer` in this crate or set `-Zsanitizer=thread` in `core`

Root Cause

Rust 1.92.0 (released 2025-12-08) introduced stricter ABI mismatch detection. When using -Zsanitizer=thread, the standard library must also be compiled with the same sanitizer flag.

Failed Run

https://github.com/cachekit-io/cachekit-py/actions/runs/20219774104

Fix

Use -Zbuild-std to rebuild the standard library with TSan support:

- name: Run ThreadSanitizer
  env:
    RUSTFLAGS: "-Zsanitizer=thread"
  run: |
    cargo +nightly test -Zbuild-std --target x86_64-unknown-linux-gnu \
      --manifest-path rust/Cargo.toml

Note: This requires nightly Rust and rust-src component:

- uses: dtolnay/rust-toolchain@nightly
  with:
    components: rust-src

Alternative

If -Zbuild-std is too slow/complex for CI, consider:

  1. Skip TSan until pre-built sanitizer-enabled std is available
  2. Use ASan/MSan only (which apparently still work without -Zbuild-std)
  3. Allow ABI mismatch with -Cunsafe-allow-abi-mismatch=sanitizer (not recommended)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingchoreMaintenance, CI/CD, toolingciCI/CD pipeline issuesrustRust crate (cachekit-core)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions