Commit Graph

207 Commits

Author SHA1 Message Date
bors
158639c985 Auto merge of #1590 - RalfJung:trophy, r=RalfJung
another TiKV bug for the trophy case :)

Cc `@brson` thanks for the ping!
2020-10-22 07:46:10 +00:00
Ralf Jung
0835ac6ec3 another TiKV bug for the trophy case :) 2020-10-21 12:50:45 +02:00
Aaron Hill
05bb560de2
Enable backtrace feature in the generated Xargo.toml
This allows the normal std panic hook to print a backtrace if
`RUST_BACKTRACE=1` and `-Z miri-disable-isolation` are set
2020-10-20 18:27:55 -04:00
bors
8beccc4bef Auto merge of #1581 - RalfJung:readme, r=RalfJung
README: make our cross-interpretation feature stand out more

This is a great feature, let's hope more people notice it :)
2020-10-11 22:56:39 +00:00
bors
73d5c42076 Auto merge of #1580 - Aaron1011:feature/backtrace-fn-ptr, r=RalfJung
Add an `fn_ptr` field to `MiriFrame`

The `backtrace-rs` crate can use this to implement
`Frame::symbol_address`, which is used to skip frames
above the call to `Backtrace::capture` on the stack.

The function pointer will not be useable for comparison purposes if the
function is generic, as CTFE creates a new function pointer for each
cast of a (monomorphized) generic function. However, this already
affects code running under Miri, and isn't a problem for `backtrace-rs`
(which only casts a non-generic function).

I've added logic to allow `MiriFrame` to have either 4 or 5 fields - if
a 5th field is present, we write the function pointer to it.
2020-10-11 22:34:57 +00:00
Ralf Jung
3bdf2bccae
Improve wording
Co-authored-by: Aaron Hill <aa1ronham@gmail.com>
2020-10-12 00:15:01 +02:00
bors
c467345bb0 Auto merge of #1571 - lzutao:actions, r=RalfJung
Adding a working github actions template

Complete adding github actions whose dummy template added in #1563 .

But it will need https://github.com/rust-lang/rust-central-station/pull/939 merged first
to be able to gate bors on Actions CI checks.
2020-10-11 22:07:25 +00:00
Lzu Tao
6acde94931 Add a working github actions template 2020-10-11 18:32:12 +07:00
Ralf Jung
71e0e59b63 README: make our cross-interpretation feature stand out more 2020-10-11 10:49:59 +02:00
Aaron Hill
be51e6bd07
Add an fn_ptr field to MiriFrame
The `backtrace-rs` crate can use this to implement
`Frame::symbol_address`, which is used to skip frames
above the call to `Backtrace::capture` on the stack.

The function pointer will not be useable for comparison purposes if the
function is generic, as CTFE creates a new function pointer for each
cast of a (monomorphized) generic function. However, this already
affects code running under Miri, and isn't a problem for `backtrace-rs`
(which only casts a non-generic function).

