Skip to content

miri

Interpreter that detects undefined behavior in unsafe Rust code and test suites

Permissive (OSI) · Apache-2.0

Listed by , founder & editor

71

Health

Active

Overview

Stars

6,765

Last commit

today

Nov 2026

Repository age

11 years

since Nov 2015

Latest version

–

Contributors

–

17 active in 90 days

Releases

0

last 12 months

Language

Rust

Miri is an interpreter for Rust that finds undefined behavior. It runs compiled binaries and the test suites of cargo projects, and reports unsafe code that breaks its safety requirements. It is part of the rust-lang organization and is licensed Apache-2.0.

It catches out-of-bounds access, use-after-free, invalid use of uninitialized data, misaligned accesses, broken type invariants such as a bool that is not 0 or 1, and data races. It also reports memory leaks. Checks for Stacked Borrows and Tree Borrows aliasing rules are experimental. You can emulate other targets, for example to test byte handling on big-endian systems.

By default execution is deterministic and isolated from the host, with fake clocks, entropy and environment access. It is not a sandbox and is not suitable for cryptographic use. Miri tests one possible execution, so it can miss bugs that depend on thread timing or memory layout. It works as a free alternative to commercial memory-safety checkers for Rust code.

Who it's for

Authors of Rust libraries with unsafe code

It runs your existing tests and flags undefined behavior in them.

Skip if: Your code has no unsafe blocks and no unsafe dependencies.

Maintainers of low-level or concurrent crates

It detects data races and some weak memory effects in a test run.

Skip if: You need to cover every possible thread interleaving.

Developers shipping to multiple architectures

Cross-interpretation lets you check endianness issues without target hardware.

Skip if: You need performance testing, since interpretation is slow.

The problem it solves

Unsafe Rust can compile and pass tests while still having undefined behavior that surfaces later. Miri runs your program in an interpreter that checks each operation against Rust's rules, so you find those bugs before they ship.

Strengths

  • Detects out-of-bounds access, use-after-free and uninitialized reads
  • Runs cargo test suites as well as binaries
  • Reports memory leaks at program exit
  • Can emulate other targets such as big-endian systems
  • Deterministic, isolated execution by default

Trade-offs

  • Does not catch every violation; it approximates Rust's rules
  • Tests only one possible execution of a program
  • Aliasing model checks are experimental
  • Not suited for cryptographic use or as a sandbox

Frequently asked questions

Is Miri free?

Yes. It is open source under Apache-2.0.

What does it check?

Memory errors, uninitialized data, misalignment, type invariant violations, data races and leaks, plus experimental aliasing rules.

Can I test other platforms?

Yes. Miri can emulate other targets, for example to check big-endian behavior.

Does it replace normal tests?

No. It runs your tests under checks, and it can miss bugs that depend on a different execution.

Similar tools in Testing and code quality tools

localemu

Testing and code quality tools

Pip-installable local AWS emulator for developers testing against 133 services

230 51 17 days ago Active Apache-2.0

Replaces Localstack

Sorry Cypress

Testing and code quality tools

Self-hosted Cypress dashboard for parallel runs, recordings and results, without run

2.8k 288 17 months ago Dormant MIT

seer

Testing and code quality tools

3.5k 121 yesterday Active GPL-3.0

Coccinelle

Testing and code quality tools

830 120 3 months ago Dormant GPL-2.0

edb

Testing and code quality tools

3k 342 yesterday Active GPL-2.0

AngusTester

Testing and code quality tools

1.8k 202 30 days ago Slowing GPL-3.0