Commit Graph

1888 Commits

Author SHA1 Message Date
Ralf Jung
169569cccb
tweak variable name 2022-09-02 16:10:24 +02:00
Oli Scherer
7155a2190e Rustup 2022-09-02 13:55:18 +00:00
Ralf Jung
2f348abafc Revert "disable extern-so ffi support for now due to licensing situation"
This reverts commit 5f3545e773.
With https://github.com/tov/libffi-rs/pull/58 landed, we no longer depend on abort_on_panic.
2022-09-02 14:39:25 +02:00
Ralf Jung
5f3545e773 disable extern-so ffi support for now due to licensing situation 2022-09-01 22:25:14 +02:00
Ben Kimock
3cfb9915fc Add a protector test that demonstrates the base tag diagnostic 2022-08-31 21:37:44 -04:00
Ralf Jung
d21b601b6e make Miri build again with rustc provenance changes 2022-08-31 18:19:09 +02:00
Ralf Jung
1135ad31ab make shim_arg_size ptr-width-independent 2022-08-31 17:32:39 +02:00
Ralf Jung
671a4b8b0f make backtrace header a bit more visible 2022-08-31 17:32:39 +02:00
bors
feeeba2925 Auto merge of #2521 - oli-obk:bump_ui_test, r=RalfJung
Bump UI test dependency

This gives us the new diff renderer as well as the ability to run tests without parallelism if we'd want to.
2022-08-31 11:37:27 +00:00
Ralf Jung
240f92aae8
add comment 2022-08-31 13:36:25 +02:00
Oli Scherer
eafc100b50 Bump ui_test to 0.3.1 2022-08-31 11:06:35 +00:00
Oli Scherer
b74654f25c Bump UI test dependency 2022-08-31 10:27:50 +00:00
Ben Kimock
da0d4829bf Use the better FnEntry spans in protector errors 2022-08-29 18:06:30 -04:00
bors
284b59c4dc Auto merge of #2517 - saethlin:zst-field-retagging, r=RalfJung
Skip field retagging on ZSTs, it can take forever

I just tried running the `alloc`'s tests with `miri-test-libstd` with field retagging enabled. The test suite eventually hangs on a few tests which pass around ZSTs that have a lot of fields.

I don't really know how to test this effectively. The test passes, but if you remove this fast-path it effectively just hangs the interpreter. And since it hangs _inside_ a step, there's no hope for doing some kind of timeout within the test.
2022-08-29 11:46:26 +00:00
Ralf Jung
c9b36b4ded
clarify test purpose 2022-08-29 07:46:03 -04:00
Ben Kimock
70b960b879 Skip field retagging on ZSTs, it can take forever 2022-08-29 00:31:46 -04:00
bors
fec1c7aa32 Auto merge of #2513 - RalfJung:protected, r=saethlin
slightly improve protector-related error messages

I find the current retag messages confusing, since they sound like the item *was* protected, when it still actively *is* protected (and that is, in fact, the issue).

Example error message:
```
error: Undefined Behavior: not granting access to tag <3095> because incompatible item [Unique for <3099>] is protected by call 943
  --> tests/fail/stacked_borrows/invalidate_against_barrier1.rs:5:25
   |
5  |     let _val = unsafe { *x }; //~ ERROR: protect
   |                         ^^ not granting access to tag <3095> because incompatible item [Unique for <3099>] is protected by call 943
   |
   = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
   = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
help: <3095> was created by a SharedReadWrite retag at offsets [0x0..0x4]
  --> tests/fail/stacked_borrows/invalidate_against_barrier1.rs:10:16
   |
10 |     let xraw = &mut x as *mut _;
   |                ^^^^^^
help: <3095> cannot be used for memory access because that would remove protected tag <3099>, protected by this function call
  --> tests/fail/stacked_borrows/invalidate_against_barrier1.rs:1:1
   |
1  | / fn inner(x: *mut i32, _y: &mut i32) {
2  | |     // If `x` and `y` alias, retagging is fine with this... but we really
3  | |     // shouldn't be allowed to use `x` at all because `y` was assumed to be
4  | |     // unique for the duration of this call.
5  | |     let _val = unsafe { *x }; //~ ERROR: protect
6  | | }
   | |_^
help: <3099> was derived from <3098>, which in turn was created here
  --> tests/fail/stacked_borrows/invalidate_against_barrier1.rs:12:17
   |
12 |     inner(xraw, xref);
   |                 ^^^^
   = note: backtrace:
   = note: inside `inner` at tests/fail/stacked_borrows/invalidate_against_barrier1.rs:5:25
note: inside `main` at tests/fail/stacked_borrows/invalidate_against_barrier1.rs:12:5
  --> tests/fail/stacked_borrows/invalidate_against_barrier1.rs:12:5
   |
12 |     inner(xraw, xref);
   |     ^^^^^^^^^^^^^^^^^
```

