summaryrefslogtreecommitdiff
path: root/lib/tsan
diff options
context:
space:
mode:
authorAlexander Richardson <arichardson.kde@gmail.com>2019-08-06 22:30:48 +0000
committerAlexander Richardson <arichardson.kde@gmail.com>2019-08-06 22:30:48 +0000
commit997a8c066d12e3f6f8f3ee2e681741cc0d4b02c4 (patch)
treead9be9855a34ad6be21106c5c6281e46e38f5342 /lib/tsan
parent63597da68262b255f805b9380df8d7491e248e0a (diff)
downloadcompiler-rt-997a8c066d12e3f6f8f3ee2e681741cc0d4b02c4.tar.gz
[TSAN] Fix tsan on FreeBSD after D54889
Summary: It appears that since https://reviews.llvm.org/D54889, BackgroundThread() crashes immediately because cur_thread()-> will return a null pointer which is then dereferenced. I'm not sure why I only see this issue on FreeBSD and not Linux since it should also be unintialized on other platforms. Reviewers: yuri, dvyukov, dim, emaste Subscribers: kubamracek, krytarowski, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D65705 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@368103 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan')
-rw-r--r--lib/tsan/rtl/tsan_rtl.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/tsan/rtl/tsan_rtl.cpp b/lib/tsan/rtl/tsan_rtl.cpp
index 312d00c6f..1ac390709 100644
--- a/lib/tsan/rtl/tsan_rtl.cpp
+++ b/lib/tsan/rtl/tsan_rtl.cpp
@@ -149,6 +149,7 @@ static void BackgroundThread(void *arg) {
// We don't use ScopedIgnoreInterceptors, because we want ignores to be
// enabled even when the thread function exits (e.g. during pthread thread
// shutdown code).
+ cur_thread_init();
cur_thread()->ignore_interceptors++;
const u64 kMs2Ns = 1000 * 1000;