Skip to content

Commit 2f10826

Browse files
committed
Add Rust AddressSanitizer CI coverage
Run the Rust usage test suite under AddressSanitizer on Linux. This adds continuous sanitizer coverage for FlatBuffers' Rust code and helps detect memory-safety regressions in unsafe code paths. The configuration was validated locally on x86_64 Linux with nightly Rust and rust-src, with the complete Rust usage test suite passing under AddressSanitizer. Refs #6401.
1 parent 5761d6e commit 2f10826

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,23 @@ jobs:
444444
working-directory: tests
445445
run: bash RustTest.sh
446446

447+
build-rust-linux-asan:
448+
name: Build Rust Linux ASan
449+
runs-on: ubuntu-24.04
450+
steps:
451+
- uses: actions/checkout@v6
452+
- name: Install nightly Rust with rust-src
453+
run: rustup toolchain install nightly --profile minimal --component rust-src
454+
- name: Test Rust with AddressSanitizer
455+
env:
456+
RUSTFLAGS: -Zsanitizer=address
457+
RUSTDOCFLAGS: -Zsanitizer=address
458+
run: |
459+
cargo +nightly test \
460+
-Zbuild-std \
461+
--target x86_64-unknown-linux-gnu \
462+
--manifest-path tests/rust_usage_test/Cargo.toml
463+
447464
build-rust-windows:
448465
name: Build Rust Windows
449466
runs-on: windows-2022

0 commit comments

Comments
 (0)