I've added logic to allow `MiriFrame` to have either 4 or 5 fields - if
a 5th field is present, we write the function pointer to it.
2020-10-10 13:07:57 -04:00
Yonggang Luo
e6665109e0
Update README.md
Note however that
[leak checking is currently disabled on Windows targets](https://github.com/rust-lang/miri/issues/1302).

Windows issue are fixed
2020-10-09 13:16:03 +08:00
Ralf Jung
b1837d0bc9
fix typo 2020-09-28 13:44:46 -04:00
Aaron Hill
5571bcfc4f
Require #[repr(C)] on MiriFrame 2020-09-28 13:44:46 -04:00
Aaron Hill
11e2dbd51c
Update README 2020-09-28 13:44:45 -04:00
Aaron Hill
ef43c5a614
Use a 'flags' parameter instead of 'version' 2020-09-28 13:44:45 -04:00
Aaron Hill
22f1eb01ee
Add API for capturing backtrace
This PR adds two new Miri-defined extern functions:
`miri_get_backtrace` and `miri_resolve_frame`, which are documented in
the README. Together, they allow obtaining a backtrace for the currently
executing program.

I've added a test showing how these APIs are used. I've also prepared a
companion PR `backtrace-rs`, which will allow
`backtrace::Backtrace::new()` to work automatically under Miri.

Once these two PRs are merged, we will be able to print backtraces from
the normal Rust panic hook (since libstd is now using backtrace-rs).

A few notes:
* Resolving the backtrace frames is *very* slow - you can actually see
  each line being printed out one at a time. Some local testing showed
  that this is not (primrary) caused by resolving a `Span` - it seems
  to be just Miri being slow.
* For the first time, we now interact directly with a user-defined
  struct (instead of just executing the user-provided MIR that
  manipulates the struct). To allow for future changes, I've added
  a 'version' parameter (currently required to be 0). This should allow
  us to change the `MiriFrame` struct should the need ever arise.
* I used the approach suggested by @oli-obk - a returned backtrace
  pointer consists of a base function allocation, with the 'offset'
  used to encode the `Span.lo`. This allows losslessly reconstructing
  the location information in `miri_resolve_frame`.
* There are a few quirks on the `backtrace-rs` side:
  * `backtrace-rs` calls `getcwd()` by default to try to simplify
    the filename. This results in an isolation error by default,
    which could be annoying when printing a backtrace from libstd.
  * `backtrace-rs` tries to remove 'internal' frames (everything between
     the call to `Backtrace::new()` and the internal API call made by
     backtrace-rs) by comparing the returned frame pointer value to
     a Rust function pointer. This doesn't work due to the way we
     construct the frame pointers passed to the caller. We could
     attempt to support this kind of comparison, or just add a
    `#[cfg(miri)]` and ignore the frames ourselves.
2020-09-28 13:44:45 -04:00
Ralf Jung
5652052e23 list two more aliasing problems we found in BTreeMap and VecDeque 2020-09-19 11:39:13 +02:00
Ralf Jung
32cdb7131b support panic=abort 2020-09-18 13:10:18 +02:00
Ralf Jung
b244a2ddaa make sure subcrate tests have the right cwd 2020-09-17 17:33:47 +02:00
Ralf Jung
9a9988a4b0 update docs, and also use MIRIFLAGS for the test suite 2020-09-17 17:29:19 +02:00
Ralf Jung
4608341ca0 add encoding_rs OOB arithmetic 2020-08-27 08:37:11 +02:00
Ralf Jung
3b7f36ef8d emphasize that some flags are unsound to use 2020-08-22 14:31:46 +02:00
Ralf Jung
f691e573b2 tweak alignment check docs 2020-08-17 11:51:18 +02:00
Ralf Jung
5a579f281d document -Zmiri-symbolic-alignment-check 2020-08-16 17:12:32 +02:00
Ralf Jung
06f8bf6afa document Miri extern functions 2020-07-23 17:14:25 +02:00
Ralf Jung
6dbfb2d9de make cfg(miri) greppable 2020-07-15 10:09:28 +02:00
Ralf Jung
c379793cde add option to track call IDs 2020-07-02 10:33:54 +02:00
Youngsuk Kim
ea4a5587ca
Add a case to list of 'StackedBorrows violations'
A small fix was made to libstd in rust-lang/rust#70479 (back in March).
(Miri reported UB due to Stacked Borrows violation - [link to Miri error log](https://github.com/rust-lang/miri/pull/1225#discussion_r397830221))

Thank you for reviewing 👍
2020-06-08 17:30:43 -04:00
Ralf Jung
67ad304140 update unsupported example in README (now that threading is supported on some platforms) 2020-05-30 22:50:49 +02:00
Ralf Jung
e22baedb1f add test suite filter example to README and 'cargo miri --help' 2020-05-17 10:12:17 +02:00
Ralf Jung
938fe00f02 fix some comments, and run_compiler return type 2020-05-11 00:09:46 +02:00
Ralf Jung
12114c5137 fix dead link in README 2020-05-10 18:52:21 +02:00
Ralf Jung
e65d87b110
Typo 2020-05-09 14:08:58 +02:00
Ralf Jung
ba801a45db make Miri work in rustc bootstrap stage 0 2020-05-09 13:19:23 +02:00
Ralf Jung
132feb88db
adjust wording 2020-05-07 11:21:31 +02:00
Brian Anderson
356848c9b9 Add two more TiKV bugs to trophy case 2020-05-07 02:42:12 +00:00
bors
6ded8aadab Auto merge of #1386 - RalfJung:trophy, r=RalfJung
trophy case: consistent wording (X doing Y)
2020-05-02 09:41:31 +00:00
Ralf Jung
df4623e5d8 trophy case: consistent wording (X doing Y) 2020-05-02 11:08:20 +02:00
Ralf Jung
15c299e657
Adjust wording 2020-05-02 11:04:45 +02:00
Brian Anderson
5e25dfaef8 Add another tikv stacked borrowing error to trophy case 2020-05-01 21:34:16 +00:00
Ralf Jung
580c1194d9 README tweak 2020-04-30 19:39:56 +02:00
bors
351d46d3fb Auto merge of #1284 - vakaras:add-threads-cr2, r=RalfJung
Implement basic support for concurrency (Linux/macos only)

Changes  (most new code is in `src/threads.rs` and `src/shims/foreign_items/posix.rs`):

1. Move the stack from `Machine` to a newly created `Thread` struct.
2. Add a `ThreadSet` struct that manages the threads.
3. Change `canonical_alloc_id` to create a unique allocation id for each thread local and thread (the responsible struct is `ThreadLocalStorage`)
4. Change the code to execute the thread local destructors immediately when a thread terminates.
5. Add the most basic round-robin scheduler.

This pull request depends on [these changes to the compiler](https://github.com/rust-lang/rust/pull/70598).
2020-04-30 16:21:43 +00:00
Ralf Jung
1aabd6da75
Tweak error wording 2020-04-30 10:24:57 +02:00
Brian Anderson
488f3801e2 Add servo_arc to trophy case 2020-04-30 00:03:43 +00:00
Vytautas Astrauskas
c84b2890ad Update a comment in README about what concurrency checks we support. 2020-04-27 14:26:36 -07:00
Vytautas Astrauskas
58a6a2729a Add a warning that Miri does not check for data-races. 2020-04-27 14:23:32 -07:00
Hero Bird
3f43305894
Update README.md 2020-04-25 19:42:48 +02:00
Hero Bird
72442acaff
Add miri trophy for LazyArray::swap (ink! PR)
Details to the found in https://github.com/rust-lang/miri/issues/1364.
Note that this was not a found in a `master` or production release of ink!, however without analysing the code via `miri` this could have potentially happened.
2020-04-25 14:58:20 +02:00
David Tolnay
28f4f84303
Remove unneeded setup step from CI instructions in readme 2020-04-23 09:12:05 -07:00
Brian Anderson
f84aa4a424
Update README.md
Co-Authored-By: Ralf Jung <post@ralfj.de>
2020-04-23 02:46:36 -06:00