about summary refs log tree commit diff
path: root/src/tools/miri/tests
AgeCommit message (Collapse)AuthorLines
2024-08-18Auto merge of #3818 - tiif:loseevents, r=RalfJungbors-0/+64
epoll: iterate through output buffer then fetch an event from ready list Fixes #3812
2024-08-18epoll: iterate through output buffer then fetch an event from ready listtiif-0/+64
2024-08-18Auto merge of #3825 - RalfJung:epoll-miri, r=RalfJungbors-3/+9
epoll test_socketpair_read: explicitly check real and Miri behavior
2024-08-18epoll test_socketpair_read: explicitly check real and Miri behaviorRalf Jung-3/+9
2024-08-18Move the maxevents.try_into().unwrap() after value checktiif-3/+2
2024-08-18Set EINVAL for epoll_wait maxevent value 0tiif-0/+15
2024-08-18Apply test fixtiif-38/+65
- Fix epoll_ctl_del test - Simplified epoll_ctl_mod test and add test_no_notification_for_unregister_flag - Use assert_eq(0) for epoll_ctl
2024-08-17tls_leak_main_thread_allowed: make test check target_thread_localRalf Jung-10/+13
2024-08-17Auto merge of #3819 - RalfJung:epoll-test, r=RalfJungbors-41/+37
epoll test: further clean up check_epoll_wait Given that `check_epoll_wait` compared the length of the two slices, I don't think it was possible for it to ever return `false`. It's also strange to have some requirements checked inside the function and some checked by the caller, so let's just move it all inside the function. Cc `@tiif` -- did I miss anything?
2024-08-17epoll test: further clean up check_epoll_waitRalf Jung-41/+37
2024-08-17test cleanupRalf Jung-55/+30
2024-08-17socketpair: test behavior when one end got closedRalf Jung-0/+20
2024-08-17implement pipe and pipe2Ralf Jung-6/+120
2024-08-17Add epoll EPOLLHUP flag supporttiif-2/+4
2024-08-16Auto merge of #3809 - RalfJung:fd-refcell, r=oli-obkbors-145/+98
FD: remove big surrounding RefCell, simplify socketpair A while ago, I added the big implicit RefCell for all file descriptions since it avoided interior mutability in `eventfd`. However, this requires us to hold the RefCell "lock" around the entire invocation of the `read`/`write` methods on an FD, which is not great. For instance, if an FD wants to update epoll notifications from inside its `read`/`write`, it is very crucial that the notification check does not end up accessing the FD itself. Such cycles, however, occur naturally: - eventfd wants to update notifications for itself - socketfd wants to update notifications on its "peer", which will in turn check *its* peer to see whether that buffer is empty -- and my peer's peer is myself. This then also lets us simplify socketpair, which currently holds a weak reference to its peer *and* a weak reference to the peer's buffer -- that was previously needed precisely to avoid this issue.
2024-08-16Auto merge of #3754 - Vanille-N:master, r=RalfJungbors-46/+46
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-16explain the behavior on closed peersRalf Jung-0/+1
2024-08-16more epoll test cleanupRalf Jung-29/+25
2024-08-16comment and test regarding notifications on writes that dont change readinessRalf Jung-0/+12
2024-08-16epoll test cleanupRalf Jung-118/+58
2024-08-16FD: remove big surrounding RefCell, simplify socketpairRalf Jung-0/+4
2024-08-14Auto merge of #3712 - tiif:feat/epoll, r=oli-obkbors-3/+555
Implement epoll shim This PR: - implemented non-blocking ``epoll`` for #3448 . The design for this PR is documented in https://hackmd.io/`@tiif/SJatftrH0` . - renamed FileDescriptor to FileDescriptionRef - assigned an ID to every file description
2024-08-14Implement epoll shimtiif-3/+555
2024-08-14Merge from rustcRalf Jung-2/+14
2024-08-13Auto merge of #3802 - RalfJung:no-more-call-id, r=RalfJungbors-34/+34
Borrow tracking: remove the concept of a call ID Turns out this is not needed any more ever since we started tracking the `protected_tags` list in the per-frame state. Also thanks to `@JoJoDeveloping` for inspiring me to even consider this possibility. :)
2024-08-13remove the concept of a Call IDRalf Jung-34/+34
2024-08-13Auto merge of #128742 - RalfJung:miri-vtable-uniqueness, r=saethlinbors-2/+14
miri: make vtable addresses not globally unique Miri currently gives vtables a unique global address. That's not actually matching reality though. So this PR enables Miri to generate different addresses for the same type-trait pair. To avoid generating an unbounded number of `AllocId` (and consuming unbounded amounts of memory), we use the "salt" technique that we also already use for giving constants non-unique addresses: the cache is keyed on a "salt" value n top of the actually relevant key, and Miri picks a random salt (currently in the range `0..16`) each time it needs to choose an `AllocId` for one of these globals -- that means we'll get up to 16 different addresses for each vtable. The salt scheme is integrated into the global allocation deduplication logic in `tcx`, and also used for functions and string literals. (So this also fixes the problem that casting the same function to a fn ptr over and over will consume unbounded memory.) r? `@saethlin` Fixes https://github.com/rust-lang/miri/issues/3737
2024-08-12Auto merge of #3798 - RalfJung:miri-script-remap-path-prefix, r=saethlinbors-5/+7
miri-script: use --remap-path-prefix to print errors relative to the right root Inspired by https://github.com/rust-lang/rust-clippy/pull/13232, this makes it so that when cargo-miri fails to build, `./miri check` will print errors with paths like `cargo-miri/src/setup.rs`. That means we can get rid of the miri-symlink-hacks and instead tell RA to just always invoke the `./miri clippy` script just once, in the root. This means that we can no longer share a target dir between cargo-miri and miri as the RUSTFLAGS are different to crates that are shared in the dependency tree need to be built twice with two different flags. `miri-script` hence now has to set the MIRI environment variable to tell the `cargo miri setup` invocation where to find Miri. I also made it so that errors in miri-script itself are properly shown in RA, for which the `./miri` shell wrapper needs to set the right flags.
2024-08-12miri weak memory emulation: initialize store buffer only on atomic writes; ↵Ralf Jung-11/+66
pre-fill with previous value
2024-08-12fix tree borrows Unique testRalf Jung-11/+7
2024-08-12Merge from rustcRalf Jung-3/+9
2024-08-12Auto merge of #126793 - saethlin:mono-rawvec, r=scottmcmbors-3/+7
Apply "polymorphization at home" to RawVec The idea here is to move all the logic in RawVec into functions with explicit size and alignment parameters. This should eliminate all the fussing about how tweaking RawVec code produces large swings in compile times. This uncovered https://github.com/rust-lang/rust-clippy/issues/12979, so I've modified the relevant test in a way that tries to preserve the spirit of the test without tripping the ICE.
2024-08-10miri-script: use --remap-path-prefix to print errors relative to the right rootRalf Jung-5/+7
2024-08-10Fixes in various placesNadrieril-0/+2
2024-08-09Add a FIXME to the changed Miri testBen Kimock-0/+2
2024-08-09Bless MiriBen Kimock-3/+5
2024-08-09throw_unsup_format for alignment greater than 2^29 and refactor ↵tiif-0/+54
non-power-of-two alignment check
2024-08-07allow all code to call getuid()Ralf Jung-1/+5
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-21/+15
2024-08-06miri: make vtable addresses not globally uniqueRalf Jung-2/+14
2024-08-06interpret: refactor function call handling to be better-abstractedRalf Jung-21/+15
2024-08-06add return-place-protection tail-call test, and fix previous testRalf Jung-39/+157
2024-08-05Auto merge of #3789 - RalfJung:deps, r=RalfJungbors-1/+1
bump dependencies In particular pick up https://github.com/RalfJung/rustc-build-sysroot/pull/22 to fix the fallout from https://github.com/rust-lang/rust/pull/128534.
2024-08-05bump dependenciesRalf Jung-1/+1
2024-08-05use a Miri-specific folder for ui testsRalf Jung-1/+1
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