Index: compiler-rt/lib/sanitizer_common/sanitizer_flags.inc =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_flags.inc +++ compiler-rt/lib/sanitizer_common/sanitizer_flags.inc @@ -103,7 +103,7 @@ "handle_*=1 will be upgraded to handle_*=2.") COMMON_FLAG(bool, use_sigaltstack, true, "If set, uses alternate stack for signal handling.") -COMMON_FLAG(bool, detect_deadlocks, false, +COMMON_FLAG(bool, detect_deadlocks, true, "If set, deadlock detection is enabled.") COMMON_FLAG( uptr, clear_shadow_mmap_threshold, 64 * 1024, Index: compiler-rt/lib/tsan/rtl/tsan_flags.cc =================================================================== --- compiler-rt/lib/tsan/rtl/tsan_flags.cc +++ compiler-rt/lib/tsan/rtl/tsan_flags.cc @@ -61,8 +61,7 @@ // Does not work as expected for Go: runtime handles SIGABRT and crashes. cf.abort_on_error = false; // Go does not have mutexes. - } else { - cf.detect_deadlocks = true; + cf.detect_deadlocks = false; } cf.print_suppressions = false; cf.stack_trace_format = " #%n %f %S %M"; Index: compiler-rt/test/tsan/deadlock_detector_stress_test.cc =================================================================== --- compiler-rt/test/tsan/deadlock_detector_stress_test.cc +++ compiler-rt/test/tsan/deadlock_detector_stress_test.cc @@ -1,12 +1,12 @@ // RUN: %clangxx_tsan %s -o %t -DLockType=PthreadMutex -// RUN: %env_tsan_opts=detect_deadlocks=1 %deflake %run %t | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NOT-SECOND -// RUN: %env_tsan_opts=detect_deadlocks=1:second_deadlock_stack=1 %deflake %run %t | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-SECOND +// RUN: %deflake %run %t | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NOT-SECOND +// RUN: %env_tsan_opts=second_deadlock_stack=1 %deflake %run %t | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-SECOND // RUN: %clangxx_tsan %s -o %t -DLockType=PthreadSpinLock -// RUN: %env_tsan_opts=detect_deadlocks=1 %deflake %run %t | FileCheck %s +// RUN: %deflake %run %t | FileCheck %s // RUN: %clangxx_tsan %s -o %t -DLockType=PthreadRWLock -// RUN: %env_tsan_opts=detect_deadlocks=1 %deflake %run %t | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-RD +// RUN: %deflake %run %t | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-RD // RUN: %clangxx_tsan %s -o %t -DLockType=PthreadRecursiveMutex -// RUN: %env_tsan_opts=detect_deadlocks=1 %deflake %run %t | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-REC +// RUN: %deflake %run %t | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-REC #include "test.h" #undef NDEBUG #include Index: compiler-rt/test/tsan/mutex_cycle2.c =================================================================== --- compiler-rt/test/tsan/mutex_cycle2.c +++ compiler-rt/test/tsan/mutex_cycle2.c @@ -1,5 +1,5 @@ // RUN: %clangxx_tsan %s -o %t -// RUN: not %run %t 2>&1 | FileCheck %s +// RUN: not %run %t 2>&1 | FileCheck %s // RUN: %env_tsan_opts=detect_deadlocks=1 not %run %t 2>&1 | FileCheck %s // RUN: %env_tsan_opts=detect_deadlocks=0 %run %t 2>&1 | FileCheck %s --check-prefix=DISABLED // RUN: echo "deadlock:main" > %t.supp