bors [Tue, 28 Jun 2022 01:20:40 +0000 (01:20 +0000)]
Auto merge of #2275 - RalfJung:permissive-provenance-for-all, r=RalfJung
Enable permissive provenance by default
This completes the plan laid out in https://github.com/rust-lang/miri/issues/2133:
- We use permissive provenance with wildcard pointers by default.
- We print a warning on int2ptr casts. `-Zmiri-permissive-provenance` suppresses the warning; `-Zmiri-strict-provenance` turns it into a hard error.
- Raw pointer tagging is now always enabled, so we remove the `-Zmiri-tag-raw-pointers` flag and the code for untagged pointers. (Passing the flag still works, for compatibility -- but we just ignore it, with a warning.)
We also fix an intptrcast issue:
- Only live allocations are considered when computing the AllocId from an address.
So, finally, Miri has a good story for ptr2int2ptr roundtrips *and* no weird false negatives when doing raw pointer stuff with Stacked Borrows. :-) :tada: Thanks a lot to everyone who helped with this, in particular `@carbotaniuman` who convinced me this is even possible.
The stacktrace is printed every N basic blocks. I picked the default (1 million) to take a few seconds on my machine, but it can be adjusted by the user.
bors [Sun, 26 Jun 2022 03:54:43 +0000 (03:54 +0000)]
Auto merge of #2270 - RalfJung:futex-ordering, r=RalfJung
test that futexes induce appropriate synchronization
This fails when I remove the `validate_lock_acquire` or `validate_lock_release` from `futex_wake`. So finally we got those code paths actually covered in tests. :)
bors [Sun, 26 Jun 2022 00:11:30 +0000 (00:11 +0000)]
Auto merge of #2245 - saethlin:color-always, r=RalfJung
Actually pass through the request for --color=always
https://github.com/rust-lang/miri/pull/2243 actually doesn't work :joy:
The suggestion to split on `,` was good but `arg` is actually the whole `--json=diagnostic-rendered-ansi,artifacts,future-incompat
`, and of course I didn't test that change locally and we have no test for this in CI.
Therefore, I would like some guidance on making a test for this because I'm going to rely on this working.
bors [Sat, 25 Jun 2022 02:05:18 +0000 (02:05 +0000)]
Auto merge of #2196 - carbotaniuman:permissive-stacked-borrows, r=RalfJung
Handle wildcard pointers in SB
This uses an permissive `Unknown` implementation, where a wildcard pointer (and any SRW derived from a wildcard pointer) can access any previously-exposed SB tag. This is missing any meaningful test-cases, and all of the edge-cases have not yet been worked through.
I think there's also some bugs here with differing Unknowns in different ranges and having things behave really weirdly too, alongside some issues with retagging to `SRO` or `Unique`.
bors [Fri, 24 Jun 2022 23:24:57 +0000 (23:24 +0000)]
Auto merge of #2263 - wesleywiser:update_measureme, r=RalfJung
Update measureme to the latest version
The major version number is different due to changes to the on-disk recording format but the core API is the same and miri continues to build on the latest version.
bors [Thu, 23 Jun 2022 18:53:37 +0000 (18:53 +0000)]
Auto merge of #2261 - RalfJung:fmt, r=oli-obk
make rustfmt mandatory and used pinned toolchain
Looks like this is what most people prefer/expect, and using a pinned toolchain for formatting avoids some (rare and so far mostly hypothetical) formatting inconsistency issues.
bors [Wed, 22 Jun 2022 10:04:08 +0000 (10:04 +0000)]
Auto merge of #2255 - dtolnay-contrib:rustfmt7, r=oli-obk
Format tests with rustfmt (288-299 of 299)
Extracted from #2097.
I'll make a separate PR to enable checking the `tests` directory's formatting in CI. I'll need to rebase that after both this and #2254 have landed, and if any new non-rustfmt-formatted files appear in the meantime, we can include formatting those in the same PR that enables the CI.
bors [Wed, 22 Jun 2022 09:04:44 +0000 (09:04 +0000)]
Auto merge of #2252 - dtolnay-contrib:rustfmt5, r=oli-obk
Format tests with rustfmt (225-275 of 300)
Extracted from #2097.
These cases all involve a line comment at the end of a block that rustfmt has chosen to wrap.
```diff
- unsafe { (*ptr).set(20); } //~ ERROR does not exist in the borrow stack
+ unsafe {
+ (*ptr).set(20);
+ } //~ ERROR does not exist in the borrow stack
```
I have moved all of those comments back onto the same line as the content of the block instead, as was indicated being `@RalfJung's` preference in https://github.com/rust-lang/miri/pull/2097#discussion_r862436672.
```diff
+ unsafe {
+ (*ptr).set(20); //~ ERROR does not exist in the borrow stack
+ }
```