r? `@saethlin`
2022-08-28 16:01:49 +00:00
Ralf Jung
abe890d2ce slightly improve protector-related error messages
also rename some tests that still used outdated "barrier" terminology
2022-08-28 09:27:10 -04:00
Andy Wang
a2467c9b2a
Add C++20 SC access test 2022-08-27 15:24:25 +01:00
Ralf Jung
3a2252b7b3 adjust for earlier init checking in the core engine 2022-08-27 08:51:28 -04:00
Ralf Jung
82802337a8 rename test to match usual naming conventions
what's a "fcts"?
2022-08-26 17:40:26 -04:00
Ralf Jung
10a1a59c4b fix data race error during env var cleanup 2022-08-26 09:32:30 -04:00
Ellen Arteca
88a7882615 C FFI support for functions with int args and returns 2022-08-26 00:53:23 +00:00
Oli Scherer
6f8885e60f Run pass tests without building dependencies first 2022-08-25 08:03:50 +00:00
Ralf Jung
afacf62cf0 notes on TLS dtor order 2022-08-22 12:20:53 -04:00
Ralf Jung
53037a7c09 allow NOP-casts with mismatching vtables 2022-08-19 23:33:15 -04:00
Ralf Jung
7397c8e9cf re-bless after rebase 2022-08-18 16:36:53 -04:00
Ben Kimock
14e72e7ffa Improve information sharing across SB diagnostics
Previous Stacked Borrows diagnostics were missing a lot of information
about the state of the interpreter, and it was difficult to add
additional state because it was threaded through all the intervening
function signatures.

This change factors a lot of the arguments which used to be passed
individually to many stacked borrows functions into a single
`DiagnosticCx`, which is built in `Stacks::for_each`, and since it
wraps a handle to `AllocHistory`, we can now handle more nuanced
things like heterogeneous borrow of `!Freeze` types.
2022-08-18 15:01:03 -04:00
DrMeepster
d34242e8f1 fix various issues 2022-08-17 19:53:22 -07:00
DrMeepster
9f69c41c5f rewrite handle impl again 2022-08-17 19:53:22 -07:00
DrMeepster
08ffbb8d8a fix windows join/detach and add tests 2022-08-17 19:53:21 -07:00
DrMeepster
b6fc2fc82a basic theading 2022-08-17 19:53:21 -07:00
Ralf Jung
ed41f1c969 remove some leftover //ignore that did not do anything 2022-08-17 22:02:20 -04:00
Ralf Jung
83953f58e7 remove unneeded rustc_private feature 2022-08-17 22:02:20 -04:00
Ralf Jung
7c856f8863 move libc pthread tests into separate file 2022-08-17 22:02:20 -04:00
Ralf Jung
38002b624a organize shim tests into shims folder 2022-08-17 21:50:23 -04:00
bors
31b95dd749 Auto merge of #2485 - 5225225:memalign, r=RalfJung
Breaking posix_memalign precondition is not UB

The `size==0` test here might be overtesting, but I figured might as well test it and leave a comment saying it is fine to remove it if the implementation changes.

Fixes #2099
2022-08-17 02:08:35 +00:00
Ralf Jung
db43ee5714 defend test against overly smart Miri 2022-08-15 20:23:19 -04:00
Ralf Jung
297ddffff3 add test that we do not merge neighboring SRW 2022-08-15 18:32:14 -04:00
Ralf Jung
e70473d944 rustup 2022-08-14 07:51:45 -04:00
Ralf Jung
d59bad95fd fix data_race test 2022-08-13 09:03:30 -04:00
Ralf Jung
7df41a77b8 rustup 2022-08-13 08:23:28 -04:00
5225225
e75b2c8543 Breaking posix_memalign precondition is not UB 2022-08-13 13:20:56 +01:00
Ralf Jung
74e87b1dc5 add test for raw_eq on a pointer 2022-08-12 11:24:55 -04:00
Ralf Jung
38a495346f remove prctl, now that std does not use it any more
it is a terrible variadic function...
2022-08-11 19:06:30 -04:00
Ralf Jung
591274bbd9 rustup 2022-08-10 08:03:00 -04:00
Ralf Jung
43d3963672 more detailed error message 2022-08-09 13:59:34 -04:00
Ralf Jung
cd2edbfd09 ensure atomics happen on mutable allocations, and fix futex test 2022-08-09 13:59:34 -04:00
bors
aa53f3f77f Auto merge of #2472 - RalfJung:backtrace, r=RalfJung
fix RUSTC_BACKTRACE always being set

I kept wondering why Miri programs, whenever isolation is disabled, behave as if RUSTC_BACKTRACE was set. Finally I realized it's because some early rustc setup code sets that env var, and that is then propagated to the interpreted program.

So fix that by taking a copy of the environment before any rustc setup, and use that copy as the basis for what is provided to the interpreted program.
2022-08-06 19:30:50 +00:00
Ralf Jung
141d5a6396 avoid panic/panic folder 2022-08-06 15:30:00 -04:00