Commit Graph

5774 Commits

Author SHA1 Message Date
Ben Kimock
19ecd130b5 Prune backtraces similar to RUST_BACKTRACE=1 logic
Previously, Miri would always print a backtrace including all frames
when encountering an error. This adds -Zmiri-backtrace which defaults
to 1, internally called BacktraceStyle::Short. By default, backtraces
are pruned to start at __rust_begin_short_backtrace, similar to std.
Then we also remove non-local frames from the bottom of the trace.
This cleans up the last one or two shims outside main or a test.

Users can opt out of pruning by setting -Zmiri-backtrace=full, and will
be automatically opted out if there are no local frames because that
means the reported error is likely in the Rust runtime, which this
pruning is crafted to remove.
2022-02-22 10:32:52 -05:00
bors
d03b4a0c58 Auto merge of #1978 - RalfJung:simd_eq, r=RalfJung
implement simd_eq and simd_reduce_any

This lets us re-enable the division and modulo tests, since those operations now internally use simd_eq and simd_reduce_any.

However, I am not sure what exactly the rules are for simd_reduce_any. `@workingjubilee` for now I made it UB to call those with inputs that are not all-0 or all-1, but that might be taking it too far?
2022-02-22 02:43:53 +00:00
Ralf Jung
1ac1e55f3b implement simd_eq and simd_reduce_any 2022-02-21 21:41:52 -05:00
Ralf Jung
c8fff51825 rustup 2022-02-21 21:36:03 -05:00
bors
2b0078e455 Auto merge of #1979 - RalfJung:trophy, r=RalfJung
another for the trophy case
2022-02-21 02:42:18 +00:00
Ralf Jung
a21c98a896 another for the trophy case 2022-02-20 21:41:37 -05:00
bors
0db4090376 Auto merge of #1974 - RalfJung:const, r=RalfJung
implement const_deallocate as a NOP
2022-02-12 11:19:37 +00:00
Ralf Jung
ec66d2934b implement const_deallocate as a NOP 2022-02-12 12:17:37 +01:00
bors
2ba1e843c1 Auto merge of #1973 - RalfJung:rustup, r=RalfJung
implement const_allocate intrinsic

This is needed to make the libcore test suite pass again.
2022-02-12 10:54:24 +00:00
Ralf Jung
dfa0a3b3c7 implement const_allocate intrinsic 2022-02-12 11:53:51 +01:00
bors
a284d4f551 Auto merge of #1968 - RalfJung:rustup, r=RalfJung
rustup; implement simd_and/or

