Commit Graph

6136 Commits

Author SHA1 Message Date
Ralf Jung
47745380cd make Miri's scheduler proper round-robin 2022-06-05 14:22:00 -04:00
bors
5a1b09eb9f Auto merge of #2190 - RalfJung:rustup, r=RalfJung
rustup

Cc https://github.com/rust-lang/rust/issues/97745
2022-06-04 23:44:29 +00:00
Ralf Jung
32c03080f1 rustup 2022-06-04 19:43:46 -04:00
bors
92c2e3c0bc Auto merge of #2186 - matthiaskrgr:clippy, r=RalfJung
clippy fixes

clippy::redundant_closure
clippy::unnecessary_mut_passed
clippy::single_char_pattern
clippy::clone_on_copy
clippy::into_iter_on_ref
clippy::extra_unused_lifetimes
2022-06-04 15:17:17 +00:00
Matthias Krüger
bcc491a6ba clippy fixes
clippy::redundant_closure
clippy::unnecessary_mut_passed
clippy::single_char_pattern
clippy::clone_on_copy
clippy::into_iter_on_ref
clippy::extra_unused_lifetimes
2022-06-04 17:10:32 +02:00
bors
f8840e683e Auto merge of #2184 - RalfJung:readme, r=RalfJung
fix dangling reference in the README
2022-06-03 18:49:13 +00:00
Ralf Jung
625b4ed341 fix dangling reference in the README 2022-06-03 14:48:45 -04:00
bors
53a2b2f1c3 Auto merge of #2180 - RalfJung:stale, r=RalfJung
delete stale stderr files

`@oli-obk` can we do anything to detect them? Not sure if compiletest does anything smart here.
2022-06-03 12:10:32 +00:00
Ralf Jung
2b9c45f96f delete stale stderr files 2022-06-03 08:10:09 -04:00
bors
8bcb8064dd Auto merge of #2178 - RalfJung:double-ref, r=RalfJung
do not pass TyCtxt by reference
2022-06-02 19:11:46 +00:00
Ralf Jung
e79a331fea do not pass TyCtxt by reference 2022-06-02 15:11:22 -04:00
bors
7f4f6072aa Auto merge of #2177 - DrMeepster:global_allocator_backtrace_test, r=RalfJung
add test for backtrace with global allocator

closes #1996
2022-06-02 11:37:11 +00:00
DrMeepster
0b7a148ad9 add test for backtrace with global allocator 2022-06-01 17:32:01 -07:00
bors
232260bbdc Auto merge of #2176 - RalfJung:test-dirs, r=oli-obk
rename test suite directories

Fixes https://github.com/rust-lang/miri/issues/2154
2022-06-01 15:41:11 +00:00
Ralf Jung
3d634c975c rename test suite directories 2022-06-01 10:53:38 -04:00
bors
749efd2956 Auto merge of #2174 - RalfJung:summary, r=oli-obk
print list of failed tests in summary

