3 ms·
> is the intent that miri could find much beyond what the sanitizers could? I believe so. AIUI miri is checking that the code follows a formally specified defi
by gpm 8y ago
> is the intent that miri could find much beyond what the sanitizers could?
I believe so. AIUI miri is checking that the code follows a formally specified definition of what is defined behavior, at least as far as the memory model goes (it doesn't check data races for instance). While it can't say that on any input your program doesn't hit undefined pointer behavior, it can say with certainty that the execution it ran through did not (w.r.t. the memory model).
Here's an example of some code that miri does catch, and where ubsan doesn't catch the closest translation I could make of it to C, despite both containing undefined behavior. If you just run the code (at least with debug settings on the current stable) it does what you would naively expect despite the undefined behavior.
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=ec01c06f7a415a66d6c83b56e47561d5 https://play.rust-lang.org/?version=stable&mode=debug&editio...