]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoremove ancient tex files
Ralf Jung [Mon, 4 Jul 2022 19:26:02 +0000 (15:26 -0400)]
remove ancient tex files

2 years agoAuto merge of #2327 - RalfJung:unit-return, r=RalfJung
bors [Mon, 4 Jul 2022 17:47:28 +0000 (17:47 +0000)]
Auto merge of #2327 - RalfJung:unit-return, r=RalfJung

call_function: make the unit-return-type case more convenient

2 years agocall_function: make the unit-return-type case more convenient
Ralf Jung [Mon, 4 Jul 2022 17:46:11 +0000 (13:46 -0400)]
call_function: make the unit-return-type case more convenient

2 years agoAuto merge of #2326 - RalfJung:vscode, r=RalfJung
bors [Mon, 4 Jul 2022 17:07:46 +0000 (17:07 +0000)]
Auto merge of #2326 - RalfJung:vscode, r=RalfJung

update vscode settings

Following [this recommendation](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/.22target.22.20directory.20in.20rustc.20tree.3F/near/288428273)
Cc https://github.com/rust-lang/rustc-dev-guide/pull/1384

2 years agoupdate vscode settings
Ralf Jung [Mon, 4 Jul 2022 16:51:20 +0000 (12:51 -0400)]
update vscode settings

2 years agoAuto merge of #2320 - RalfJung:less-rebuilds, r=RalfJung
bors [Sun, 3 Jul 2022 16:31:49 +0000 (16:31 +0000)]
Auto merge of #2320 - RalfJung:less-rebuilds, r=RalfJung

reduce regex features to reduce rebuilds

Helps with the issue I [mentioned on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/269128-miri/topic/Miri.20rebuilds/near/287442340).

2 years agoreduce regex features to reduce rebuilds
Ralf Jung [Sun, 3 Jul 2022 16:28:57 +0000 (12:28 -0400)]
reduce regex features to reduce rebuilds

2 years agoAuto merge of #2319 - RalfJung:dont-touch-vtables, r=RalfJung
bors [Sun, 3 Jul 2022 15:56:55 +0000 (15:56 +0000)]
Auto merge of #2319 - RalfJung:dont-touch-vtables, r=RalfJung

fix retagging of vtable ptrs

Fixes a problem reported by `@saethlin` on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/269128-miri/topic/Stacked.20Borrows.20field.20retagging/near/288040048).

2 years agofix retagging of vtable ptrs
Ralf Jung [Sun, 3 Jul 2022 15:54:47 +0000 (11:54 -0400)]
fix retagging of vtable ptrs

2 years agoAuto merge of #2318 - RalfJung:nodoc, r=RalfJung
bors [Sun, 3 Jul 2022 15:03:19 +0000 (15:03 +0000)]
Auto merge of #2318 - RalfJung:nodoc, r=RalfJung

there are no doctests in ui_test

It tries to run doctests which leads to an error when testing against a locally built rustc (that has no rustdoc).

2 years agono doctests in ui_test
Ralf Jung [Sun, 3 Jul 2022 14:45:39 +0000 (10:45 -0400)]
no doctests in ui_test

2 years agoAuto merge of #1935 - saethlin:optimize-sb, r=RalfJung
bors [Sun, 3 Jul 2022 14:39:22 +0000 (14:39 +0000)]
Auto merge of #1935 - saethlin:optimize-sb, r=RalfJung

Optimizing Stacked Borrows (part 1?): Cache locations of Tags in a Borrow Stack

Before this PR, a profile of Miri under almost any workload points quite squarely at these regions of code as being incredibly hot (each being ~40% of cycles):

https://github.com/rust-lang/miri/blob/dadcbebfbd017aac2358cf652a4bd71a91694edc/src/stacked_borrows.rs#L259-L269

https://github.com/rust-lang/miri/blob/dadcbebfbd017aac2358cf652a4bd71a91694edc/src/stacked_borrows.rs#L362-L369

This code is one of at least three reasons that stacked borrows analysis is super-linear: These are both linear in the number of borrows in the stack and they are positioned along the most commonly-taken paths.

