]>
git.lizzy.rs Git - rust.git/log
Ralf Jung [Sat, 2 Jul 2022 22:33:03 +0000 (18:33 -0400)]
put call to stacked borrows end_call in a more sensible place
bors [Sat, 2 Jul 2022 20:08:28 +0000 (20:08 +0000)]
Auto merge of #2311 - RalfJung:many-seeds, r=RalfJung
./miri many-seeds: also print the seed before we try it
When using `cargo miri`, we otherwise have no way of even seeing which seed it is currently on.
Ralf Jung [Sat, 2 Jul 2022 20:06:23 +0000 (16:06 -0400)]
./miri many-seeds: also print the seed before we try it
bors [Sat, 2 Jul 2022 17:32:57 +0000 (17:32 +0000)]
Auto merge of #2309 - RalfJung:read_link, r=RalfJung
test fs::read_link surface function
The shim got implemented a while ago but we never ensured that that is actually what std uses.
Ralf Jung [Sat, 2 Jul 2022 16:26:00 +0000 (12:26 -0400)]
test fs::read_link surface function
bors [Sat, 2 Jul 2022 15:34:02 +0000 (15:34 +0000)]
Auto merge of #2308 - RalfJung:ptr-tacking, r=RalfJung
pointer tag tracking: on creation, log the offsets it is created for
Hopefully this makes things like https://github.com/Manishearth/triomphe/issues/38 easier to diagnose.
Ralf Jung [Sat, 2 Jul 2022 14:11:39 +0000 (10:11 -0400)]
pointer tag tracking: on creation, log the offsets it is created for
bors [Sat, 2 Jul 2022 13:45:27 +0000 (13:45 +0000)]
Auto merge of #2306 - RalfJung:unix, r=RalfJung
make some things available for all Unixes
Ralf Jung [Sat, 2 Jul 2022 13:06:35 +0000 (09:06 -0400)]
posix_fadvise is not Linux-specific
Ralf Jung [Sat, 2 Jul 2022 13:06:17 +0000 (09:06 -0400)]
male libc.rs at least build on FreeBSD
Ralf Jung [Sat, 2 Jul 2022 12:58:04 +0000 (08:58 -0400)]
move some POSIX file shims from linux to unix module
bors [Sat, 2 Jul 2022 12:57:14 +0000 (12:57 +0000)]
Auto merge of #2300 - InfRandomness:freebsd-environ-extern-impl, r=RalfJung
Extend `environ` linux extern implementation to freebsd
This fixes the `env` test on freebsd, and enables the CI test
Signed-off-by: InfRandomness <infrandomness@gmail.com>
bors [Sat, 2 Jul 2022 12:38:40 +0000 (12:38 +0000)]
Auto merge of #2305 - RalfJung:rustup, r=RalfJung
rustup
Ralf Jung [Sat, 2 Jul 2022 12:38:07 +0000 (08:38 -0400)]
rustup
InfRandomness [Fri, 1 Jul 2022 19:28:45 +0000 (21:28 +0200)]
Enable env test on freebsd
Signed-off-by: InfRandomness <infrandomness@gmail.com>
InfRandomness [Fri, 1 Jul 2022 19:24:24 +0000 (21:24 +0200)]
Add `environ` extern implementation to freebsd
Signed-off-by: InfRandomness <infrandomness@gmail.com>
bors [Sat, 2 Jul 2022 07:31:16 +0000 (07:31 +0000)]
Auto merge of #2304 - LegNeato:shim-fstat64-mac, r=oli-obk
Support (stat/fstat/lstat)64 on macos
"In order to accommodate advanced capabilities of newer file systems,
the struct stat, struct statfs, and struct dirent data structures
were updated in Mac OSX 10.5."
"TRANSITIONAL DESCRIPTION (NOW DEPRECATED)
The fstat64, lstat64 and stat64 routines are equivalent to their
corresponding non-64-suffixed routine, when 64-bit inodes are in
effect. They were added before there was support for the symbol
variants, and so are now deprecated. Instead of using these, set
the _DARWIN_USE_64_BIT_INODE macro before including header files to
force 64-bit inode support. The stat64 structure used by these deprecated routines is the same
as the stat structure when 64-bit inodes are in effect (see above)."
"HISTORY
An lstat() function call appeared in 4.2BSD. The stat64(),
fstat64(), and lstat64() system calls first appeared in Mac OS X
10.5 (Leopard) and are now deprecated in favor of the corresponding
symbol variants. The fstatat() system call appeared in OS X 10.10"
Christian Legnitto [Sat, 2 Jul 2022 02:05:15 +0000 (20:05 -0600)]
Support (stat/fstat/lstat)64 on macos
"In order to accommodate advanced capabilities of newer file systems,
the struct stat, struct statfs, and struct dirent data structures
were updated in Mac OSX 10.5."
"TRANSITIONAL DESCRIPTION (NOW DEPRECATED)
The fstat64, lstat64 and stat64 routines are equivalent to their
corresponding non-64-suffixed routine, when 64-bit inodes are in
effect. They were added before there was support for the symbol
variants, and so are now deprecated. Instead of using these, set
the _DARWIN_USE_64_BIT_INODE macro before including header files to
force 64-bit inode support.
The stat64 structure used by these deprecated routines is the same
as the stat structure when 64-bit inodes are in effect (see above)."
"HISTORY
An lstat() function call appeared in 4.2BSD. The stat64(),
fstat64(), and lstat64() system calls first appeared in Mac OS X
10.5 (Leopard) and are now deprecated in favor of the corresponding
symbol variants. The fstatat() system call appeared in OS X 10.10"
bors [Sat, 2 Jul 2022 00:14:06 +0000 (00:14 +0000)]
Auto merge of #2302 - RalfJung:datarace, r=RalfJung
avoid copying thread manager state in data race detector
When doing https://github.com/rust-lang/miri/pull/2047 I did not realize that there is some redundant state here that we can now remove from the data race detector.
Also this removes the vector clocks from the data race errors since those don't really help diagnose the problem.
Ralf Jung [Fri, 1 Jul 2022 21:33:17 +0000 (17:33 -0400)]
fix and slightly improve data race reports
Ralf Jung [Fri, 1 Jul 2022 21:07:29 +0000 (17:07 -0400)]
avoid copying thread manager state in data race detector
Ralf Jung [Fri, 1 Jul 2022 20:21:46 +0000 (16:21 -0400)]
rename some data_race types for more clarity
bors [Fri, 1 Jul 2022 18:14:23 +0000 (18:14 +0000)]
Auto merge of #2299 - RalfJung:bsd, r=RalfJung
test more things on FreeBSD
Ralf Jung [Fri, 1 Jul 2022 18:13:36 +0000 (14:13 -0400)]
run data_race tests on bsd
Ralf Jung [Fri, 1 Jul 2022 18:12:25 +0000 (14:12 -0400)]
more current_dir tests for freebsd
bors [Fri, 1 Jul 2022 17:41:10 +0000 (17:41 +0000)]
Auto merge of #2298 - InfRandomness:shim-error, r=RalfJung
Add `__error` to freebsd shims
Signed-off-by: InfRandomness <infrandomness@gmail.com>
InfRandomness [Fri, 1 Jul 2022 16:52:32 +0000 (18:52 +0200)]
Add `current_dir_with_isolation` to freebsd tests list
Signed-off-by: InfRandomness <infrandomness@gmail.com>
InfRandomness [Fri, 1 Jul 2022 16:36:14 +0000 (18:36 +0200)]
Add `__error` to freebsd shims
Signed-off-by: InfRandomness <infrandomness@gmail.com>
bors [Fri, 1 Jul 2022 16:26:25 +0000 (16:26 +0000)]
Auto merge of #2297 - RalfJung:rustup, r=RalfJung
rustup
Ralf Jung [Fri, 1 Jul 2022 16:25:35 +0000 (12:25 -0400)]
make clippy happy
bors [Fri, 1 Jul 2022 14:46:30 +0000 (14:46 +0000)]
Auto merge of #2296 - RalfJung:miri-script, r=RalfJung
./miri improvements
I have needed to run something with many different seeds often enough that I would like an easier way to do it. ;) So now we have `./miri many-seeds`.
Also I made the script less dependent on the working directory, so calling it from a different directory should work properly now even if that other directory does not have the same rustup override as the one where Miri lives.
Ralf Jung [Fri, 1 Jul 2022 14:14:31 +0000 (10:14 -0400)]
rustup
Ralf Jung [Fri, 1 Jul 2022 14:01:00 +0000 (10:01 -0400)]
more tweaks
Ralf Jung [Fri, 1 Jul 2022 13:55:02 +0000 (09:55 -0400)]
add './miri many-seeds', and respect MIRIFLAGS in './miri run'
Ralf Jung [Fri, 1 Jul 2022 11:53:17 +0000 (07:53 -0400)]
make miri script work from other working directories
bors [Fri, 1 Jul 2022 02:24:51 +0000 (02:24 +0000)]
Auto merge of #2295 - RalfJung:better-alloc-tracking, r=RalfJung
allocation tracking: also print size, alignment, kind of the allocation
Ralf Jung [Thu, 30 Jun 2022 22:41:32 +0000 (18:41 -0400)]
allocation tracking: also print size, alignment, kind of the allocation
bors [Thu, 30 Jun 2022 15:15:20 +0000 (15:15 +0000)]
Auto merge of #2293 - RalfJung:env, r=RalfJung
make -Zmiri-env-forward take precedence over -Zmiri-env-exclude
Lets people experiment with the `TERM` env var.
Ralf Jung [Thu, 30 Jun 2022 15:13:26 +0000 (11:13 -0400)]
make -Zmiri-env-forward take precedence over -Zmiri-env-exclude
bors [Thu, 30 Jun 2022 14:05:32 +0000 (14:05 +0000)]
Auto merge of #2291 - RalfJung:no-std-is-minimal, r=RalfJung
use run_tests_minimal for the new no-std test
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