about summary refs log tree commit diff
path: root/src/tools/miri/tests/pass-dep/libc
AgeCommit message (Collapse)AuthorLines
2025-07-21Merge pull request #4481 from RalfJung/read-write-truncateOli Scherer-76/+147
non-deterministically truncate reads/writes
2025-07-19non-deterministically truncate reads/writesRalf Jung-76/+147
2025-07-17miri sleep tests: increase slackRalf Jung-3/+3
2025-07-06sleep_until: add clock_nanosleep support to Miridvdsk-0/+114
The clock_nanosleep support is there to allow code using `sleep_until` to run under Miri. Therefore the implementation is minimal. - Only the clocks REALTIME and MONOTONIC are supported. The first is supported simply because it was trivial to add not because it was needed for sleep_until. - The only supported flag combinations are no flags or TIMER_ABSTIME only. If an unsupported flag combination or clock is passed in this throws unsupported.
2025-06-07test_dup: ensure the FDs remain in sync even after dup'ingRalf Jung-2/+3
2025-05-27Support F_GETFL and F_SETFL for fcntltiif-0/+100
2025-05-18Merge pull request #4322 from tiif/move_testRalf Jung-0/+4
Add more comments to libc-fs-with-isolation test
2025-05-18Add more comment to libc-fs-with-isolation testtiif-0/+4
2025-04-29add -Zmiri-deterministic-concurrency flag and use it for concurrency testsRalf Jung-5/+5
2025-04-29Added random schedulinggeetanshjuneja-5/+5
2025-04-04Solaris does not have flockRalf Jung-0/+1
2025-02-26Resolve more FIXMEstiif-6/+2
2025-02-21Resolve some FIXME from socketpair testtiif-6/+2
2025-02-06allow code to call geteuid()Slava Barinov-0/+5
2025-02-01fmtThe Miri Cronjob Bot-12/+12
2025-01-13Illumos: Added epoll and eventfdYoh Deadfall-3/+8
2025-01-12turns out Solarish targets support our entire test suiteRalf Jung-2/+1
2025-01-11Supported fioclex for ioctl on macosgeetanshjuneja-0/+20
2025-01-10Switched FreeBSD to pthread_setname_npYoh Deadfall-30/+24
2024-12-18Merge pull request #4072 from tiif/blockopOli Scherer-0/+50
Implement blocking unnamed_socket
2024-12-19Implement blocking unnamed_sockettiif-0/+50
2024-12-12Improve timezone handling in 'localtime_r()' using 'allocate_bytes()'shamb0-16/+219
Signed-off-by: shamb0 <r.raajey@gmail.com>
2024-12-04fmtThe Miri Cronjob Bot-1/+5
2024-12-04Merge from rustcThe Miri Cronjob Bot-10/+7
2024-12-02Use c"lit" for CStrings without unwrapKornel-10/+7
2024-11-26Merge pull request #4059 from tiif/fixtestOli Scherer-7/+0
Simplify thread blocking tests
2024-11-26Simplify thread blocking teststiif-7/+0
2024-11-25Fix the rest of the testsYoh Deadfall-6/+3
2024-11-25Added epoll and eventfd for AndroidYoh Deadfall-0/+3
2024-11-24sysconf: add _SC_OPEN_MAXDavid Carlier-0/+2
2024-11-24follow-up on #4052, making a miri evaluation context fn for strerror_r.David Carlier-0/+16
2024-11-23sysconf interception fix for solarish systems.David Carlier-0/+17
also adding the `_SC_PAGESIZE` alias `_SC_PAGE_SIZE` supported by Linux, macOS and FreeBSD. close #4050
2024-11-13Merge pull request #3939 from tiif/blockeventfdOli Scherer-1/+118
Implement blocking eventfd
2024-11-13Implement blocking eventfdtiif-1/+118
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-08Get/set thread name shims return errors for invalid handlesYoh Deadfall-0/+25
2024-10-28Android: Added syscall supportYoh Deadfall-20/+21
2024-10-22Merge from rustcThe Miri Cronjob Bot-5/+1
2024-10-21move strict provenance lints to new feature gate, remove old feature gatesRalf Jung-5/+1
2024-10-21Added support for prctl handling thread namesYoh Deadfall-0/+75
2024-10-18pthread-threadname: ensure we can see the name set via the Rust APIRalf Jung-0/+17
2024-10-13Auto merge of #3957 - YohDeadfall:macos-thread-name, r=RalfJungbors-39/+109
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/+109
2024-10-12Fixed get thread name behavior for FreeBSDYoh Deadfall-6/+5
2024-10-12Fixed pthread get/set name for macOSYoh Deadfall-2/+26
2024-10-10Pipe minor changes: diagnostics, flag support and commentstiif-1/+22
2024-10-09syscall/eventfd2: add supportFrank Rehwinkel-0/+9
2024-10-09Fixed pthread_getname_np impl for glibcYoh Deadfall-17/+61
2024-10-02epoll: add vector clock to the epoll ready_listFrank Rehwinkel-1/+40
This adds a VClock to the epoll implementation's ready_list and has this VClock synced from the thread that updates an event in the ready_list and then has the VClocks of any threads being made runnable again, out of the calls to epoll_wait, synced from it.