rust/library/std
León Orell Valerian Liehr 6f415e0f4c
Rollup merge of #140628 - joboet:async_signal_safe, r=Mark-Simulacrum
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-18 18:44:11 +02:00
..
benches Fix import in bench for wasm 2025-02-12 14:44:30 -08:00
src Rollup merge of #140628 - joboet:async_signal_safe, r=Mark-Simulacrum 2025-05-18 18:44:11 +02:00
tests Move applicable float tests from coretests back to std 2025-05-14 14:29:58 +00:00
build.rs Use feature(target_has_reliable_f16_f128) in library tests 2025-04-27 20:10:33 +00:00
Cargo.toml bump compiler_builtins 2025-05-13 11:30:36 +02:00