pthread_setname_np shim should return and int on macOS, but returns void. #2625
Labels
A-mac
Area: Affects only macOS targets
E-good-first-issue
A good way to start contributing, mentoring is available
pthread_setname_np
on macOS returns an integer success code: https://github.com/apple-oss-distributions/libpthread/blob/cf9e1c7e611440e511af230905be2cfefc5c6121/include/pthread/pthread.h#L509-L510Unfortunately, the miri shim for it returns void:
miri/src/shims/unix/macos/foreign_items.rs
Lines 176 to 185 in c3d67d4
This probably happened because the manpage on apple tragically has the same mistake: https://github.com/apple-oss-distributions/libpthread/blob/cf9e1c7e611440e511af230905be2cfefc5c6121/man/pthread_setname_np.3#L35
But the function truly does return int: https://github.com/apple-oss-distributions/libpthread/blob/cf9e1c7e611440e511af230905be2cfefc5c6121/src/pthread.c#L1140-L1163
This leads to false positives for UB in libstd's tests: https://github.com/rust-lang/miri-test-libstd/actions/runs/3342425264/jobs/5534636230#step:5:723
The text was updated successfully, but these errors were encountered: