rust-sanitizers-miri

Diagnose memory-safety and undefined-behavior issues in Rust using Miri and sanitizers.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/awfixers-stuff/opencode-config --skill rust-sanitizers-miri-awfixers-stuff
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rust-sanitizers-miri
Source: https://github.com/awfixers-stuff/opencode-config/tree/main/skills/rust-sanitizers-miri
Command: npx skills add https://github.com/awfixers-stuff/opencode-config --skill rust-sanitizers-miri-awfixers-stuff

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps engineers find, reproduce, and interpret memory-safety and undefined-behavior problems in Rust code by guiding the use of sanitizers (ASan/TSan/MSan/UBSan) and the Miri interpreter to detect and explain root causes in unsafe or low-level code.

Core Features & Use Cases

  • Sanitizer guidance: How to enable and run AddressSanitizer, ThreadSanitizer, MemorySanitizer, and UndefinedBehaviorSanitizer for Rust builds (nightly and CI considerations).
  • Miri diagnostics: Steps to run tests and binaries under Miri, configure MIRIFLAGS, and interpret common UB patterns such as dangling pointers, invalid transmute, uninitialized reads, and stacked-borrows violations.
  • Report interpretation & CI: Translate sanitizer and Miri outputs into actionable fixes and integrate checks into CI workflows; includes stable-workarounds using containers and cross for environments without nightly.
  • Use case: Investigate a failing test that shows an ASan heap-buffer-overflow and determine whether it stems from unsafe pointer arithmetic, Vec reallocation, or a lifetime violation found by Miri.

Quick Start

Run Miri or the appropriate sanitizer on the repository tests and summarize any detected undefined behavior or memory errors with suggested fixes.

Frequently Asked Questions about rust-sanitizers-miri

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

FAQPage Schema
How do I run Miri to detect undefined behavior in Rust?▼

The Skill guides enabling sanitizers by configuring RUSTFLAGS on the nightly toolchain to detect memory errors like heap-buffer-overflows during Rust builds and test execution.

Why does Miri report a stacked-borrows violation in unsafe Rust?▼

Use this Skill to interpret sanitizer and Miri diagnostic outputs, translating memory errors like heap-buffer-overflows into actionable fixes for unsafe pointer arithmetic or Vec reallocation issues.

Can I use AddressSanitizer with Rust on a stable toolchain?▼

This Skill supports integrating sanitizer checks into CI workflows, providing stable-toolchain workarounds using containers to validate memory-safety without direct nightly access.

How do I integrate Miri and sanitizer checks into a CI pipeline?▼

This Skill guides configuring RUSTFLAGS and MIRIFLAGS to execute AddressSanitizer, ThreadSanitizer, MemorySanitizer, and UndefinedBehaviorSanitizer checks within Rust CI pipelines.

What is the difference between Miri and AddressSanitizer for Rust memory safety?▼

Miri interprets Rust MIR to detect stacked-borrows violations and aliasing undefined behavior, while AddressSanitizer detects runtime memory errors like heap-buffer-overflows in compiled binaries.

Do I need rust-src installed to use cargo-miri?▼

Running Miri requires the nightly Rust toolchain, rust-src installation, and cargo-miri setup to interpret MIR and detect stacked-borrows violations or uninitialized reads.