Skip to content

Commit 315c3f9

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 315c3f9

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/rust-asan.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Rust AddressSanitizer
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
branches:
10+
- master
11+
pull_request:
12+
branches:
13+
- master
14+
schedule:
15+
- cron: '15 5 * * *'
16+
17+
jobs:
18+
build-rust-linux-asan:
19+
name: Build Rust Linux ASan
20+
runs-on: ubuntu-24.04
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
25+
26+
- name: Install nightly Rust with rust-src
27+
run: rustup toolchain install nightly --profile minimal --component rust-src
28+
29+
- name: Test Rust with AddressSanitizer
30+
env:
31+
RUSTFLAGS: -Zsanitizer=address
32+
RUSTDOCFLAGS: -Zsanitizer=address
33+
run: |
34+
cargo +nightly test \
35+
-Zbuild-std \
36+
--target x86_64-unknown-linux-gnu \
37+
--manifest-path tests/rust_usage_test/Cargo.toml

0 commit comments

Comments
 (0)