about summary refs log tree commit diff
path: root/src/tools/miri/tests/fail
AgeCommit message (Collapse)AuthorLines
2024-09-15Rollup merge of #129828 - RalfJung:miri-data-race, r=saethlinMatthias Krüger-0/+192
miri: treat non-memory local variables properly for data race detection Fixes https://github.com/rust-lang/miri/issues/3242 Miri has an optimization where some local variables are not represented in memory until something forces them to be stored in memory (most notably, creating a pointer/reference to the local will do that). However, for a subsystem triggering on memory accesses -- such as the data race detector -- this means that the memory access seems to happen only when the local is moved to memory, instead of at the time that it actually happens. This can lead to UB reports in programs that do not actually have UB. This PR fixes that by adding machine hooks for reads and writes to such efficiently represented local variables. The data race system tracks those very similar to how it would track reads and writes to addressable memory, and when a local is moved to memory, the clocks get overwritten with the information stored for the local.
2024-09-14Merge from rustcThe Miri Cronjob Bot-156/+65
2024-09-13Rollup merge of #130245 - RalfJung:miri-alloc-backtrace, r=AmanieuStuart Cook-156/+65
make basic allocation functions track_caller in Miri for nicer backtraces This matches what we did with basic pointer and atomic operations.
2024-09-12Merge from rustcThe Miri Cronjob Bot-0/+22
2024-09-11make basic allocation functions track_caller in Miri for nicer backtracesRalf Jung-156/+65
2024-09-11miri: fix overflow detection for unsigned pointer offsetRalf Jung-0/+22
2024-09-11Merge from rustcThe Miri Cronjob Bot-21/+21
2024-09-10Auto merge of #129403 - scottmcm:only-array-simd, r=compiler-errorsbors-21/+21
Ban non-array SIMD Nearing the end of https://github.com/rust-lang/compiler-team/issues/621 ! Currently blocked on ~~https://github.com/rust-lang/compiler-builtins/pull/673~~ ~~https://github.com/rust-lang/compiler-builtins/pull/674~~ ~~https://github.com/rust-lang/rust/pull/129400~~ ~~https://github.com/rust-lang/rust/pull/129481~~ for windows.
2024-09-10miri: treat non-memory local variables properly for data race detectionRalf Jung-0/+192
2024-09-10fmtRalf Jung-46/+58
2024-09-09Update the MIRI testsScott McMurray-21/+21
2024-09-09fix UB in a testRalf Jung-2/+35
also add an explicit test for the fact that a Option<WidePtr> has padding when it is None
2024-09-08interpret: reset padding during validationRalf Jung-15/+198
2024-09-08interpret: reset provenance on typed copiesRalf Jung-0/+185
2024-09-01Rollup merge of #128495 - joboet:more_memcmp, r=scottmcmMatthias Krüger-4/+4
core: use `compare_bytes` for more slice element types `bool`, `NonZero<u8>`, `Option<NonZero<u8>>` and `ascii::Char` can be compared the same way as `u8`.
2024-08-30Merge from rustcThe Miri Cronjob Bot-3/+0
2024-08-29fix wasm testRalf Jung-1/+27
2024-08-28Merge from rustcThe Miri Cronjob Bot-3/+63
2024-08-27miri: Remove feature(new_uninit)Jubilee Young-3/+0
2024-08-27Auto merge of #128134 - joboet:move_pal_alloc, r=cupiverbors-3/+5
std: move allocators to `sys` Part of #117276.
2024-08-27Make TB tree traversal bottom-upJohannes Hostert-152/+56
In preparation for #3837, the tree traversal needs to be made bottom-up, because the current top-down tree traversal, coupled with that PR's changes to the garbage collector, can introduce non-deterministic error messages if the GC removes a parent tag of the accessed tag that would have triggered the error first. This is a breaking change for the diagnostics emitted by TB. The implemented semantics stay the same.
2024-08-27Add testcase for #3846Johannes Hostert-0/+54
2024-08-27bless miri testjoboet-3/+5
2024-08-27Rollup merge of #128942 - RalfJung:interpret-weak-memory, r=saethlinTrevor Gross-0/+58
miri weak memory emulation: put previous value into initial store buffer Fixes https://github.com/rust-lang/miri/issues/2164 by doing a read before each atomic write so that we can initialize the store buffer. The read suppresses memory access hooks and UB exceptions, to avoid otherwise influencing the program behavior. If the read fails, we store that as `None` in the store buffer, so that when an atomic read races with the first atomic write to some memory and previously the memory was uninitialized, we can report UB due to reading uninit memory. ``@cbeuw`` this changes a bit the way we initialize the store buffers. Not sure if you still remember all this code, but if you could have a look to make sure this still makes sense, that would be great. :) r? ``@saethlin``
2024-08-24Rollup merge of #129501 - RalfJung:miri-rust-backtrace, r=NoratriebMatthias Krüger-15/+15
panicking: improve hint for Miri's RUST_BACKTRACE behavior Should help with https://github.com/rust-lang/miri/issues/3838
2024-08-24panicking: improve hint for Miri's RUST_BACKTRACE behaviorRalf Jung-15/+15
2024-08-21add a test for zero-sized protectorsRalf Jung-4/+72
2024-08-18stabilize raw_ref_opRalf Jung-5/+0
2024-08-16Auto merge of #3754 - Vanille-N:master, r=RalfJungbors-10/+10
Make unused states of Reserved unrepresentable In the [previous TB update](https://github.com/rust-lang/miri/pull/3742) we discovered that the existence of `Reserved + !ty_is_freeze + protected` is undesirable. This has the side effect of making `Reserved { conflicted: true, ty_is_freeze: false }` unreachable. As such it is desirable that this state would also be unrepresentable. This PR eliminates the unused configuration by changing ```rs enum PermissionPriv { Reserved { ty_is_freeze: bool, conflicted: bool }, ... } ``` into ```rs enum PermissionPriv { ReservedFrz { conflicted: bool }, ReservedIM, ... } ``` but this is not the only solution and `Reserved(Activable | Conflicted | InteriorMut)` could be discussed. In addition to making the unreachable state not representable anymore, this change has the nice side effect of enabling `foreign_read` to no longer depend explicitly on the `protected` flag. Currently waiting for - `@JoJoDeveloping` to confirm that this is the same representation of `Reserved` as what is being implemented in simuliris, - `@RalfJung` to approve that this does not introduce too much overhead in the trusted codebase.
2024-08-13remove the concept of a Call IDRalf Jung-34/+34
2024-08-12miri weak memory emulation: initialize store buffer only on atomic writes; ↵Ralf Jung-0/+58
pre-fill with previous value
2024-08-09throw_unsup_format for alignment greater than 2^29 and refactor ↵tiif-0/+54
non-power-of-two alignment check
2024-08-07Auto merge of #3747 - RalfJung:sse-cleanup, r=RalfJungbors-3/+3
remove some SSE/SSE2 intrinsics that are no longer used by stdarch Fixes https://github.com/rust-lang/miri/issues/3691
2024-08-07remove some SSE/SSE2 intrinsics that are no longer used by stdarchRalf Jung-3/+3
2024-08-07Merge from rustcThe Miri Cronjob Bot-3/+3
2024-08-06interpret: refactor function call handling to be better-abstractedRalf Jung-3/+3
2024-08-06add return-place-protection tail-call test, and fix previous testRalf Jung-39/+157
2024-08-05Merge from rustcRalf Jung-0/+23
2024-08-03Miri: add a flag to do recursive validity checkingRalf Jung-0/+23
2024-08-03Merge from rustcThe Miri Cronjob Bot-25/+0
2024-08-02Auto merge of #3769 - primoly:miri-start, r=RalfJungbors-2/+45
Add `miri_start` support This PR uses a function with the exported symbol `miri_start` as a drop-in alternative to `#[start]`. So the signature stays the same as suggested in [this comment](https://github.com/rust-lang/miri/issues/3498#issuecomment-2088560526). <del>I’ve also removed Miri’s restriction to only work on bin crates as I don’t think this is necessary anymore.</del> Closes #3758
2024-08-02Add `miri_start` supportprimoly-2/+45
2024-08-02Rollup merge of #128453 - RalfJung:raw_eq, r=saethlinMatthias Krüger-25/+0
raw_eq: using it on bytes with provenance is not UB (outside const-eval) The current behavior of raw_eq violates provenance monotonicity. See https://github.com/rust-lang/rust/pull/124921 for an explanation of provenance monotonicity. It is violated in raw_eq because comparing bytes without provenance is well-defined, but adding provenance makes the operation UB. So remove the no-provenance requirement from raw_eq. However, the requirement stays in-place for compile-time invocations of raw_eq, that indeed cannot deal with provenance. Cc `@rust-lang/opsem`
2024-08-01bless miri testsjoboet-4/+4
2024-08-01interpret: simplify pointer arithmetic logicRalf Jung-36/+22
2024-08-01on a signed deref check, mention the right pointer in the errorRalf Jung-13/+13
2024-07-31raw_eq: using it on bytes with provenance is not UB (outside const-eval)Ralf Jung-25/+0
2024-07-29Rollup merge of #128333 - RalfJung:miri-sync, r=RalfJungMatthias Krüger-9/+207
Miri subtree update r? `@ghost`
2024-07-27improve dangling/oob errors and make them more uniformRalf Jung-69/+71
2024-07-27miri: fix offset_from behavior on wildcard pointersRalf Jung-6/+7