about summary refs log tree commit diff
path: root/src/tools/miri
AgeCommit message (Collapse)AuthorLines
2024-08-22Auto merge of #3833 - JoJoDeveloping:tb-fix-stack-overflow, r=RalfJungbors-47/+74
Make Tree Borrows Provenance GC no longer produce stack overflows Most functions operating on Tree Borrows' trees are carefully written to not cause stack overflows due to too much recursion. The one exception is [`Tree::keep_only_needed`](https://github.com/rust-lang/miri/blob/94f5588fafcc7d59fce60ca8f7af0208e6f618d4/src/borrow_tracker/tree_borrows/tree.rs#L724), which just uses regular recursion. This function is part of the provenance GC, so it is called regularly for every allocation in the program. Tests show that this is a problem in practice. For example, the test `fill::horizontal_line` in crate `tiny-skia` (version 0.11.4) is such a test. This PR changes this, this test no now longer crashes. Instead, it succeeds (after a _long_ time).
2024-08-22Make Tree Borrows Provenance GC no longer produce stack overflowsJohannes Hostert-47/+74
2024-08-21epoll test: avoid some subtly dangling pointersRalf Jung-24/+4
2024-08-21add a test for zero-sized protectorsRalf Jung-4/+72
2024-08-20supress niches in coroutinesRalf Jung-0/+66
2024-08-20Auto merge of #3752 - Kixunil:simd-sha256, r=RalfJungbors-0/+497
Implement SHA256 SIMD intrinsics on x86 Disclaimer: this is my first contribution to `miri`'s code. It's quite possible I'm missing something. This code works but may not be the cleanest/best possible. It'd be useful to be able to verify code implementing SHA256 using SIMD since such code is a bit more complicated and at some points requires use of pointers. Until now `miri` didn't support x86 SHA256 intrinsics. This commit implements them.
2024-08-20Implement SHA256 SIMD intrinsics on x86Martin Habovstiak-0/+497
It'd be useful to be able to verify code implementing SHA256 using SIMD since such code is a bit more complicated and at some points requires use of pointers. Until now `miri` didn't support x86 SHA256 intrinsics. This commit implements them.
2024-08-20readdir_r shim: assume FreeBSD v12+Ralf Jung-10/+10
needs a libc version bump
2024-08-20Merge from rustcThe Miri Cronjob Bot-6/+7
2024-08-20Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-08-19make the cleanup functions privateRalf Jung-25/+25
also move "is there a borrow tracker" check out of the loop
2024-08-19provenance_gc: fix commentRalf Jung-1/+3
2024-08-18stabilize raw_ref_opRalf Jung-6/+0
2024-08-18fix build with bootstrap compilerRalf Jung-0/+7
2024-08-18Add EPOLLER supporttiif-6/+83
2024-08-18Auto merge of #3818 - tiif:loseevents, r=RalfJungbors-17/+94
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-17/+94
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-18make sure we read all arguments before returning earlyRalf Jung-3/+5
2024-08-18Move the maxevents.try_into().unwrap() after value checktiif-8/+9
2024-08-18Set EINVAL for epoll_wait maxevent value 0tiif-1/+17
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-17Auto merge of #3823 - RalfJung:sync, r=RalfJungbors-102/+27
simplify synchronization object creation logic
2024-08-17simplify synchronization object creation logicRalf Jung-102/+27
2024-08-17run TLS tests on SolarishRalf Jung-2/+2
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-17Auto merge of #3815 - RalfJung:pipe, r=RalfJungbors-66/+253
implement pipe and pipe2 Fixes https://github.com/rust-lang/miri/issues/3746
2024-08-17epoll test: further clean up check_epoll_waitRalf Jung-41/+37
2024-08-17Auto merge of #3817 - rust-lang:rustup-2024-08-17, r=RalfJungbors-2/+1
Automatic Rustup
2024-08-17SocketPair -> AnonSocket, because a single FD is not a pairRalf Jung-15/+15
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-31/+223
2024-08-17Auto merge of #3814 - tiif:epollhup, r=RalfJungbors-7/+30
Add epoll EPOLLHUP flag support Related discussion in https://github.com/rust-lang/miri/issues/3811#issuecomment-2293854742. This PR added support for ``EPOLLHUP`` flag.
2024-08-17extend comments on HUP vs RDHUPRalf Jung-1/+5
2024-08-17Auto merge of #3807 - RalfJung:projects, r=oli-obkbors-1/+34
add 'project' process guidlines for larger contributions Fixes https://github.com/rust-lang/miri/issues/3443 I am honestly not entirely sure what the consensus from what issue was. I feel like the epoll PR worked reasonably well, and not having been closely involved I am not sure which process `@oli-obk` followed there. Compared to the first draft in #3443 I tried to make this less formal and framed more as guidelines than hard rules.
2024-08-17Merge from rustcThe Miri Cronjob Bot-1/+0
2024-08-17Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-08-17Move epoll_ready_events.epollhup = true uptiif-1/+1
2024-08-17Add epoll EPOLLHUP flag supporttiif-6/+25
2024-08-16Auto merge of #3809 - RalfJung:fd-refcell, r=oli-obkbors-399/+294
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-134/+200
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-11/+12
2024-08-16more epoll test cleanupRalf Jung-29/+25
2024-08-16comment and test regarding notifications on writes that dont change readinessRalf Jung-1/+17
2024-08-16epoll test cleanupRalf Jung-118/+58
2024-08-16make ecx.check_and_update_readiness a truly private helper functionRalf Jung-63/+31
2024-08-16buf_has_writer is not needed any moreRalf Jung-11/+3