I'm addressing the first loop (which is in `Stack::find_granting`) by adding a very very simple sort of LRU cache implemented on a `VecDeque`, which maps recently-looked-up tags to their position in the stack. For `Untagged` access we fall back to the same sort of linear search. But as far as I can tell there are never enough `Untagged` items to be significant.

I'm addressing the second loop by keeping track of the region of stack where there could be items granting `Permission::Unique`. This optimization is incredibly effective because `Read` access tends to dominate and many trips through this code path now skip the loop entirely.

These optimizations result in pretty enormous improvements:
Without raw pointer tagging, `mse` 34.5s -> 2.4s, `serde1` 5.6s -> 3.6s
With raw pointer tagging, `mse` 35.3s -> 2.4s, `serde1` 5.7s -> 3.6s

And there is hardly any impact on memory usage:
Memory usage on `mse` 844 MB -> 848 MB, `serde1` 184 MB -> 184 MB (jitter on these is a few MB).

2 years agoAuto merge of #2316 - domenicquirl:readme-track-tag, r=RalfJung
bors [Sun, 3 Jul 2022 14:07:27 +0000 (14:07 +0000)]
Auto merge of #2316 - domenicquirl:readme-track-tag, r=RalfJung

Clarify the effect of the `-Zmiri-track-pointer-tag` flag in the README

Edit the README to explicitly say that the `-Zmiri-track-pointer-tag` flag also tracks the creation of tags, not just when they are popped/invalidated.

Related to https://github.com/rust-lang/miri/pull/2308 / https://github.com/Manishearth/triomphe/issues/38.

2 years agoclarify that a (tracked) tag may never be popped
DQ [Sun, 3 Jul 2022 13:47:39 +0000 (15:47 +0200)]
clarify that a (tracked) tag may never be popped

Co-authored-by: Ralf Jung <post@ralfj.de>
2 years agoAuto merge of #2317 - RalfJung:this-is-not-a-std-test-suite, r=RalfJung
bors [Sun, 3 Jul 2022 12:36:04 +0000 (12:36 +0000)]
Auto merge of #2317 - RalfJung:this-is-not-a-std-test-suite, r=RalfJung

move arc_drop test to miri-test-libstd

That's where we have a bunch of slow and unlikely-to-regress tests already. Miri's test suite should primarily test Miri; we sometimes add libstd tests when they are cheap and/or exercise interesting code paths in Miri. https://github.com/rust-lang/miri/pull/2248 already ensures that we allow code like `Arc` with more direct tests.

2 years agofix ./miri run with MIRI_TEST_TARGET
Ralf Jung [Sun, 3 Jul 2022 12:35:44 +0000 (08:35 -0400)]
fix ./miri run with MIRI_TEST_TARGET

2 years agoanother one for the trophy case
Ralf Jung [Sun, 3 Jul 2022 12:18:03 +0000 (08:18 -0400)]
another one for the trophy case

2 years agomove arc_drop test to miri-test-libstd
Ralf Jung [Sun, 3 Jul 2022 12:13:58 +0000 (08:13 -0400)]
move arc_drop test to miri-test-libstd

and make weak memory consistency test a bit faster again

2 years agoClarify `-Zmiri-track-pointer-tag`
DQ [Sun, 3 Jul 2022 09:32:36 +0000 (11:32 +0200)]
Clarify `-Zmiri-track-pointer-tag`

to explicitly say it also tracks tag creation

2 years agoTypo
Ben Kimock [Sun, 3 Jul 2022 00:45:27 +0000 (20:45 -0400)]
Typo

2 years agoExplain cache behavior a bit better, clean up diff
Ben Kimock [Sat, 2 Jul 2022 23:44:55 +0000 (19:44 -0400)]
Explain cache behavior a bit better, clean up diff

2 years agoAuto merge of #2312 - RalfJung:misc, r=RalfJung
bors [Sat, 2 Jul 2022 22:38:36 +0000 (22:38 +0000)]
Auto merge of #2312 - RalfJung:misc, r=RalfJung

put call to stacked borrows end_call in a more sensible place

This looks like a refactoring accident.

