rust/library/std/src/sys
joboet 84bb0f07e6
std: stop using TLS in signal handler
TLS is not async-signal-safe, making its use in the signal handler used to detect stack overflows unsound (c.f. #133698). POSIX however lists two thread-specific identifiers that can be obtained in a signal handler: the current `pthread_t` and the address of `errno`. Since `pthread_equal` is not AS-safe, `pthread_t` should be considered opaque, so for our purposes, `&errno` is the only option. This however works nicely: we can use the address as a key into a map that stores information for each thread. This PR uses a `BTreeMap` protected by a spin lock to hold the guard page address and thread name and thus fixes #133698.
2025-05-05 15:18:52 +02:00
..
alloc use generic Atomic type where possible 2025-04-27 02:18:08 +03:00
anonymous_pipe Mv os-specific trait impl of Pipe* into std::os::* 2025-03-14 01:03:56 +11:00
args Delegate to inner vec::IntoIter from env::ArgsOs 2025-05-01 15:18:15 -07:00
env use generic Atomic type where possible 2025-04-27 02:18:08 +03:00
fd Rollup merge of #139667 - 1c3t3a:remove-no-sanitize, r=m-ou-se 2025-04-17 00:16:21 +02:00
fs Rollup merge of #139343 - cberner:filelock_wouldblock, r=workingjubilee 2025-05-03 08:45:01 +02:00
io Trusty: Implement write_vectored for stdio 2025-03-27 16:49:30 -07:00
net use generic Atomic type where possible 2025-04-27 02:18:08 +03:00
os_str Make internal OsString::truncate and extend_from_slice unsafe 2025-04-30 23:56:39 -07:00
pal std: stop using TLS in signal handler 2025-05-05 15:18:52 +02:00
path Use with_native_path for Windows 2025-04-11 18:02:03 +00:00
personality Rollup merge of #137621 - Berrysoft:cygwin-std, r=joboet 2025-03-17 05:47:49 -04:00
process use generic Atomic type where possible 2025-04-27 02:18:08 +03:00
random use generic Atomic type where possible 2025-04-27 02:18:08 +03:00
stdio Rollup merge of #139517 - Ayush1325:uefi-cmd-stdin-null, r=joboet 2025-04-15 15:47:25 +10:00
sync use generic Atomic type where possible 2025-04-27 02:18:08 +03:00
thread_local use generic Atomic type where possible 2025-04-27 02:18:08 +03:00
backtrace.rs Improve comments for the default backtrace printer 2024-12-04 20:54:37 -05:00
cmath.rs std: make cmath functions safe 2025-03-29 13:08:18 +01:00
env_consts.rs Move zkVM constants into sys::env_consts 2025-04-21 21:05:04 -07:00
exit_guard.rs std: use the address of errno to identify threads in unique_thread_exit 2025-04-01 13:35:16 +02:00
mod.rs Move sys::pal::os::Env into sys::env 2025-04-21 20:56:43 -07:00