I had to disable the integer division tests since they now require simd_eq, which seems [non-trivial to implement](https://github.com/rust-lang/miri/issues/1912#issuecomment-1030164843).

Cc https://github.com/rust-lang/rust/issues/93619
2022-02-04 17:01:23 +00:00
Ralf Jung
6b8baee339 rustup; implement simd_and/or 2022-02-04 17:56:08 +01:00
bors
098b6a3fc7 Auto merge of #1967 - RalfJung:rustup, r=RalfJung
rustup: disable read_dir test for now

I don't currently have time to fix our read_dir support, so I disabled the tests for now. https://github.com/rust-lang/miri/issues/1966 tracks bringing back that functionality.
2022-02-04 16:18:30 +00:00
Ralf Jung
3d5eb52cbd rustup: disable read_dir test for now 2022-02-04 17:17:28 +01:00
bors
36378cf60d Auto merge of #1964 - RalfJung:rustup, r=RalfJung
rustup

Let's hope we can finally get CI green again...
2022-01-26 16:00:00 +00:00
Ralf Jung
42b144ee8c rustup 2022-01-26 10:54:55 -05:00
bors
aea10ca101 Auto merge of #1961 - ojeda:spurious-maybe_uninit_extra, r=oli-obk
Remove spurious `maybe_uninit_extra`

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2022-01-11 17:37:37 +00:00
Miguel Ojeda
922962f662 Remove spurious maybe_uninit_extra
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2022-01-11 16:17:52 +01:00
bors
deb9bfd246 Auto merge of #1952 - RalfJung:self-referential, r=RalfJung
exclude mutable references to !Unpin types from uniqueness guarantees

This basically works around https://github.com/rust-lang/unsafe-code-guidelines/issues/148 by not requiring uniqueness any more for mutable references to self-referential generators. That corresponds to [the same work-around that was applied in rustc itself](b815532674/compiler/rustc_middle/src/ty/layout.rs (L2482)).

I am not entirely sure if this is a good idea since it might hide too many errors in case types are "accidentally" `!Unpin`. OTOH, our test suite still passes, and to my knowledge the vast majority of types is `Unpin`. (`place.layout.ty` is monomorphic, we should always exactly know which type this is.)
2022-01-09 14:10:00 +00:00
bors
c8b3cf0060 Auto merge of #1960 - RalfJung:rustup, r=RalfJung
rustup

Cc https://github.com/rust-lang/rust/issues/92691
2022-01-09 13:50:34 +00:00
Ralf Jung
ee6198fb98 rustup 2022-01-09 14:50:03 +01:00
bors
5d21a5d65f Auto merge of #1959 - RalfJung:rustup, r=RalfJung
rustup
2022-01-08 16:28:39 +00:00
Ralf Jung
9376bf5d4d rustup 2022-01-08 17:27:48 +01:00
bors
824816c973 Auto merge of #1956 - RalfJung:stack-pop-cleanup, r=RalfJung
adjust for StackPopCleanup::None rename

This is the Miri side of https://github.com/rust-lang/rust/pull/92551
2022-01-05 08:56:05 +00:00
Ralf Jung
522f40b086 rustup 2022-01-05 09:55:29 +01:00
Ralf Jung
81751a2a00 adjust for StackPopCleanup::None rename 2022-01-04 11:14:55 +01:00
bors
ad0c24936c Auto merge of #1954 - RalfJung:rustup, r=RalfJung
rustup

Cc https://github.com/rust-lang/rust/issues/92527
2022-01-03 22:25:44 +00:00
Ralf Jung
808f794115 rustup 2022-01-03 22:54:58 +01:00
bors
e9343150de Auto merge of #1953 - klensy:deps-up, r=RalfJung
update crate rustc_version 0.3 -> 0.4 to remove some deps

This removes some deps and pulls only one version of `rustc_version` crate.
2022-01-03 09:16:06 +00:00
klensy
45442c80b8 update crate rustc_version 0.3 -> 0.4 to remove some deps 2022-01-03 02:47:42 +03:00
Ralf Jung
77cec811b4 exclude mutable references to !Unpin types from uniqueness guarantees 2022-01-01 19:01:46 +01:00
bors
9132ee3cd8 Auto merge of #1951 - RalfJung:rustup, r=RalfJung
rustup

The previously pinned toolchain was affected by https://github.com/rust-lang/rust/issues/92163, let's switch to one where that problem is fixed.
2022-01-01 17:54:02 +00:00
Ralf Jung
a58d43cf31 rustup 2022-01-01 18:52:45 +01:00
bors
d307e6c197 Auto merge of #1928 - RalfJung:fn-abi, r=RalfJung
adjust for FnAbi changes

This is the Miri side of https://github.com/rust-lang/rust/pull/91342.
2021-12-24 11:04:48 +00:00
Ralf Jung
5ab0ea67f2 adjust output for calling convention check 2021-12-24 12:02:23 +01:00
Ralf Jung
a312297973 adjust for FnAbi changes 2021-12-24 12:02:22 +01:00
bors
2170d7a7c9 Auto merge of #1949 - RalfJung:miri-lib-src, r=oli-obk
add and document MIRI_LIB_SRC env var to set the source from which Miri builds the standard library

This is just an alias of `XARGO_RUST_SRC`, but avoids exposing how exactly we use xargo.
2021-12-23 15:54:25 +00:00
Ralf Jung
e51810df2c add and document MIRI_LIB_SRC env var to set the source from which Miri builds the standard library 2021-12-23 16:04:09 +01:00
bors
6f3061b18e Auto merge of #1945 - saethlin:better-sb-tracking, r=RalfJung
Provide slightly better notes when tracking a pointer tag

I slapped this in as a sort of advanced println-based debugging when trying to figure out a track-raw-pointers finding in `smallvec`. Perhaps this looks like a good idea to you all?

EDIT: User scenario

Run `MIRIFLAGS=-Ztag-raw-pointers cargo miri test`, get a diagnostic that looks like
```
error: Undefined Behavior: trying to reborrow for SharedReadOnly at alloc99465+0x9, but parent tag <265507> does not have an appropriate item in the borrow stack
```
So now run `MIRIFLAGS=-Ztag-raw-pointers -Zmiri-track-pointer-tag=265507 cargo miri test`
Old:
```
note: tracking was triggered
   --> src/lib.rs:822:36
    |
822 |                 vec: NonNull::from(self),
    |                                    ^^^^ popped tracked tag for item [SharedReadOnly for <265507>]
```
New:
```
note: tracking was triggered
   --> src/lib.rs:822:36
    |
822 |                 vec: NonNull::from(self),
    |                                    ^^^^ popped tracked tag for item [SharedReadOnly for <265507>] due to Write access for <265356>
```
So that if a user is now beginning to question their sanity because they don't really understand SB yet, they can then track the tag which caused the parent tag to be removed from the stack to be sure what's going on here:
```
   --> src/lib.rs:792:5
    |
792 | /     pub fn drain<R>(&mut self, range: R) -> Drain<'_, A>
793 | |     where
794 | |         R: RangeBounds<usize>,
795 | |     {
...   |
824 | |         }
825 | |     }
    | |_____^ created tag 265356
```

The existing diagnostic can tell you where the tag you'd need was invalidated, but it cannot tell you what and why that tag was invalidated.
2021-12-21 21:25:52 +00:00
Ben Kimock
cd6921923c Provide better notes when tracking a pointer tag 2021-12-21 12:15:29 -05:00
bors
e969615937 Auto merge of #1947 - RalfJung:macos-is-from-the-stone-age, r=RalfJung
macOS-compatible realpath

Make behavior consistent between Linux and macOS even though macOS lacks some basic shell tools
2021-12-20 22:17:40 +00:00
Ralf Jung
a9dd9b9571 macOS-compatible realpath 2021-12-20 23:14:17 +01:00
bors
cac6759451 Auto merge of #1944 - RalfJung:rustup, r=RalfJung
rustup
2021-12-19 18:49:41 +00:00
Ralf Jung
c0f1670e47 rustup 2021-12-19 19:49:05 +01:00
bors
812fd79e63 Auto merge of #1943 - RalfJung:readme, r=RalfJung
readme: be more explicit about the toolchain

Fixes https://github.com/rust-lang/miri/issues/1942

`@robamler` would this have helped?
2021-12-19 16:53:37 +00:00
Ralf Jung
db74c1c030 readme: be more explicit about the toolchain 2021-12-19 17:46:17 +01:00
bors
237390785d Auto merge of #1940 - RalfJung:xargo, r=RalfJung
require xargo 0.3.23

Fixes https://github.com/rust-lang/miri/issues/1939
2021-12-16 14:23:08 +00:00
Ralf Jung
b44f7ea079 require xargo 0.3.23 2021-12-16 15:20:58 +01:00
bors
2eb3b37c91 Auto merge of #1938 - RalfJung:test, r=RalfJung
add regression test

Adds a regression test for https://github.com/rust-lang/rust/issues/91636 (which was fixed by https://github.com/rust-lang/rust/pull/91856)
2021-12-15 18:11:57 +00:00
Ralf Jung
4da38299fa looks like the asm macro is stable :D 2021-12-15 19:11:18 +01:00