2 years agoreadme tweaks
Ralf Jung [Sat, 2 Jul 2022 22:36:34 +0000 (18:36 -0400)]
readme tweaks

2 years agoput call to stacked borrows end_call in a more sensible place
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

2 years agoAuto merge of #2311 - RalfJung:many-seeds, r=RalfJung
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.

2 years ago./miri many-seeds: also print the seed before we try it
Ralf Jung [Sat, 2 Jul 2022 20:06:23 +0000 (16:06 -0400)]
./miri many-seeds: also print the seed before we try it

2 years agoAuto merge of #2309 - RalfJung:read_link, r=RalfJung
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.

2 years agotest fs::read_link surface function
Ralf Jung [Sat, 2 Jul 2022 16:26:00 +0000 (12:26 -0400)]
test fs::read_link surface function

2 years agoExplain the behavior of the cache upon clear
Ben Kimock [Sat, 2 Jul 2022 17:22:22 +0000 (13:22 -0400)]
Explain the behavior of the cache upon clear

2 years agoAuto merge of #2308 - RalfJung:ptr-tacking, r=RalfJung
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.

2 years agopointer tag tracking: on creation, log the offsets it is created for
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

2 years agoAuto merge of #2306 - RalfJung:unix, r=RalfJung
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

2 years agoposix_fadvise is not Linux-specific
Ralf Jung [Sat, 2 Jul 2022 13:06:35 +0000 (09:06 -0400)]
posix_fadvise is not Linux-specific

2 years agomale libc.rs at least build on FreeBSD
Ralf Jung [Sat, 2 Jul 2022 13:06:17 +0000 (09:06 -0400)]
male libc.rs at least build on FreeBSD

2 years agomove some POSIX file shims from linux to unix module
Ralf Jung [Sat, 2 Jul 2022 12:58:04 +0000 (08:58 -0400)]
move some POSIX file shims from linux to unix module

2 years agoAuto merge of #2300 - InfRandomness:freebsd-environ-extern-impl, r=RalfJung
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>
2 years agoAuto merge of #2305 - RalfJung:rustup, r=RalfJung
bors [Sat, 2 Jul 2022 12:38:40 +0000 (12:38 +0000)]
Auto merge of #2305 - RalfJung:rustup, r=RalfJung

rustup

2 years agorustup
Ralf Jung [Sat, 2 Jul 2022 12:38:07 +0000 (08:38 -0400)]
rustup

2 years agoEnable env test on freebsd
InfRandomness [Fri, 1 Jul 2022 19:28:45 +0000 (21:28 +0200)]
Enable env test on freebsd

Signed-off-by: InfRandomness <infrandomness@gmail.com>
2 years agoAdd `environ` extern implementation to freebsd
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>
2 years agoAuto merge of #2304 - LegNeato:shim-fstat64-mac, r=oli-obk
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"

2 years agoSupport (stat/fstat/lstat)64 on macos
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"

2 years agoDocument implementation a bit, add some fast paths
Ben Kimock [Sat, 2 Jul 2022 00:15:34 +0000 (20:15 -0400)]
Document implementation a bit, add some fast paths

2 years agoAuto merge of #2302 - RalfJung:datarace, r=RalfJung
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.

2 years agofix and slightly improve data race reports
Ralf Jung [Fri, 1 Jul 2022 21:33:17 +0000 (17:33 -0400)]
fix and slightly improve data race reports

2 years agoCache lookups into the borrow stack
Ben Kimock [Wed, 8 Dec 2021 03:05:13 +0000 (22:05 -0500)]
Cache lookups into the borrow stack

This adds a very simple LRU-like cache which stores the locations of
often-used tags. While the implementation is very simple, the cache hit
rate is incredible at ~99.9% on most programs, and often the element at
position 0 in the cache has a hit rate of 90%. So the sub-optimality of
this cache basicaly vanishes into the noise in a profile.

Additionally, we keep a range which denotes where there might be an item
granting Unique permission in the stack, so that when we invalidate
Uniques we do not need to scan much of the stack, and often scan nothing
at all.

