tsan: disable instrumentation in runtime callbacks in tests
authorDmitry Vyukov <dvyukov@google.com>
Mon, 22 Nov 2021 07:22:01 +0000 (08:22 +0100)
committerDmitry Vyukov <dvyukov@google.com>
Mon, 22 Nov 2021 14:48:29 +0000 (15:48 +0100)
All runtime callbacks must be non-instrumented with the new tsan runtime
(it's now more picky with respect to recursion into runtime).
Disable instrumentation in Darwin tests as we do in all other tests now.

Differential Revision: https://reviews.llvm.org/D114348

compiler-rt/test/tsan/Darwin/debug_external.cpp
compiler-rt/test/tsan/Darwin/external-swift-debugging.cpp

index 2418a27..399663c 100644 (file)
@@ -42,7 +42,8 @@ int main() {
   return 0;
 }
 
-void __tsan_on_report(void *report) {
+__attribute__((disable_sanitizer_instrumentation)) void
+__tsan_on_report(void *report) {
   const char *type;
   void *addr;
   void *start;
index 603734e..72335ed 100644 (file)
@@ -45,8 +45,8 @@ int main(int argc, char *argv[]) {
   fprintf(stderr, "Done.\n");
 }
 
-extern "C"
-void __tsan_on_report(void *report) {
+extern "C" __attribute__((disable_sanitizer_instrumentation)) void
+__tsan_on_report(void *report) {
   const char *description;
   int count;
   int stack_count, mop_count, loc_count, mutex_count, thread_count,