compiletest does this and it is quite useful; see e.g. [here](https://github.com/rust-lang/rust/runs/6473917188?check_suite_focus=true). Example output:

![image](https://user-images.githubusercontent.com/330628/171382085-21674f46-9db4-49ef-9c52-2be06b307e28.png)
2022-06-01 13:01:22 +00:00
Ralf Jung
9b9edc7440 print list of failed tests in summary 2022-06-01 08:59:34 -04:00
bors
40306ba6c3 Auto merge of #2175 - RalfJung:xargo, r=oli-obk
bump Xargo

Also use that as a clue to refresh our CI caches.

Fixes https://github.com/rust-lang/miri/issues/705
2022-06-01 12:39:28 +00:00
bors
f7c1b5bb0c Auto merge of #2167 - rust-lang:gesundheit, r=RalfJung
Check that diagnostics happen in the line that they are annotated for

fixes #2131
2022-06-01 11:48:12 +00:00
Oli Scherer
4b100a1b58 Check that diagnostics happen in the line that they are annotated for 2022-06-01 11:47:54 +00:00
Ralf Jung
4f70093805 advanced GHA 2022-06-01 06:45:09 -04:00
Ralf Jung
61265f5f19 fmt 2022-06-01 06:42:11 -04:00
Ralf Jung
1571571e38 also avoid rebuilding cached RTIM 2022-06-01 06:31:08 -04:00
Ralf Jung
81d661f134 bump xargo version, and tweak xargo caching 2022-06-01 06:28:27 -04:00
bors
47771d6b78 Auto merge of #2173 - RalfJung:rustlib, r=oli-obk
different strategy for normalizing Rust stdlib path

`-Zremap-cwd-prefix` has some [unintended side-effects](https://github.com/rust-lang/miri/issues/2172), so we could use regexp-based normalization instead. Unfortunately, this will fail if the user's home directory contains a space.

Fixes https://github.com/rust-lang/miri/issues/2172
2022-06-01 07:22:31 +00:00
Ralf Jung
8997db2ec9 paper over platform differences 2022-05-31 19:00:14 -04:00
Ralf Jung
9a448744a2 different strategy for normalizing Rust stdlib path 2022-05-31 18:37:32 -04:00
bors
1c11fc64b1 Auto merge of #2171 - RalfJung:less-dup, r=RalfJung
reduce some code duplication

`@saethlin` this is what I meant. I had to fiddle a bit to make the lifetimes work, but now it passes rustc. :)
2022-05-31 14:37:52 +00:00
Ralf Jung
62c48b2998 fix some lifetime names 2022-05-31 08:45:01 -04:00
Ralf Jung
eb6d4cdac0 reduce some code duplication 2022-05-31 08:43:17 -04:00
bors
360186b114 Auto merge of #2166 - RalfJung:tests, r=oli-obk
ui_test tweaks

- support multiple filters
- make `./miri check` also cover ui_test
- Run opt-level=4 tests again, but only the "run" tests

r? `@oli-obk`
2022-05-31 05:11:43 +00:00
bors
aa589d3dc7 Auto merge of #2145 - saethlin:zero-size-creation, r=RalfJung
Save a created event for zero-size reborrows

Currently, we don't save a created event for zero-sized reborrows. Attempting to use something from a zero-sized reborrow is surprisingly common, for example on `minimal-lexical==0.2.1` we previously just emit this:
```
Undefined Behavior: attempting a write access using <187021> at alloc72933[0x0], but that tag does not exist in the borrow stack for this location
    --> /root/rust/library/core/src/ptr/mod.rs:1287:9
     |
1287 |         copy_nonoverlapping(&src as *const T, dst, 1);
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |         |
     |         attempting a write access using <187021> at alloc72933[0x0], but that tag does not exist in the borrow stack for this location
     |         this error occurs as part of an access at alloc72933[0x0..0x8]
     |
     = help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
     = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information

     = note: inside `std::ptr::write::<u64>` at /root/rust/library/core/src/ptr/mod.rs:1287:9
note: inside `minimal_lexical::stackvec::StackVec::push_unchecked` at /root/build/src/stackvec.rs:82:13
    --> /root/build/src/stackvec.rs:82:13
     |
82   |             ptr::write(self.as_mut_ptr().add(self.len()), value);
     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

... backtrace continues...
```
Which leaves us with the question "where did we make this pointer?" because for every other diagnostic you get a "was created by" note, so I suspect people might be tempted to think there is a Miri bug here. I certainly was.

---
This code duplication is so awful, I'm going to take a look at cleaning it up later. The fact that `ptr_get_alloc_id` can fail in this situation makes things annoying.
2022-05-30 23:43:51 +00:00
bors
10cb09c907 Auto merge of #2169 - RalfJung:rustup, r=RalfJung
Rustup

Cc https://github.com/rust-lang/rust/issues/97563
2022-05-30 23:22:06 +00:00
Ralf Jung
7fb5110160 normalize away some more line numbers 2022-05-30 19:21:22 -04:00
Ralf Jung
d455421edc rustup 2022-05-30 19:19:39 -04:00
bors
9d418a3f03 Auto merge of #2168 - RalfJung:power, r=RalfJung
use is_power_of_two where appropriate
2022-05-30 22:01:53 +00:00
Ralf Jung
a8e457fad1 use is_power_of_two where appropriate 2022-05-30 17:47:16 -04:00
bors
57d8206093 Auto merge of #2165 - saethlin:more-clocks, r=RalfJung
Add support for _COARSE clocks

Original idea does not work, so I'm just going to try expanding support to include the `_COARSE` clocks.

The original motivation for this PR is that the test suite for the crate [`minstant`](https://crates.io/crates/minstant) reports UB, because it tries to use a clock type Miri didn't support, but never checked for an error code and so just used the uninit `libc::timespec`. So, that's technically a bug in `minstant`, but outside of Miri you'd have to be using an incredibly old Linux to ever see an `EINVAL` so the more helpful thing for Miri to do is behave like a newer Linux.

So now we don't detect UB in `minstant`, but we have a test failure:
```
failures:

---- src/instant.rs - instant::Instant::as_unix_nanos (line 150) stdout ----
Test executable failed (exit status: 101).

stderr:
thread 'main' panicked at 'assertion failed: (instant.as_unix_nanos(&anchor) as i64 - expected as i64).abs() < 1_000_000', src/instant.rs:11:1
```
I'm having trouble getting my head around the code in `minstant` that's involved in this test, but as far as I can tell from the man pages, these `_COARSE` clocks meet the requirements.

Closes https://github.com/rust-lang/miri/issues/1983 at least as best as I can.
2022-05-30 21:41:41 +00:00
Ben Kimock
ba9391334e Add support for _COARSE clocks, spruce up comments 2022-05-30 11:26:10 -04:00
Ralf Jung
962957f11f make it possible to test more of ui_test 2022-05-30 12:56:34 +02:00
Ralf Jung
4d80880854 fmt 2022-05-30 12:32:49 +02:00
Ralf Jung
80bf204848 don't configure the same regex twice 2022-05-30 12:30:58 +02:00
Ralf Jung
b9d79a25ba also 'check' the test suite 2022-05-30 12:30:54 +02:00
Ralf Jung
86e53f41b0 print reason for ignoring 2022-05-30 10:33:48 +02:00
Ralf Jung
4e91c2e368 ui_test: printing more consistent with compiletest
distinguish "ignored" from "filtered out"
2022-05-30 10:33:33 +02:00
Ralf Jung
8694e656be test mir-opt-level=4 again on run tests 2022-05-30 10:28:07 +02:00
Ralf Jung
e37dfa6d91 ui_test: support multiple filters 2022-05-30 10:27:51 +02:00
bors
065ff89e33 Auto merge of #2158 - rust-lang:gesundheit, r=RalfJung
Avoid error patterns matching themselves

fixes #2156
fixes https://github.com/rust-lang/miri/issues/2155

this will be obsolete the moment I extract that data from json diagnostics instead of just regexing the stderr.
2022-05-30 07:52:48 +00:00
Oli Scherer
3832227734 Forward CARGO_BUILD_FLAGS to ui_test test suite 2022-05-30 07:26:47 +00:00
Ben Kimock
9a1475dbe2 Save a created event for zero-size reborrows 2022-05-29 16:45:26 -04:00