2 years agoavoid copying thread manager state in data race detector
Ralf Jung [Fri, 1 Jul 2022 21:07:29 +0000 (17:07 -0400)]
avoid copying thread manager state in data race detector

2 years agorename some data_race types for more clarity
Ralf Jung [Fri, 1 Jul 2022 20:21:46 +0000 (16:21 -0400)]
rename some data_race types for more clarity

2 years agoAuto merge of #2299 - RalfJung:bsd, r=RalfJung
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

2 years agorun data_race tests on bsd
Ralf Jung [Fri, 1 Jul 2022 18:13:36 +0000 (14:13 -0400)]
run data_race tests on bsd

2 years agomore current_dir tests for freebsd
Ralf Jung [Fri, 1 Jul 2022 18:12:25 +0000 (14:12 -0400)]
more current_dir tests for freebsd

2 years agoAuto merge of #2298 - InfRandomness:shim-error, r=RalfJung
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>
2 years agoAdd `current_dir_with_isolation` to freebsd tests list
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>
2 years agoAdd `__error` to freebsd shims
InfRandomness [Fri, 1 Jul 2022 16:36:14 +0000 (18:36 +0200)]
Add `__error` to freebsd shims

Signed-off-by: InfRandomness <infrandomness@gmail.com>
2 years agoAuto merge of #2297 - RalfJung:rustup, r=RalfJung
bors [Fri, 1 Jul 2022 16:26:25 +0000 (16:26 +0000)]
Auto merge of #2297 - RalfJung:rustup, r=RalfJung

rustup

2 years agomake clippy happy
Ralf Jung [Fri, 1 Jul 2022 16:25:35 +0000 (12:25 -0400)]
make clippy happy

2 years agoAuto merge of #2296 - RalfJung:miri-script, r=RalfJung
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.

2 years agorustup
Ralf Jung [Fri, 1 Jul 2022 14:14:31 +0000 (10:14 -0400)]
rustup

2 years agomore tweaks
Ralf Jung [Fri, 1 Jul 2022 14:01:00 +0000 (10:01 -0400)]
more tweaks

2 years agoadd './miri many-seeds', and respect MIRIFLAGS in './miri run'
Ralf Jung [Fri, 1 Jul 2022 13:55:02 +0000 (09:55 -0400)]
add './miri many-seeds', and respect MIRIFLAGS in './miri run'

2 years agomake miri script work from other working directories
Ralf Jung [Fri, 1 Jul 2022 11:53:17 +0000 (07:53 -0400)]
make miri script work from other working directories

2 years agoAuto merge of #2295 - RalfJung:better-alloc-tracking, r=RalfJung
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

2 years agoallocation 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

2 years agoAuto merge of #2293 - RalfJung:env, r=RalfJung
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.

2 years agomake -Zmiri-env-forward take precedence over -Zmiri-env-exclude
Ralf Jung [Thu, 30 Jun 2022 15:13:26 +0000 (11:13 -0400)]
make -Zmiri-env-forward take precedence over -Zmiri-env-exclude

2 years agoAuto merge of #2291 - RalfJung:no-std-is-minimal, r=RalfJung
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

2 years agouse 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

2 years agoAuto merge of #2282 - rust-lang:no_std, r=RalfJung
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.

2 years agoSupport no-std targets and test it in CI
Oli Scherer [Wed, 29 Jun 2022 13:29:35 +0000 (13:29 +0000)]
Support no-std targets and test it in CI

2 years agoAuto merge of #2290 - RalfJung:snakessss, r=RalfJung
bors [Thu, 30 Jun 2022 02:18:34 +0000 (02:18 +0000)]
Auto merge of #2290 - RalfJung:snakessss, r=RalfJung

use Rust SnakeCase

2 years agouse Rust SnakeCase
Ralf Jung [Thu, 30 Jun 2022 02:17:46 +0000 (22:17 -0400)]
use Rust SnakeCase

2 years agoAuto merge of #2289 - RalfJung:rustup, r=RalfJung
bors [Thu, 30 Jun 2022 01:31:55 +0000 (01:31 +0000)]
Auto merge of #2289 - RalfJung:rustup, r=RalfJung

rustup

