5 Commits

Author SHA1 Message Date
Vitaly Buka
3a13c5a286 [tsan] Disable tests flaky on PPC with COMPILER_RT_DEBUG
Workaround for https://github.com/google/sanitizers/issues/1792
2024-09-06 16:33:52 -07:00
Vitaly Buka
4acd84e7cc
Revert "[compiler-rt] Also consider SIGPROF as a synchronous signal" (#86416)
Reverting #85188 with follow up patches.

This reverts commit 362d26366d0175f01ffb6085eb747a6e40f01147.
This reverts commit c9bdeabdf4b46fbf1f6a9fcbf9cd61d460b18c08.
This reverts commit 6bc6e1ace9fa8453e164fa04b5d9acd5a77e089a.
This reverts commit 01fa550ff654d6724e6da54c877032baeddff14b.
This reverts commit ddcbab37ac0e5743a8d39be3dd48d967f4c85504.
2024-03-24 01:22:48 -07:00
serge-sans-paille
ddcbab37ac
[compiler-rt] Also consider SIGPROF as a synchronous signal
Blocking that signal causes inter-blocking for profilers that monitor
threads through that signal.

Update tests accordingly to use an uncaught signal.

This is a recommit of 6f3f659ce9ab91002b4a490b0ce4b085981383cd with the
tests fixed.

Fix #83844 and #83561
2024-03-15 11:16:30 +01:00
Vitaly Buka
16a2aa3267 [test][tsan] Disable flaky test on PPC
COMPILER_RT_DEBUG was just added to sanitizer-ppc64le-linux, and this
test is already broken there.
2023-09-11 13:19:35 -07:00
Dmitry Vyukov
3056ccdbae tsan: fix deadlock/crash in signal handling
We set in_blocking_func around some blocking C functions so that we don't
delay signal infinitely (if in_blocking_func is set we deliver signals
synchronously).

However, pthread_join is blocking but also call munmap/free to free thread
resources. If we are inside the munmap/free interceptors called from
pthread_join and deliver a signal synchronously, it can lead to deadlocks
and crashes since we re-enter runtime and try to lock the same mutexes
or use the same per-thread data structures.

If we re-enter runtime via an interceptor when in_blocking_func is set,
temporary reset in_blocking_func around the interceptor and restore it back
when we return from the recursive interceptor.

Also move in_blocking_func from ThreadSignalContext to ThreadContext
so that we can CHECK that it's not set in SlotLocker ctor.

Fixes https://github.com/google/sanitizers/issues/1540

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D127845
2022-09-30 14:23:46 +02:00