6 ms·
You've used thread_local for the sigjmp_buf. Are you sure the mechanism used by thread_local is safe to use in a signal handler? Relevant bug from Rust: "TLS
by jlokier 8y ago
You've used thread_local for the sigjmp_buf.
Are you sure the mechanism used by thread_local is safe to use in a signal handler?
Relevant bug from Rust: "TLS accesses aren't async-signal-safe", https://github.com/rust-lang/rust/issues/43146 https://github.com/rust-lang/rust/issues/43146
I'm thinking even if it works on certain OSes, it's not guaranteed, because a signal handler's context is not a thread context - or is it?
E.g. the thread_local mechanism might depend on compile-time options (affecting how thread_local, whether it allocates memory on demand, and how it relocates the memory block when loading a shared library), whether it's main program or an -fPIC shared library, and the type of thread library (different ways of implementing pthreads).
- ben-schaaf 8y agoConsidering we haven't had any mmap related crashes anymore I'd say its safe to assume that its good enough for our application.