2 years agorustup
Ralf Jung [Thu, 30 Jun 2022 01:31:27 +0000 (21:31 -0400)]
rustup

2 years agoAuto merge of #2287 - RalfJung:field-retagging, r=RalfJung
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

2 years agoAuto merge of #2286 - LegNeato:patch-2, r=RalfJung
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.

2 years agomerge two SB test files
Ralf Jung [Wed, 29 Jun 2022 21:56:47 +0000 (17:56 -0400)]
merge two SB test files

2 years agoadd option for recursive field retagging
Ralf Jung [Wed, 29 Jun 2022 21:53:09 +0000 (17:53 -0400)]
add option for recursive field retagging

2 years agoAuto merge of #2288 - RalfJung:clippy, r=RalfJung
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

2 years agomake ui_test pass clippy
Ralf Jung [Wed, 29 Jun 2022 22:17:28 +0000 (18:17 -0400)]
make ui_test pass clippy

2 years agoadd ./miri clippy
Ralf Jung [Wed, 29 Jun 2022 22:14:41 +0000 (18:14 -0400)]
add ./miri clippy

2 years agoSupport `gettimeofday` on more than macos
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>
2 years agoAuto merge of #2285 - LegNeato:patch-1, r=RalfJung
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`.

2 years agoUpdate path to passing tests in CONTRIBUTING.md examples
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`.

2 years agoAuto merge of #2283 - RalfJung:color, r=RalfJung
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

2 years agorevert --color=always changes
Ralf Jung [Wed, 29 Jun 2022 14:14:26 +0000 (10:14 -0400)]
revert --color=always changes

2 years agoAuto merge of #2281 - RalfJung:rustup, r=RalfJung
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!

2 years agofmt
Ralf Jung [Wed, 29 Jun 2022 14:09:18 +0000 (10:09 -0400)]
fmt

2 years agoalso prune caller_location frames when backtrace=off
Ralf Jung [Wed, 29 Jun 2022 13:33:12 +0000 (09:33 -0400)]
also prune caller_location frames when backtrace=off

2 years agoimprove atomics test coverage
Ralf Jung [Wed, 29 Jun 2022 13:31:11 +0000 (09:31 -0400)]
improve atomics test coverage

2 years agorustup
Ralf Jung [Wed, 29 Jun 2022 12:33:06 +0000 (08:33 -0400)]
rustup

2 years agoAuto merge of #2280 - RalfJung:int2ptr, r=RalfJung
bors [Tue, 28 Jun 2022 12:53:27 +0000 (12:53 +0000)]
Auto merge of #2280 - RalfJung:int2ptr, r=RalfJung

tweak int2ptr diagnostics

2 years agotweak int2ptr diagnostics
Ralf Jung [Tue, 28 Jun 2022 12:52:22 +0000 (08:52 -0400)]
tweak int2ptr diagnostics

2 years agoAuto merge of #2279 - RalfJung:adjacent-allocs, r=RalfJung
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?...

2 years agotypo
Ralf Jung [Tue, 28 Jun 2022 02:11:09 +0000 (22:11 -0400)]
typo

2 years agoupdate getrandom
Ralf Jung [Mon, 27 Jun 2022 15:16:27 +0000 (11:16 -0400)]
update getrandom

2 years agofinally we can actually have adjacent allocations :)
Ralf Jung [Mon, 27 Jun 2022 12:13:55 +0000 (08:13 -0400)]
finally we can actually have adjacent allocations :)

2 years agoAuto merge of #2278 - RalfJung:rustup, r=RalfJung
bors [Tue, 28 Jun 2022 01:53:06 +0000 (01:53 +0000)]
Auto merge of #2278 - RalfJung:rustup, r=RalfJung

Rustup

2 years agorustup
Ralf Jung [Tue, 28 Jun 2022 01:29:40 +0000 (21:29 -0400)]
rustup

2 years agomake use of get_alloc_info
Ralf Jung [Mon, 27 Jun 2022 15:09:28 +0000 (11:09 -0400)]
make use of get_alloc_info

2 years agoAuto merge of #2275 - RalfJung:permissive-provenance-for-all, r=RalfJung
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