Skip to main content
InterviewHubPRO
Section Overview
Q34

Question 34 of 50

Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

68%
Rust Systems & Tokio (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

What is Miri and how do you test for Undefined Behavior in Rust?

senior LevelrustAdvanced Internals

In Simple Words: Miri is an interpreter for Rust's intermediate representation (MIR):

  • Runs test suites (cargo miri test) and detects:
    • Out-of-bounds memory accesses and buffer overflows.
    • Use-after-free and dangling pointers in unsafe code.
    • Data races across concurrent threads.
    • Violations of the Aliasing model (Stacked Borrows).