[compiler-rt] r202977 - tsan: fix deadlock detector build for SANITIZER_DEADLOCK_DETECTOR_VERSION=2

Dmitry Vyukov dvyukov at google.com
Wed Mar 5 05:53:30 PST 2014


Author: dvyukov
Date: Wed Mar  5 07:53:29 2014
New Revision: 202977

URL: http://llvm.org/viewvc/llvm-project?rev=202977&view=rev
Log:
tsan: fix deadlock detector build for SANITIZER_DEADLOCK_DETECTOR_VERSION=2


Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector2.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector_interface.h
    compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector2.cc?rev=202977&r1=202976&r2=202977&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector2.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector2.cc Wed Mar  5 07:53:29 2014
@@ -172,7 +172,7 @@ void DD::MutexBeforeLock(DDCallback *cb,
   if (lt->nlocked == 1) {
     VPrintf(3, "#%llu: DD::MutexBeforeLock first mutex\n",
         cb->lt->ctx);
-    return 0;
+    return;
   }
 
   bool added = false;
@@ -361,10 +361,10 @@ void DD::Report(DDPhysicalThread *pt, DD
 }
 
 DDReport *DD::GetReport(DDCallback *cb) {
-  if (!cb->lt->report_pending)
+  if (!cb->pt->report_pending)
     return 0;
-  cb->lt->report_pending = false;
-  return &cb->lt->rep;
+  cb->pt->report_pending = false;
+  return &cb->pt->rep;
 }
 
 }  // namespace __sanitizer

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector_interface.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector_interface.h?rev=202977&r1=202976&r2=202977&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector_interface.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector_interface.h Wed Mar  5 07:53:29 2014
@@ -36,7 +36,6 @@ struct DDMutex {
 #if SANITIZER_DEADLOCK_DETECTOR_VERSION == 1
   uptr id;
   u32  stk;  // creation stack
-  u64  ctx;
 #elif SANITIZER_DEADLOCK_DETECTOR_VERSION == 2
   u32              id;
   u32              recursion;
@@ -44,6 +43,7 @@ struct DDMutex {
 #else
 # error "BAD SANITIZER_DEADLOCK_DETECTOR_VERSION"
 #endif
+  u64  ctx;
 };
 
 struct DDReport {

Modified: compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt?rev=202977&r1=202976&r2=202977&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt Wed Mar  5 07:53:29 2014
@@ -12,7 +12,6 @@ else()
 endif()
 
 set(DD_DYNAMIC_DEFINITIONS DYNAMIC=1)
-set(DD_COMMON_DEFINITIONS SANITIZER_DEADLOCK_DETECTOR_VERSION=2)
 
 set(DD_SOURCES
   dd_rtl.cc
@@ -47,9 +46,6 @@ if(CAN_TARGET_x86_64 AND UNIX AND NOT AP
     $<TARGET_OBJECTS:RTInterception.${arch}>
     $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
     $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>)
-#  set_target_compile_flags(clang_rt.dd-${arch} ${DD_CFLAGS})
-#  set_property(TARGET clang_rt.dd-${arch} APPEND PROPERTY
-#    COMPILE_DEFINITIONS ${DD_COMMON_DEFINITIONS})
   target_link_libraries(clang_rt.dyndd-${arch} pthread dl)
 endif()
 





More information about the llvm-commits mailing list