[compiler-rt] [tsan] Fix dead lock when starting StackDepot thread (PR #96456)
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 24 23:42:53 PDT 2024
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/96456
>From 403f5166260b9334c1d13ae1795932fa6b08e404 Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka at google.com>
Date: Sun, 23 Jun 2024 23:59:47 -0700
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
=?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Created using spr 1.3.4
---
.../lib/tsan/rtl/tsan_interceptors_posix.cpp | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
index 94adea777cafd..151693112158b 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
@@ -1088,7 +1088,18 @@ TSAN_INTERCEPTOR(int, pthread_join, void *th, void **ret) {
return res;
}
-DEFINE_REAL_PTHREAD_FUNCTIONS
+// DEFINE_REAL_PTHREAD_FUNCTIONS
+namespace __sanitizer {
+int real_pthread_create(void *th, void *attr, void *(*callback)(void *),
+ void *param) {
+ ScopedIgnoreInterceptors ignore;
+ return REAL(pthread_create)(th, attr, callback, param);
+}
+int real_pthread_join(void *th, void **ret) {
+ ScopedIgnoreInterceptors ignore;
+ return REAL(pthread_join(th, ret));
+}
+} // namespace __sanitizer
TSAN_INTERCEPTOR(int, pthread_detach, void *th) {
SCOPED_INTERCEPTOR_RAW(pthread_detach, th);
More information about the llvm-commits
mailing list