about summary refs log tree commit diff
path: root/src/tools/miri/tests/fail
AgeCommit message (Collapse)AuthorLines
2023-10-20Rename lots of files that had `generator` in their nameOli Scherer-0/+0
2023-10-20s/generator/coroutine/Oli Scherer-12/+12
2023-10-20s/Generator/Coroutine/Oli Scherer-11/+11
2023-10-17fmtThe Miri Conjob Bot-2/+2
2023-10-17Merge from rustcThe Miri Conjob Bot-241/+322
2023-10-15more precise error for 'based on misaligned pointer' caseRalf Jung-50/+55
2023-10-15place evaluation: require the original pointer to be aligned if an access ↵Ralf Jung-0/+50
happens
2023-10-15don't UB on dangling ptr deref, instead check inbounds on projectionsRalf Jung-198/+224
2023-10-13Clean up unchecked_math, separate out unchecked_shiftsltdk-2/+2
2023-10-09return_pointer_aliasing2 should also run with SBRalf Jung-2/+45
2023-10-09add test to ensure RET assignments do not get propagated on unwindingRalf Jung-0/+74
2023-10-06Fix problems of Reserved -> FrozenNeven Villani-83/+220
Reserved loses permissions too quickly. Adding more fine-grained behavior of Reserved lets it lose write permissions only temporarily. Protected tags receive a read access on initialized locations.
2023-10-05Tree Borrows: do not create new tags as 'Active'Ralf Jung-4/+28
2023-10-02add test for a function ABI mismatch due to target featuresRalf Jung-0/+50
2023-09-25Auto merge of #3008 - oli-obk:ui_test_progress_bars, r=RalfJungbors-1565/+0
bump ui test crate The recommended way to run tests locally is `./miri bless -- -- --quiet`, which will show * progress bars * the currently running tests (allowing you to see which ones are still running towards the end of the test suite) * the output of the currently running tests (if they are slow). This means slow running tests can output lines to `stderr` and the last line will be shown after the test name and updated every few hundred milliseconds. As a side effect this PR also fixes #2998 and only builds dependencies if any tests actually need them (this means that with the next ui_test update we'll be able to merge all our test suites). Also fixes https://github.com/rust-lang/miri/issues/3052.
2023-09-23Merge from rustcThe Miri Conjob Bot-25/+25
2023-09-22Move `fail` tests that need dependencies into their own folder, so that wasm ↵Oli Scherer-1565/+0
tests don't build dependencies
2023-09-21adjust how closure/generator types and rvalues are printedRalf Jung-25/+25
2023-09-21deprecate -Zmiri-disable-abi-checkRalf Jung-0/+6
2023-09-19Auto merge of #3054 - Vanille-N:spurious-fail, r=RalfJungbors-2/+2
Issue discovered in TB: spurious reads are not (yet) possible in a concurrent setting We discovered a week ago that in general, the current model of TB does not allow spurious reads because although reads provably never invalidate other reads, they migh invalidate writes. Consider the code ```rs fn f1(x: &u8) {} fn f2(y: &mut u8) -> &mut u8 { &mut *y } let mut data = 0; let _ = thread::spawn(|| { f1(&mut data) }; let _ = thread::spawn(|| { let y = f2(&mut data); *y = 42; }); ``` of which one possible interleaving is ```rs 1: retag x (&, protect) // x: [P]Frozen 2: retag y (&mut, protect) // y: [P]Reserved, x: [P]Frozen 1: return f1 // x: [P]Frozen -> Frozen, y: [P]Reserved 2: return f2 // x: Frozen, y: [P]Reserved -> Reserved 2: write y // x: Disabled, y: Active ``` that does not have UB. Assume enough barriers to force this specific interleaving, and consider that the compiler could choose to insert a spurious read throug `x` during the call to `f1` which would produce ```rs 1: retag x (&, protect) // x: [P]Frozen 2: retag y (&mut, protect) // y: [P]Reserved, x: [P]Frozen 1: spurious read x // x: [P]Frozen, y: [P]Reserved -> [P]Frozen 1: return f1 // x: [P]Frozen -> Frozen, y: [P]Frozen 2: return f2 // x: Frozen, y: [P]Frozen -> Frozen 2: write y // UB ``` Thus the target of the optimization (with a spurious read) has UB when the source did not. This is bad. SB is not affected because the code would be UB as early as `retag y`, this happens because we're trying to be a bit more subtle than that, and because the effects of a foreign read on a protected `&mut` bleed outside of the boundaries of the protector. Fortunately we have a fix planned, but in the meantime here are some `#[should_panic]` exhaustive tests to illustrate the issue. The error message printed by the `#[should_panic]` tests flags the present issue in slightly more general terms: it says that the sequence `retag x (&, protect); retag y (&mut, protect);` produces the configuration `C_source := x: [P]Frozen, x: [P]Reserved`, and that inserting a spurious read through `x` turns it into `C_target := x: [P]Frozen, y: [P]Reserved`. It then says that `C_source` is distinguishable from `C_target`, which means that there exists a sequence of instructions applied to both that triggers UB in `C_target` but not in `C_source`. It happens that one such sequence is `1: return f1; 2: return f2; 2: write y;` as shown above, but it is not the only one, as for example the interleaving `1: return f1; 2: write y;` is also problematic.
2023-09-19Issue of the current model: spurious reads are not possibleNeven Villani-2/+2
This occurs because in some interleavings, inserting a spurious read turns a Reserved into Frozen. We show here an exhaustive test (including arbitrary unknown code in two different threads) that makes this issue observable.
2023-09-14don't point at const usage site for resolution-time errorsRalf Jung-4/+4
also share the code that emits the actual error
2023-09-09give extra context to ABI mismatch errorsRalf Jung-0/+12
2023-09-06miri: catch function calls where the argument is caller-invalid / the return ↵Ralf Jung-4/+101
value callee-invalid
2023-08-31Merge from rustcRalf Jung-10/+89
2023-08-31Merge from rustcThe Miri Conjob Bot-2/+2
2023-08-30miri function ABI check: specifically look for repr(transparent)Ralf Jung-0/+31
2023-08-30organize failing ABI compat tests and add some moreRalf Jung-10/+58
2023-08-30storage_live: avoid computing the layout unless necessaryRalf Jung-4/+4
2023-08-30move marking-locals-live out of push_stack_frame, so it happens with ↵Ralf Jung-5/+5
argument passing this entirely avoids even creating unsized locals in Immediate::Uninitialized state
2023-08-29Merge from rustcThe Miri Conjob Bot-2/+1
2023-08-28Rollup merge of #115280 - RalfJung:panic-cleanup-triple-backtrace, r=AmanieuMatthias Krüger-2/+1
avoid triple-backtrace due to panic-during-cleanup Supersedes https://github.com/rust-lang/rust/pull/115020 Cc https://github.com/rust-lang/rust/issues/114954 r? ``@Amanieu``
2023-08-27avoid triple-backtrace due to panic-during-cleanupRalf Jung-2/+1
2023-08-26Merge from rustcThe Miri Conjob Bot-7/+76
2023-08-25Auto merge of #115184 - saethlin:local-allocated-spans, r=RalfJungbors-5/+74
Record allocation spans inside force_allocation This expands https://github.com/rust-lang/miri/pull/2940 to cover locals r? `@RalfJung`
2023-08-25Record allocation spans inside force_allocationBen Kimock-5/+74
2023-08-24when terminating during unwinding, show the reason whyRalf Jung-2/+2
2023-08-22fix some bad regex capture group references in test normalizationRalf Jung-12/+12
2023-08-20interpret: have assert_* intrinsics call the panic machinery instead of a ↵Ralf Jung-13/+50
direct abort
2023-08-20interpret/miri: call panic_cannot_unwind lang item instead of hard-coding ↵Ralf Jung-39/+119
the same message
2023-08-19custom_mir: change Call() terminator syntax to something more readableRalf Jung-34/+34
2023-08-16on out-of-bounds error, show where the allocation was createdRalf Jung-7/+45
2023-08-16Auto merge of #2940 - saethlin:use-after-free-spans, r=RalfJungbors-14/+169
When reporting a heap use-after-free, say where the allocation was allocated and deallocated This is a partial solution to: https://github.com/rust-lang/miri/issues/2917 Currently in the interpreter, we only have accurate information for where heap allocations are allocated and deallocated (see https://github.com/rust-lang/miri/pull/2940#discussion_r1243559711). So this just implements support for allocations where the information is already available, and the full support will require more interpreter tweaks.
2023-08-15C string function shims: consistently treat "invalid" pointers as UBRalf Jung-6/+34
2023-08-11Include spans in use-after-free diagnosticsBen Kimock-14/+169
2023-08-11Remove `float_to_int_unchecked` and inline it into its call sitesEduardo Sánchez Muñoz-2/+2
2023-08-11Add checked float-to-int helper functionEduardo Sánchez Muñoz-2/+2
2023-08-07Auto merge of #114560 - RalfJung:miri, r=RalfJungbors-115/+253
update Miri
2023-08-06Add a new `compare_bytes` intrinsic instead of calling `memcmp` directlyScott McMurray-4/+4
2023-08-05tree borrows: consider some retags as writes for the purpose of data racesRalf Jung-113/+138