[all-commits] [llvm/llvm-project] 1aa746: [tsan] Fix nested signal handling (#138599)
Jakob Widauer via All-commits
all-commits at lists.llvm.org
Thu May 22 09:45:14 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 1aa746d300d72042aaa48e7982f76a823aed8cb3
https://github.com/llvm/llvm-project/commit/1aa746d300d72042aaa48e7982f76a823aed8cb3
Author: Jakob Widauer <jakob.widauer at gmail.com>
Date: 2025-05-22 (Thu, 22 May 2025)
Changed paths:
M compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
M compiler-rt/lib/tsan/rtl/tsan_rtl.h
M compiler-rt/test/tsan/signal_recursive.cpp
Log Message:
-----------
[tsan] Fix nested signal handling (#138599)
This PR fixes the bug reported in #134358.
In the current implementation of the tsan posix interceptors, the signal
set does not get restored to the correct original set, if a signal
handler gets called, while already inside of a signal handler. This
leads to the wrong signal set being set for the thread in which the
signal handler was called.
To fix this I introduced a stack of `__sanitizer_sigset_t` to keep all
the correct old signal sets and restore them in the correct order.
There was also already an existing test that tested nested / recursive
signal handlers, but it was disabled.
I therefore reenabled it, made it more robust by waiting for the second
thread to have been properly started and added checks for the signal
sets.
This test then failed before the introduction of the interceptor fix and
didn't fail with the fix.
@dvyukov What are your thoughts?
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list