[compiler-rt] r220673 - [Tsan] Make calloc() to not track allocated space unless thread is completely initialized

Viktor Kutuzov vkutuzov at accesssoftek.com
Mon Oct 27 04:19:09 PDT 2014


Author: vkutuzov
Date: Mon Oct 27 06:19:08 2014
New Revision: 220673

URL: http://llvm.org/viewvc/llvm-project?rev=220673&view=rev
Log:
[Tsan] Make calloc() to not track allocated space unless thread is completely initialized
Differential Revision: http://reviews.llvm.org/D5992

Modified:
    compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc

Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc?rev=220673&r1=220672&r2=220673&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc Mon Oct 27 06:19:08 2014
@@ -872,11 +872,13 @@ extern "C" void *__tsan_thread_start_fun
     ThreadState *thr = cur_thread();
     // Thread-local state is not initialized yet.
     ScopedIgnoreInterceptors ignore;
+    ThreadIgnoreBegin(thr, 0);
     if (pthread_setspecific(g_thread_finalize_key,
                             (void *)kPthreadDestructorIterations)) {
       Printf("ThreadSanitizer: failed to set thread key\n");
       Die();
     }
+    ThreadIgnoreEnd(thr, 0);
     while ((tid = atomic_load(&p->tid, memory_order_acquire)) == 0)
       pthread_yield();
     atomic_store(&p->tid, 0, memory_order_release);





More information about the llvm-commits mailing list