Skip to content

Commit eb77459

Browse files
authored
ThreadSanitizer: add ignorelist and suppressions file (#59741)
Instrumenting the garbage collector results in a ton of warnings that would require relaxed atomics to suppress, and is a huge performance drag. This change turns off instrumentation for non-atomic operations for everything in `src/gc-*.c`. Also, adds a `suppressions.txt` to be used with `TSAN_OPTIONS="suppressions=contrib/tsan/suppressions.txt"` that suppresses the lock order inversion warning on method locks, which is documented in https://docs.julialang.org/en/v1.13-dev/devdocs/locks/#Exceptions-to-the-lock-hierarchy.
1 parent 406027e commit eb77459

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

Make.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ SANITIZE_OPTS += -fsanitize=address
818818
SANITIZE_LDFLAGS += -fsanitize=address -shared-libasan
819819
endif
820820
ifeq ($(SANITIZE_THREAD),1)
821-
SANITIZE_OPTS += -fsanitize=thread
821+
SANITIZE_OPTS += -fsanitize=thread -fsanitize-ignorelist=$(JULIAHOME)/contrib/tsan/ignorelist.txt
822822
SANITIZE_LDFLAGS += -fsanitize=thread
823823
ifneq ($(CROSS_BOOTSTRAP_JULIA),)
824824
bootstrap_julia_flags += --target-sanitize=thread

contrib/tsan/ignorelist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mainfile:*/gc-*.c

contrib/tsan/suppressions.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
deadlock:invalidate_code_instance

0 commit comments

Comments
 (0)