]>
git.lizzy.rs Git - rust.git/log
Ralf Jung [Thu, 30 Jun 2022 14:04:23 +0000 (10:04 -0400)]
use run_tests_minimal for the new no-std test
bors [Thu, 30 Jun 2022 13:16:57 +0000 (13:16 +0000)]
Auto merge of #2282 - rust-lang:no_std, r=RalfJung
Support no-std targets and test it in CI
cc `@jamesmunns`
This is a bit annoying as you need to have `MIRI_NO_STD=1` set at all times, but it works ™️
Once libstd's `restricted_std` feature becomes more usable, we can probably do away with that env var.
I also added a test to CI to make sure it keeps working. This test only builds libcore and runs a single test, so it's pretty fast.
Oli Scherer [Wed, 29 Jun 2022 13:29:35 +0000 (13:29 +0000)]
Support no-std targets and test it in CI
bors [Thu, 30 Jun 2022 02:18:34 +0000 (02:18 +0000)]
Auto merge of #2290 - RalfJung:snakessss, r=RalfJung
use Rust SnakeCase
Ralf Jung [Thu, 30 Jun 2022 02:17:46 +0000 (22:17 -0400)]
use Rust SnakeCase
bors [Thu, 30 Jun 2022 01:31:55 +0000 (01:31 +0000)]
Auto merge of #2289 - RalfJung:rustup, r=RalfJung
rustup
Ralf Jung [Thu, 30 Jun 2022 01:31:27 +0000 (21:31 -0400)]
rustup
bors [Wed, 29 Jun 2022 23:04:07 +0000 (23:04 +0000)]
Auto merge of #2287 - RalfJung:field-retagging, r=RalfJung
stacked borrows: add option for recursive field retagging
bors [Wed, 29 Jun 2022 22:39:57 +0000 (22:39 +0000)]
Auto merge of #2286 - LegNeato:patch-2, r=RalfJung
Support `gettimeofday` on more than macos
This appears to be in linux and in openbsd as well:
* https://github.com/torvalds/linux/blob/master/lib/vdso/gettimeofday.c
* https://github.com/openbsd/src/blob/master/sys/sys/time.h#L439
Note that std currently says [different syscalls are used on mac vs linux](https://doc.rust-lang.org/std/time/struct.SystemTime.html#platform-specific-behavior) but this is not part of[ std's contract](https://doc.rust-lang.org/std/io/index.html#platform-specific-behavior) and third party code could call the syscall directly on different platforms.
Ralf Jung [Wed, 29 Jun 2022 21:56:47 +0000 (17:56 -0400)]
merge two SB test files
Ralf Jung [Wed, 29 Jun 2022 21:53:09 +0000 (17:53 -0400)]
add option for recursive field retagging
bors [Wed, 29 Jun 2022 22:21:30 +0000 (22:21 +0000)]
Auto merge of #2288 - RalfJung:clippy, r=RalfJung
add ./miri clippy
also make ui_test comply with clippy
Ralf Jung [Wed, 29 Jun 2022 22:17:28 +0000 (18:17 -0400)]
make ui_test pass clippy
Ralf Jung [Wed, 29 Jun 2022 22:14:41 +0000 (18:14 -0400)]
add ./miri clippy
Christian Legnitto [Wed, 29 Jun 2022 17:30:30 +0000 (13:30 -0400)]
Support `gettimeofday` on more than macos
This appears to be in linux and in openbsd as well:
* https://github.com/torvalds/linux/blob/master/lib/vdso/gettimeofday.c
* https://github.com/openbsd/src/blob/master/sys/sys/time.h#L439
Co-authored-by: Ralf Jung <post@ralfj.de>
bors [Wed, 29 Jun 2022 17:18:00 +0000 (17:18 +0000)]
Auto merge of #2285 - LegNeato:patch-1, r=RalfJung
Update path to passing tests in CONTRIBUTING.md examples
This appears to be renamed from `tests/run-pass` to `tests/pass`.
Christian Legnitto [Wed, 29 Jun 2022 17:14:30 +0000 (13:14 -0400)]
Update path to passing tests in CONTRIBUTING.md examples
This appears to be renamed from `tests/run-pass` to `tests/pass`.
bors [Wed, 29 Jun 2022 14:35:18 +0000 (14:35 +0000)]
Auto merge of #2283 - RalfJung:color, r=RalfJung
revert --color=always changes
They [cause problems](https://github.com/rust-lang/miri/issues/2277) and they completely break rendering on the playground:
```
Compiling playground v0.0.1 (/playground)
Finished dev [unoptimized + debuginfo] target(s) in 0.47s
Running `/playground/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo-miri target/miri/x86_64-unknown-linux-gnu/debug/playground`
\e [0m\e [1m\e [38;5;9merror[E0277]\e [0m\e [0m\e [1m: `*mut std::sync::atomic::AtomicUsize` cannot be sent between threads safely\e [0m
\e [0m \e [0m\e [0m\e [1m\e [38;5;12m--> \e [0m\e [0msrc/main.rs:17:18\e [0m
\e [0m \e [0m\e [0m\e [1m\e [38;5;12m|\e [0m
\e [0m\e [1m\e [38;5;12m17\e [0m\e [0m \e [0m\e [0m\e [1m\e [38;5;12m|\e [0m\e [0m \e [0m\e [0m let j1 = spawn(move || {\e [0m
\e [0m \e [0m\e [0m\e [1m\e [38;5;12m| \e [0m\e [0m \e [0m\e [0m\e [1m\e [38;5;12m__________________\e [0m\e [0m\e [1m\e [38;5;9m^^^^^\e [0m\e [0m\e [1m\e [38;5;12m_-\e [0m
\e [0m \e [0m\e [0m\e [1m\e [38;5;12m| \e [0m\e [0m\e [1m\e [38;5;12m|\e [0m\e [0m \e [0m\e [0m\e [1m\e [38;5;9m|\e [0m
\e [0m \e [0m\e [0m\e [1m\e [38;5;12m| \e [0m\e [0m\e [1m\e [38;5;12m|\e [0m\e [0m \e [0m\e [0m\e [1m\e [38;5;9m`*mut std::sync::atomic::AtomicUsize` cannot be sent between threads safely\e [0m
\e [0m\e [1m\e [38;5;12m18\e [0m\e [0m \e [0m\e [0m\e [1m\e [38;5;12m|\e [0m\e [0m \e [0m\e [0m\e [1m\e [38;5;12m|\e [0m\e [0m \e [0m\e [0m *(c.0 as *mut usize) = 32;\e [0m
\e [0m\e [1m\e [38;5;12m19\e [0m\e [0m \e [0m\e [0m\e [1m\e [38;5;12m|\e [0m\e [0m \e [0m\e [0m\e [1m\e [38;5;12m|\e [0m\e [0m \e [0m\e [0m });\e [0m
\e [0m \e [0m\e [0m\e [1m\e [38;5;12m| \e [0m\e [0m\e [1m\e [38;5;12m|_________-\e [0m\e [0m \e [0m\e [0m\e [1m\e [38;5;12mwithin this `[closure@src/main.rs:17:24: 19:10]`\e [0m
\e [0m \e [0m\e [0m\e [1m\e [38;5;12m|\e [0m
```
Sorry `@saethlin,` I think we need to go back to start here and consider another solution.
Fixes https://github.com/rust-lang/miri/issues/2277
Ralf Jung [Wed, 29 Jun 2022 14:14:26 +0000 (10:14 -0400)]
revert --color=always changes
bors [Wed, 29 Jun 2022 14:09:52 +0000 (14:09 +0000)]
Auto merge of #2281 - RalfJung:rustup, r=RalfJung
Rustup
Fix our stacktrace after https://github.com/rust-lang/rust/pull/98549. Now we can control whether `caller_location` should be pruned!
Ralf Jung [Wed, 29 Jun 2022 14:09:18 +0000 (10:09 -0400)]
fmt
Ralf Jung [Wed, 29 Jun 2022 13:33:12 +0000 (09:33 -0400)]
also prune caller_location frames when backtrace=off
Ralf Jung [Wed, 29 Jun 2022 13:31:11 +0000 (09:31 -0400)]
improve atomics test coverage
Ralf Jung [Wed, 29 Jun 2022 12:33:06 +0000 (08:33 -0400)]
rustup
bors [Tue, 28 Jun 2022 12:53:27 +0000 (12:53 +0000)]
Auto merge of #2280 - RalfJung:int2ptr, r=RalfJung
tweak int2ptr diagnostics
Ralf Jung [Tue, 28 Jun 2022 12:52:22 +0000 (08:52 -0400)]
tweak int2ptr diagnostics
bors [Tue, 28 Jun 2022 02:52:23 +0000 (02:52 +0000)]
Auto merge of #2279 - RalfJung:adjacent-allocs, r=RalfJung
Allow non-ZST allocations to be adjacent
Also `cargo update` in test-cargo-miri... no need to make a separate PR for that right?...
Ralf Jung [Tue, 28 Jun 2022 02:11:09 +0000 (22:11 -0400)]
typo
Ralf Jung [Mon, 27 Jun 2022 15:16:27 +0000 (11:16 -0400)]
update getrandom
Ralf Jung [Mon, 27 Jun 2022 12:13:55 +0000 (08:13 -0400)]
finally we can actually have adjacent allocations :)
bors [Tue, 28 Jun 2022 01:53:06 +0000 (01:53 +0000)]
Auto merge of #2278 - RalfJung:rustup, r=RalfJung
Rustup
Ralf Jung [Tue, 28 Jun 2022 01:29:40 +0000 (21:29 -0400)]
rustup
Ralf Jung [Mon, 27 Jun 2022 15:09:28 +0000 (11:09 -0400)]
make use of get_alloc_info
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.
Fixes https://github.com/rust-lang/miri/issues/2133
Fixes https://github.com/rust-lang/miri/issues/1866
Fixes https://github.com/rust-lang/miri/issues/1993
Ralf Jung [Tue, 28 Jun 2022 00:22:50 +0000 (20:22 -0400)]
show int2ptr warning once for each span (but don't duplicate the long help)
Ralf Jung [Tue, 28 Jun 2022 00:04:46 +0000 (20:04 -0400)]
fix warning text
bors [Mon, 27 Jun 2022 17:40:15 +0000 (17:40 +0000)]
Auto merge of #2221 - InfRandomness:freebsd-target-support, r=RalfJung
Freebsd-target-support
Implement freebsd as a target for miri
Ralf Jung [Mon, 27 Jun 2022 17:38:32 +0000 (13:38 -0400)]
improve old comment
bors [Mon, 27 Jun 2022 15:46:19 +0000 (15:46 +0000)]
Auto merge of #2276 - RalfJung:join, r=RalfJung
make sure a thread is joined
Not sure how that can fail given that preemption is disabled but whatever...
Ralf Jung [Mon, 27 Jun 2022 15:44:45 +0000 (11:44 -0400)]
make sure a thread is joined
Ralf Jung [Mon, 27 Jun 2022 12:35:25 +0000 (08:35 -0400)]
typo
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
Ralf Jung [Mon, 27 Jun 2022 03:14:16 +0000 (23:14 -0400)]
avoid unnecessary indirection in miri-track-raw-pointers warning
Ralf Jung [Mon, 27 Jun 2022 03:00:54 +0000 (23:00 -0400)]
make macOS happy
Ralf Jung [Mon, 27 Jun 2022 02:27:38 +0000 (22:27 -0400)]
fmt
Ralf Jung [Mon, 27 Jun 2022 02:07:02 +0000 (22:07 -0400)]
readme: move some things around
Ralf Jung [Mon, 27 Jun 2022 02:01:03 +0000 (22:01 -0400)]
remove support for untagged pointers
good riddance!
Ralf Jung [Mon, 27 Jun 2022 01:26:14 +0000 (21:26 -0400)]
more int2ptr cast tests, and fix casting of addresses inside dead allocations
Ralf Jung [Mon, 27 Jun 2022 01:14:18 +0000 (21:14 -0400)]
make permissive provenance and raw-ptr tagging the default
infrandomness [Sun, 26 Jun 2022 23:22:13 +0000 (01:22 +0200)]
Cargo fmt
infrandomness [Sun, 26 Jun 2022 23:13:13 +0000 (01:13 +0200)]
Address code review
- Merge pthread_attr_getstack shim to unix/foreign_items.rs
Ralf Jung [Sun, 26 Jun 2022 20:20:37 +0000 (16:20 -0400)]
only test a few tests on FreeBSD
infrandomness [Sun, 12 Jun 2022 09:47:59 +0000 (11:47 +0200)]
Add `pthread_attr_get_np` shim
infrandomness [Sun, 12 Jun 2022 09:47:43 +0000 (11:47 +0200)]
Add `pthread_attr_getstack` shim
infrandomness [Fri, 10 Jun 2022 10:12:20 +0000 (12:12 +0200)]
Fix panicking ui_tests framework
infrandomness [Thu, 9 Jun 2022 14:50:34 +0000 (16:50 +0200)]
Fix pending reviews
infrandomness [Thu, 9 Jun 2022 14:06:07 +0000 (16:06 +0200)]
Initial freebsd work
bors [Sun, 26 Jun 2022 23:00:18 +0000 (23:00 +0000)]
Auto merge of #2274 - RalfJung:trophy, r=RalfJung
trophy case: add the data race in thread::scope
Ralf Jung [Sun, 26 Jun 2022 22:59:48 +0000 (18:59 -0400)]
trophy case: add the data race in thread::scope
bors [Sun, 26 Jun 2022 18:39:38 +0000 (18:39 +0000)]
Auto merge of #2272 - RalfJung:progress, r=RalfJung
add -Zmiri-report-progress to regularly print a stacktrace of what we are executing
Fixes https://github.com/rust-lang/miri/issues/910
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.
Ralf Jung [Sun, 26 Jun 2022 16:31:53 +0000 (12:31 -0400)]
add -Zmiri-report-progress to regularly print a stacktrace of what we are executing
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. :)
Ralf Jung [Sun, 26 Jun 2022 03:22:42 +0000 (23:22 -0400)]
test that futexes induce appropriate synchronization
bors [Sun, 26 Jun 2022 03:31:57 +0000 (03:31 +0000)]
Auto merge of #2269 - RalfJung:fmt, r=RalfJung
make a bunch of tests look more like how they did before rustfmt
Ralf Jung [Sun, 26 Jun 2022 03:30:29 +0000 (23:30 -0400)]
make a bunch of tests look more like how they did before rustfmt
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.
Ralf Jung [Sun, 26 Jun 2022 00:01:36 +0000 (20:01 -0400)]
don't assert the same thing twice
bors [Sat, 25 Jun 2022 23:52:34 +0000 (23:52 +0000)]
Auto merge of #2268 - RalfJung:not-unpin-protected, r=RalfJung
test that &mut !Unpin references are protected
Ralf Jung [Sat, 25 Jun 2022 23:15:11 +0000 (19:15 -0400)]
test that &mut !Unpin references are protected
bors [Sat, 25 Jun 2022 20:01:49 +0000 (20:01 +0000)]
Auto merge of #2267 - RalfJung:rustup, r=RalfJung
rustup
I cannot reproduce https://github.com/rust-lang/rust/issues/98493 so let's see what CI says.
Ralf Jung [Sat, 25 Jun 2022 19:45:45 +0000 (15:45 -0400)]
test for forgetting locked mutex
Ralf Jung [Sat, 25 Jun 2022 19:17:37 +0000 (15:17 -0400)]
join all the threads
Ralf Jung [Sat, 25 Jun 2022 19:06:53 +0000 (15:06 -0400)]
rustup
bors [Sat, 25 Jun 2022 16:29:38 +0000 (16:29 +0000)]
Auto merge of #2265 - RalfJung:readme, r=RalfJung
README: multi-seed loop: also test the 0 seed
Ralf Jung [Sat, 25 Jun 2022 16:27:50 +0000 (12:27 -0400)]
README: multi-seed loop: also test the 0 seed
bors [Sat, 25 Jun 2022 15:54:31 +0000 (15:54 +0000)]
Auto merge of #2264 - RalfJung:not-a-fixme, r=RalfJung
remove a FIXME that is not actually a bug
Ralf Jung [Sat, 25 Jun 2022 15:52:29 +0000 (11:52 -0400)]
remove a FIXME that is not actually a bug
Ben Kimock [Mon, 20 Jun 2022 19:16:32 +0000 (15:16 -0400)]
Actually pass through the request for --color=always
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`.
Ralf Jung [Sat, 25 Jun 2022 02:02:17 +0000 (22:02 -0400)]
tweaks and feedback
Ralf Jung [Fri, 24 Jun 2022 23:45:35 +0000 (19:45 -0400)]
implement 'delimited' expose tracking so we still detect some UB
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.
Wesley Wiser [Fri, 24 Jun 2022 23:04:50 +0000 (19:04 -0400)]
Update measureme to the latest version
Ralf Jung [Fri, 24 Jun 2022 22:02:25 +0000 (18:02 -0400)]
make the tests pass
(and some formatting)
Ralf Jung [Fri, 24 Jun 2022 20:45:22 +0000 (16:45 -0400)]
reorganize exposure code a bit
Ralf Jung [Fri, 24 Jun 2022 20:21:47 +0000 (16:21 -0400)]
add exposed_only_ro test
carbotaniuman [Thu, 16 Jun 2022 01:55:54 +0000 (20:55 -0500)]
Try fix stuff
carbotaniuman [Thu, 16 Jun 2022 01:53:44 +0000 (20:53 -0500)]
Maybe this wil work
carbotaniuman [Wed, 15 Jun 2022 19:55:21 +0000 (14:55 -0500)]
Handle wildcard pointers in SB
bors [Fri, 24 Jun 2022 13:15:20 +0000 (13:15 +0000)]
Auto merge of #2262 - RalfJung:zulip, r=RalfJung
only one Zulip cron job topic per month
Ralf Jung [Fri, 24 Jun 2022 13:13:36 +0000 (09:13 -0400)]
only one Zulip cron job topic per month
bors [Thu, 23 Jun 2022 20:15:27 +0000 (20:15 +0000)]
Auto merge of #2257 - dtolnay-contrib:rustfmt9, r=RalfJung
Add `./miri fmt` and check in CI
David Tolnay [Thu, 23 Jun 2022 20:08:12 +0000 (13:08 -0700)]
Bless stderr files after rustfmt
David Tolnay [Thu, 23 Jun 2022 19:51:40 +0000 (12:51 -0700)]
Manual adjustments
David Tolnay [Thu, 23 Jun 2022 19:50:44 +0000 (12:50 -0700)]
Format late arrivals with rustfmt
David Tolnay [Wed, 22 Jun 2022 12:00:07 +0000 (05:00 -0700)]
Add './miri fmt' and use it in CI
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.
Ralf Jung [Thu, 23 Jun 2022 17:57:27 +0000 (13:57 -0400)]
make rustfmt mandatory and used pinned toolchain
bors [Thu, 23 Jun 2022 13:49:56 +0000 (13:49 +0000)]
Auto merge of #2250 - rust-lang:gesundheit, r=oli-obk
Require local annotations for local diagnostics
if/when we get flaky diagnostics we can revisit and add more helpers for those
Oli Scherer [Tue, 21 Jun 2022 16:30:45 +0000 (16:30 +0000)]
Require local annotations for local diagnostics
bors [Wed, 22 Jun 2022 21:39:41 +0000 (21:39 +0000)]
Auto merge of #2248 - RalfJung:arc-drop-fix, r=RalfJung
do not protect SRW items
This is the Miri version of https://github.com/rust-lang/rust/pull/98017.