diff options
| author | León Orell Valerian Liehr <me@fmease.dev> | 2025-05-18 18:44:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-18 18:44:11 +0200 |
| commit | 6f415e0f4c547c40490d1eeac971bd7b1057ac23 (patch) | |
| tree | f63671293c1edaddaa295fe0aea9b3055b710d39 /compiler/rustc_codegen_gcc/src | |
| parent | 2f0c6e217f51eee4ee54424e18e9effce5404038 (diff) | |
| parent | 2cdbd69abfbd5a1f0c5b9ceee2393f1a87181d97 (diff) | |
| download | rust-6f415e0f4c547c40490d1eeac971bd7b1057ac23.tar.gz rust-6f415e0f4c547c40490d1eeac971bd7b1057ac23.zip | |
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.
Diffstat (limited to 'compiler/rustc_codegen_gcc/src')
0 files changed, 0 insertions, 0 deletions
