about summary refs log tree commit diff
path: root/src/tools/miri/tests
AgeCommit message (Collapse)AuthorLines
2024-11-20miri: implement square root without relying on host floatsEduardo Sánchez Muñoz-2/+12
2024-11-18Merge from rustcThe Miri Cronjob Bot-1/+1
2024-11-17Likely unlikely fixJiri Bobek-1/+1
2024-11-15Merge pull request #4033 from tiif/checkepollOli Scherer-0/+137
Add test for epoll
2024-11-14Add test for epolltiif-0/+137
2024-11-13Merge pull request #3939 from tiif/blockeventfdOli Scherer-61/+336
Implement blocking eventfd
2024-11-13Implement blocking eventfdtiif-61/+336
2024-11-11stacked borrows tests: add those that fail under TBRalf Jung-2/+38
2024-11-10fix linux-futex test being accidentally disabledRalf Jung-3/+2
2024-11-10store futexes in per-allocation data rather than globallyRalf Jung-2/+5
2024-11-09Merge pull request #4020 from RalfJung/thread-sopeRalf Jung-0/+24
pthread-sync test: use thread::scope for more reliable thread scoping
2024-11-09pthread-sync: avoid confusing error when running with preemptionRalf Jung-0/+24
2024-11-09Merge from rustcThe Miri Cronjob Bot-1/+25
2024-11-08Get/set thread name shims return errors for invalid handlesYoh Deadfall-0/+25
2024-11-08remove support for rustc_safe_intrinsic attribute; use rustc_intrinsic ↵Ralf Jung-1/+1
functions instead
2024-11-04miri: update ABI compat checks to accept Option-like typesRalf Jung-0/+24
2024-11-02teach clippy about IeeeFloat, and make all 'allow' into 'expect'Ralf Jung-1/+1
2024-10-30Merge from rustcThe Miri Cronjob Bot-1/+1
2024-10-29Rollup merge of #132233 - WaffleLapkin:box-module-split, r=workingjubileeJubilee-1/+1
Split `boxed.rs` into a few modules I wanted to add an impl for `Box<_>`, but was quickly discouraged by the 3K file. This splits off a couple bits, making it at least a bit more manageable. r? ````@workingjubilee```` (I think you are not bothered by refactorings like this?)
2024-10-28Bless a miri testMaybe Lapkin-1/+1
After moving some `Box` internals to a different module, the path in the diagnostic changed.
2024-10-28Merge pull request #3992 from YohDeadfall/android-syscallRalf Jung-20/+22
Android: Added syscall support
2024-10-28Android: Added syscall supportYoh Deadfall-20/+22
2024-10-26Adjust the vpclmulqdq test caseTobias Decking-3/+7
2024-10-26Implement LLVM x86 vpclmulqdq intrinsicsTobias Decking-0/+189
2024-10-22fmtThe Miri Cronjob Bot-1/+0
2024-10-22Merge from rustcThe Miri Cronjob Bot-36/+4
2024-10-21Auto merge of #3899 - YohDeadfall:prctl-thread-name, r=RalfJungbors-0/+106
Android: Added support for prctl handling thread names Addresses the first part of #3618.
2024-10-21move strict provenance lints to new feature gate, remove old feature gatesRalf Jung-36/+4
2024-10-21Added support for prctl handling thread namesYoh Deadfall-0/+106
2024-10-20fmtThe Miri Cronjob Bot-1/+2
2024-10-20Merge from rustcThe Miri Cronjob Bot-0/+55
2024-10-18tail_calls: add test ensuring local vars are indeed goneRalf Jung-0/+46
2024-10-18pthread-threadname: ensure we can see the name set via the Rust APIRalf Jung-0/+17
2024-10-18Add more testsJules Bertholet-0/+55
2024-10-17miri: improve support for `f16` and `f128`Eduardo Sánchez Muñoz-9/+151
Rounding intrinsics are now implemented for `f16` and `f128` and tests for `is_infinite`, NaN, `abs`, `copysign`, `min`, `max`, rounding, `*_fast` and `*_algebraic` have been added.
2024-10-17data-race test: disable address reuse that can incur accidental syncRalf Jung-1/+1
2024-10-15Rollup merge of #131521 - jdonszelmann:rc, r=joboetMichael Goulet-2/+2
rename RcBox to RcInner for consistency Arc uses ArcInner too (created in collaboration with `@aDotInTheVoid` and `@WaffleLapkin` )
2024-10-14Auto merge of #3973 - RalfJung:os-unfair-lock, r=RalfJungbors-2/+60
ensure that a macOS os_unfair_lock that is moved while being held is not implicitly unlocked Fixes https://github.com/rust-lang/miri/issues/3859 We mark an os_unfair_lock that is moved while being held as "poisoned", which means it is not considered forever locked. That's not quite what the real implementation does, but allowing arbitrary moves-while-locked would likely expose a ton of implementation details, so hopefully this is good enough.
2024-10-14ensure that a macOS os_unfair_lock that is moved while being held is not ↵Ralf Jung-2/+28
implicitly unlocked
2024-10-14Auto merge of #3968 - YohDeadfall:variadic-arg-helper, r=RalfJungbors-4/+4
Added a variadic argument helper `@RalfJung,` as you wished (:
2024-10-14add test ensuring a moved mutex deadlocksRalf Jung-0/+32
2024-10-14Added a variadic argument helperYoh Deadfall-4/+4
2024-10-14pthread_cond: also store ID outside addressable memoryRalf Jung-6/+6
2024-10-14pthread_rwlock: also store ID outside addressable memoryRalf Jung-3/+3
2024-10-14pthread_mutex: store mutex ID outside adressable memory, so it can be trustedRalf Jung-6/+6
2024-10-14Merge from rustcRalf Jung-2/+111
2024-10-13Auto merge of #3957 - YohDeadfall:macos-thread-name, r=RalfJungbors-39/+122
Fixed get/set thread name implementations for macOS and FreeBSD So, the story of fixing `pthread_getname_np` and `pthread_setname_np` continues, but this time I fixed the macOS implementation. ### [`pthread_getname_np`](https://github.com/apple-oss-distributions/libpthread/blob/c032e0b076700a0a47db75528a282b8d3a06531a/src/pthread.c#L1160-L1175) The function never fails except for an invalid thread. Miri never verifies thread identifiers and uses them as indices when accessing a vector of threads. Therefore, the only possible result is `0` and a possibly trimmed output. ```c int pthread_getname_np(pthread_t thread, char *threadname, size_t len) { if (thread == pthread_self()) { strlcpy(threadname, thread->pthread_name, len); return 0; } if (!_pthread_validate_thread_and_list_lock(thread)) { return ESRCH; } strlcpy(threadname, thread->pthread_name, len); _pthread_lock_unlock(&_pthread_list_lock); return 0; } ``` #### [`strcpy`](https://www.man7.org/linux/man-pages/man7/strlcpy.7.html) ``` strlcpy(3bsd) strlcat(3bsd) Copy and catenate the input string into a destination string. If the destination buffer, limited by its size, isn't large enough to hold the copy, the resulting string is truncated (but it is guaranteed to be null-terminated). They return the length of the total string they tried to create. ``` ### [`pthread_setname_np`](https://github.com/apple-oss-distributions/libpthread/blob/c032e0b076700a0a47db75528a282b8d3a06531a/src/pthread.c#L1178-L1200) ```c pthread_setname_np(const char *name) { int res; pthread_t self = pthread_self(); size_t len = 0; if (name != NULL) { len = strlen(name); } _pthread_validate_signature(self); res = __proc_info(5, getpid(), 2, (uint64_t)0, (void*)name, (int)len); if (res == 0) { if (len > 0) { strlcpy(self->pthread_name, name, MAXTHREADNAMESIZE); } else { bzero(self->pthread_name, MAXTHREADNAMESIZE); } } return res; } ``` Where `5` is [`PROC_INFO_CALL_SETCONTROL`](https://github.com/apple-oss-distributions/xnu/blob/8d741a5de7ff4191bf97d57b9f54c2f6d4a15585/bsd/sys/proc_info_private.h#L274), and `2` is [`PROC_INFO_CALL_SETCONTROL`](https://github.com/apple-oss-distributions/xnu/blob/8d741a5de7ff4191bf97d57b9f54c2f6d4a15585/bsd/sys/proc_info.h#L821). And `__proc_info` is a syscall handled by the XNU kernel by [`proc_info_internal`](https://github.com/apple-oss-distributions/xnu/blob/8d741a5de7ff4191bf97d57b9f54c2f6d4a15585/bsd/kern/proc_info.c#L300-L314): ```c int proc_info_internal(int callnum, int pid, uint32_t flags, uint64_t ext_id, int flavor, uint64_t arg, user_addr_t buffer, uint32_t buffersize, int32_t * retval) { switch (callnum) { // ... case PROC_INFO_CALL_SETCONTROL: return proc_setcontrol(pid, flavor, arg, buffer, buffersize, retval); ``` And the actual logic from [`proc_setcontrol`](https://github.com/apple-oss-distributions/xnu/blob/8d741a5de7ff4191bf97d57b9f54c2f6d4a15585/bsd/kern/proc_info.c#L3218-L3227): ```c case PROC_SELFSET_THREADNAME: { /* * This is a bit ugly, as it copies the name into the kernel, and then * invokes bsd_setthreadname again to copy it into the uthread name * buffer. Hopefully this isn't such a hot codepath that an additional * MAXTHREADNAMESIZE copy is a big issue. */ if (buffersize > (MAXTHREADNAMESIZE - 1)) { return ENAMETOOLONG; } ``` Unrelated to the current pull request, but perhaps, there's a very ugly thing in the kernel/libc because the last thing happening in `PROC_SELFSET_THREADNAME` is `bsd_setthreadname` which sets the name in the user space. But we just saw that `pthread_setname_np` sets the name in the user space too. Guess, I need to open a ticket in one of Apple's repositories at least to clarify that :D
2024-10-13rework threadname test for more consistencyRalf Jung-62/+122
2024-10-12Fixed get thread name behavior for FreeBSDYoh Deadfall-6/+5
2024-10-12Fixed pthread get/set name for macOSYoh Deadfall-2/+26