From c81e45f73afaccca991de35e14c8e2ae77b98a9b Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 13 Nov 2018 13:28:09 +0100 Subject: [PATCH 1/3] add a description of what miri can do for you --- README.md | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3c695fbc676..919c31177f5 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,33 @@ # 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) -An experimental interpreter for [Rust][rust]'s [mid-level intermediate -representation][mir] (MIR). This project began as part of my work for the -undergraduate research course at the [University of Saskatchewan][usask]. +An experimental interpreter for [Rust][rust]'s +[mid-level intermediate representation][mir] (MIR). It can run binaries and +test suites of cargo projects and detect certain classes of undefined behavior, +for example: + +* Out-of-bounds memory accesses and use-after-free +* Invalid use of uninitialized data +* Violation of intrinsic preconditions (an [`unreachable_unchecked`] being + reached, calling [`copy_nonoverlapping`] with overlapping ranges, ...) +* Not sufficiently aligned memory accesses and references +* Violation of basic type invariants (a `bool` that is not 0 or 1, for example, + or an invalid enum discriminant) +* WIP: Violations of the rules governing aliasing for reference types + +This project began as part of an undergraduate research course at the +[University of Saskatchewan][usask]. + + +[rust]: https://www.rust-lang.org/ +[mir]: https://github.com/rust-lang/rfcs/blob/master/text/1211-mir.md +[usask]: https://www.usask.ca/ +[`unreachable_unchecked`]: https://doc.rust-lang.org/stable/std/hint/fn.unreachable_unchecked.html +[`copy_nonoverlapping`]: https://doc.rust-lang.org/stable/std/ptr/fn.copy_nonoverlapping.html ## Building Miri -We recommend that you install [rustup][rustup] to obtain Rust. Then all you have +We recommend that you install [rustup] to obtain Rust. Then all you have to do is: ```sh @@ -25,6 +45,8 @@ To avoid repeating the nightly version all the time, you can use which means `nightly` Rust will automatically be used whenever you are working in this directory. +[rustup]: https://www.rustup.rs + ## Running Miri ```sh @@ -188,8 +210,3 @@ Licensed under either of Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions. - -[rust]: https://www.rust-lang.org/ -[mir]: https://github.com/rust-lang/rfcs/blob/master/text/1211-mir.md -[usask]: https://www.usask.ca/ -[rustup]: https://www.rustup.rs From 8368fe89bc9c9bc15b11050b99408e36c2b7e55e Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 13 Nov 2018 14:16:08 +0100 Subject: [PATCH 2/3] miri history --- README.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 919c31177f5..dece1c8f72f 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,8 @@ for example: or an invalid enum discriminant) * WIP: Violations of the rules governing aliasing for reference types -This project began as part of an undergraduate research course at the -[University of Saskatchewan][usask]. - - [rust]: https://www.rust-lang.org/ [mir]: https://github.com/rust-lang/rfcs/blob/master/text/1211-mir.md -[usask]: https://www.usask.ca/ [`unreachable_unchecked`]: https://doc.rust-lang.org/stable/std/hint/fn.unreachable_unchecked.html [`copy_nonoverlapping`]: https://doc.rust-lang.org/stable/std/ptr/fn.copy_nonoverlapping.html @@ -197,6 +192,23 @@ needs to be done that I haven't documented in the issues yet, however. For more ideas or help with running or hacking on Miri, you can contact me (`scott`) on Mozilla IRC in any of the Rust IRC channels (`#rust`, `#rust-offtopic`, etc). +## History + +This project began as part of an undergraduate research course in 2015 by +@solson at the [University of Saskatchewan][usask]. In 2016, @oli-obk joined to +prepare miri for eventually being used as const evaluator in the Rust compiler +itself (basically, for `const` and `static` stuff), replacing the old evaluator +that worked directly on the AST. In 2017, @RalfJung did an internship with +Mozilla and began developing miri towards a tool for detecting undefined +behavior, and also using miri as a way to explore the consequences of various +possible definitions for undefined behavior in Rust. @oli-obk's move of the +miri engine into the compiler finally came to completion in early 2018. +Meanwhile, later that year, @RalfJung did a second internship, developing miri +further with support for checking basic type invariants and verifying that +references are used according to their aliasing restrictions. + +[usask]: https://www.usask.ca/ + ## License Licensed under either of From bf3e376049d122ca47d692cca8cff7134a9746f4 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 14 Nov 2018 08:23:43 +0100 Subject: [PATCH 3/3] move slide and report links to history --- README.md | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index dece1c8f72f..04a263597c0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 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) +# 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) An experimental interpreter for [Rust][rust]'s @@ -195,19 +195,22 @@ Mozilla IRC in any of the Rust IRC channels (`#rust`, `#rust-offtopic`, etc). ## History This project began as part of an undergraduate research course in 2015 by -@solson at the [University of Saskatchewan][usask]. In 2016, @oli-obk joined to -prepare miri for eventually being used as const evaluator in the Rust compiler -itself (basically, for `const` and `static` stuff), replacing the old evaluator -that worked directly on the AST. In 2017, @RalfJung did an internship with -Mozilla and began developing miri towards a tool for detecting undefined -behavior, and also using miri as a way to explore the consequences of various -possible definitions for undefined behavior in Rust. @oli-obk's move of the -miri engine into the compiler finally came to completion in early 2018. -Meanwhile, later that year, @RalfJung did a second internship, developing miri -further with support for checking basic type invariants and verifying that -references are used according to their aliasing restrictions. +@solson at the [University of Saskatchewan][usask]. There are [slides] and a +[report] available from that project. In 2016, @oli-obk joined to prepare miri +for eventually being used as const evaluator in the Rust compiler itself +(basically, for `const` and `static` stuff), replacing the old evaluator that +worked directly on the AST. In 2017, @RalfJung did an internship with Mozilla +and began developing miri towards a tool for detecting undefined behavior, and +also using miri as a way to explore the consequences of various possible +definitions for undefined behavior in Rust. @oli-obk's move of the miri engine +into the compiler finally came to completion in early 2018. Meanwhile, later +that year, @RalfJung did a second internship, developing miri further with +support for checking basic type invariants and verifying that references are +used according to their aliasing restrictions. [usask]: https://www.usask.ca/ +[slides]: https://solson.me/miri-slides.pdf +[report]: https://solson.me/miri-report.pdf ## License