
Rust Sanitizers Miri
This one walks you through running AddressSanitizer, ThreadSanitizer, and Miri on Rust code to catch memory safety bugs and undefined behavior that the compiler misses. You'll need nightly for most of it, plus the -Zbuild-std flag to instrument the standard library properly. The Miri coverage is especially solid: it explains how to detect dangling pointers, invalid enum discriminants, uninitialized reads, and Stacked Borrows violations with concrete code examples. The sanitizer output interpretation section is genuinely helpful when you're staring at a wall of ASan stack traces. If you write unsafe Rust or maintain FFI bindings, you'll want this in your rotation before merging.
- skills.sh installs
- 604
- GitHub stars
- 279
- last updated
- Aug 21, 2026
Install
$ npx -y skills add mohitmishra786/low-level-dev-skills --skill rust-sanitizers-miri --agent claude-codeInstalls into .claude/skills of the current project.
Files
Rust Sanitizers and Miri
Purpose
Guide agents through runtime safety validation for Rust: ASan/TSan/MSan/UBSan via RUSTFLAGS, Miri for compile-time UB detection in unsafe code, and interpreting sanitizer reports.
Triggers
- "How do I run AddressSanitizer on Rust code?"
- "How do I use Miri to check my unsafe Rust?"
- "How do I run ThreadSanitizer on a Rust program?"
- "My unsafe Rust might have UB — how do I detect it?"
- "How do I interpret a Rust ASan report?"
- "Can I run Rust sanitizers on stable?"
Workflow
1. Sanitizers in Rust (nightly required)
Rust sanitizers require nightly and a compatible platform:
# Install nightly
rustup toolchain install nightly
rustup component add rust-src --toolchain nightly
# AddressSanitizer (Linux, macOS)
RUSTFLAGS="-Z sanitizer=address" \
cargo +nightly test -Zbuild-std \
--target x86_64-unknown-linux-gnu
# ThreadSanitizer (Linux)
RUSTFLAGS="-Z sanitizer=thread" \
cargo +nightly test -Zbuild-std \
--target x86_64-unknown-linux-gnu
Sponsors
Details
- Repository
- github.com/mohitmishra786/low-level-dev-skills
- Category
- Rust
- First seen
- Jun 3, 2026
More from mohitmishra786/low-level-dev-skills
All 54- Meson603
- Cpp Modules597
- Rust Debugging597
- Hardware Counters590
- Debug Optimized Builds579
- Cpp Templates574
- Rustc Basics567
- Rust Cross565
- Wasm Emscripten559
- Zig Debugging555
- Zig Build System552
- Zig Cross536
- Wasm Wasmtime532
- Zig Cinterop524
- Cmake1.8K
- Static Analysis1.2K
- Gdb1K
- Llvm948
- Sanitizers895
- Core Dumps828
- Linux Perf814
- Clang789
- Cross Gcc742
- Gcc741