Skip to content

Commit 2e6eb00

Browse files
authored
Merge pull request #518 from RalfJung/readme
add a description of what miri can do for you
2 parents 60a6a81 + bf3e376 commit 2e6eb00

File tree

1 file changed

+42
-10
lines changed

1 file changed

+42
-10
lines changed

README.md

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,28 @@
1-
# Miri [[slides](https://solson.me/miri-slides.pdf)] [[report](https://solson.me/miri-report.pdf)] [![Build Status](https://travis-ci.org/solson/miri.svg?branch=master)](https://travis-ci.org/solson/miri) [![Windows build status](https://ci.appveyor.com/api/projects/status/github/solson/miri?svg=true)](https://ci.appveyor.com/project/solson63299/miri)
1+
# Miri [![Build Status](https://travis-ci.org/solson/miri.svg?branch=master)](https://travis-ci.org/solson/miri) [![Windows build status](https://ci.appveyor.com/api/projects/status/github/solson/miri?svg=true)](https://ci.appveyor.com/project/solson63299/miri)
22

33

4-
An experimental interpreter for [Rust][rust]'s [mid-level intermediate
5-
representation][mir] (MIR). This project began as part of my work for the
6-
undergraduate research course at the [University of Saskatchewan][usask].
4+
An experimental interpreter for [Rust][rust]'s
5+
[mid-level intermediate representation][mir] (MIR). It can run binaries and
6+
test suites of cargo projects and detect certain classes of undefined behavior,
7+
for example:
8+
9+
* Out-of-bounds memory accesses and use-after-free
10+
* Invalid use of uninitialized data
11+
* Violation of intrinsic preconditions (an [`unreachable_unchecked`] being
12+
reached, calling [`copy_nonoverlapping`] with overlapping ranges, ...)
13+
* Not sufficiently aligned memory accesses and references
14+
* Violation of basic type invariants (a `bool` that is not 0 or 1, for example,
15+
or an invalid enum discriminant)
16+
* WIP: Violations of the rules governing aliasing for reference types
17+
18+
[rust]: https://www.rust-lang.org/
19+
[mir]: https://github.com/rust-lang/rfcs/blob/master/text/1211-mir.md
20+
[`unreachable_unchecked`]: https://doc.rust-lang.org/stable/std/hint/fn.unreachable_unchecked.html
21+
[`copy_nonoverlapping`]: https://doc.rust-lang.org/stable/std/ptr/fn.copy_nonoverlapping.html
722

823
## Building Miri
924

10-
We recommend that you install [rustup][rustup] to obtain Rust. Then all you have
25+
We recommend that you install [rustup] to obtain Rust. Then all you have
1126
to do is:
1227

1328
```sh
@@ -25,6 +40,8 @@ To avoid repeating the nightly version all the time, you can use
2540
which means `nightly` Rust will automatically be used whenever you are working
2641
in this directory.
2742

43+
[rustup]: https://www.rustup.rs
44+
2845
## Running Miri
2946

3047
```sh
@@ -175,6 +192,26 @@ needs to be done that I haven't documented in the issues yet, however. For more
175192
ideas or help with running or hacking on Miri, you can contact me (`scott`) on
176193
Mozilla IRC in any of the Rust IRC channels (`#rust`, `#rust-offtopic`, etc).
177194

195+
## History
196+
197+
This project began as part of an undergraduate research course in 2015 by
198+
@solson at the [University of Saskatchewan][usask]. There are [slides] and a
199+
[report] available from that project. In 2016, @oli-obk joined to prepare miri
200+
for eventually being used as const evaluator in the Rust compiler itself
201+
(basically, for `const` and `static` stuff), replacing the old evaluator that
202+
worked directly on the AST. In 2017, @RalfJung did an internship with Mozilla
203+
and began developing miri towards a tool for detecting undefined behavior, and
204+
also using miri as a way to explore the consequences of various possible
205+
definitions for undefined behavior in Rust. @oli-obk's move of the miri engine
206+
into the compiler finally came to completion in early 2018. Meanwhile, later
207+
that year, @RalfJung did a second internship, developing miri further with
208+
support for checking basic type invariants and verifying that references are
209+
used according to their aliasing restrictions.
210+
211+
[usask]: https://www.usask.ca/
212+
[slides]: https://solson.me/miri-slides.pdf
213+
[report]: https://solson.me/miri-report.pdf
214+
178215
## License
179216

180217
Licensed under either of
@@ -188,8 +225,3 @@ Licensed under either of
188225
Unless you explicitly state otherwise, any contribution intentionally submitted
189226
for inclusion in the work by you shall be dual licensed as above, without any
190227
additional terms or conditions.
191-
192-
[rust]: https://www.rust-lang.org/
193-
[mir]: https://github.com/rust-lang/rfcs/blob/master/text/1211-mir.md
194-
[usask]: https://www.usask.ca/
195-
[rustup]: https://www.rustup.rs

0 commit comments

Comments
 (0)