On Darwin, sigprocmask changes the signal mask for the entire process. This has some unwanted consequences, because e.g. internal_start_thread wants to disable signals only in the current thread (to make the new thread inherit the signal mask), which is currently broken on Darwin. This patch switches to pthread_sigmask.
Details
Details
- Reviewers
dvyukov - Commits
- rG7149ca04ad8c: [tsan] Use pthread_sigmask instead of sigprocmask to block signals in a thread…
rCRT307212: [tsan] Use pthread_sigmask instead of sigprocmask to block signals in a thread…
rL307212: [tsan] Use pthread_sigmask instead of sigprocmask to block signals in a thread…
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/sanitizer_common/sanitizer_mac.cc | ||
---|---|---|
511 ↗ | (On Diff #105281) | I think you either need to (1) change implementation of internal_sigprocmask to follow the unofficial contract of affecting only the current thread, or (2) delete internal_sigprocmask. (1) looks preferable to me as it will allow to write portable code for "unix" OSes, and make the code more consistent as we use __sanitizer_sigset_t and internal_sigfillset in this function, and move us closer to the ultimate goal of not using any library functions that loop into interceptors in favor of system calls (even if you use pthread_sigmask on implementation level for now). |