rust-sanitizers-miri

Validate Rust code for memory safety and undefined behavior with Miri.

159|20|Updated Feb 20, 2026
One-click install
npx skills add https://github.com/mohitmishra786/low-level-dev-skills --skill rust-sanitizers-miri
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-sanitizers-miri
Source: https://github.com/mohitmishra786/low-level-dev-skills/tree/main/skills/rust/rust-sanitizers-miri
Command: npx skills add https://github.com/mohitmishra786/low-level-dev-skills --skill rust-sanitizers-miri

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers ensure the memory safety and correctness of their Rust code by leveraging powerful runtime sanitizers and the Miri interpreter to detect undefined behavior.

Core Features & Use Cases

  • Runtime Sanitization: Detects memory errors like buffer overflows and use-after-free with AddressSanitizer (ASan), ThreadSanitizer (TSan), and MemorySanitizer (MSan).
  • Undefined Behavior Detection: Uses Miri to find subtle undefined behavior in unsafe Rust code that traditional compilers and sanitizers might miss.
  • Use Case: You've written a complex piece of unsafe Rust code and suspect it might have memory errors or undefined behavior. You can use this Skill to run ASan and Miri to thoroughly validate its correctness before deployment.

Quick Start

Run your Rust tests under Miri to detect undefined behavior.

Frequently Asked Questions about rust-sanitizers-miri

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect undefined behavior in unsafe Rust code?

To detect undefined behavior in unsafe Rust code, you can use the Miri interpreter to run your tests and identify subtle memory or pointer issues that traditional compilers miss. It thoroughly validates low-level memory manipulation logic.

What is the best way to check Rust code for memory safety and data races?

The best way to check Rust code for memory safety and data races is using runtime sanitizers like ThreadSanitizer and the Miri interpreter, which identify buffer overflows, use-after-free, and concurrent programming errors.

Do I need a nightly Rust toolchain to run Miri and sanitizers?

Yes, you need the nightly Rust toolchain to run Miri and runtime sanitizers for full functionality. This environment provides the necessary compiler features to validate memory safety and undefined behavior.

How does Miri find undefined behavior that AddressSanitizer misses?

Miri finds undefined behavior by directly interpreting Rust code at a high level, catching subtle logical errors in pointer usage that lower-level runtime sanitizers like AddressSanitizer might miss during execution.

Can I use runtime sanitizers for concurrent programming issues in Rust?

Yes, you can use runtime sanitizers for concurrent programming issues in Rust by running ThreadSanitizer, which specifically targets and identifies data races alongside other memory safety validation tools.

When should I not use Miri for Rust memory safety validation?

You should avoid using Miri when your code relies on unsupported system calls or requires full execution speed, as interpreting code to detect undefined behavior introduces significant performance overhead.