Add .tsan-suppressions for want_color() and transfer_debug(). Both of these use the pattern static int foo = -1; if (foo == -1) foo = func(); where func always returns the same value. This can cause ThreadSanitizer to diagnose a race when foo is written from two threads, although it doesn't matter in practice since it's always the same value that is written. The suppressions-file is used by setting the environment variable TSAN_OPTIONS to, e.g., "suppressions=$(pwd)/.tsan-suppressions". Observe that relative paths such as ".tsan-suppressions" might not work. Signed-off-by: Martin Ågren <martin.agren@xxxxxxxxx> --- I am no memory-model expert. Maybe (aligned) stores and loads of int are not actually atomic on all the various hardware that Git wants to run on. Or maybe the compiler is allowed to compile them into 4 1-byte accesses anyway... .tsan-suppressions | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .tsan-suppressions diff --git a/.tsan-suppressions b/.tsan-suppressions new file mode 100644 index 000000000..910c02e59 --- /dev/null +++ b/.tsan-suppressions @@ -0,0 +1,12 @@ +# Suppressions for ThreadSanitizer (tsan). +# +# This file is used by setting the environment variable TSAN_OPTIONS to, e.g., +# "suppressions=$(pwd)/.tsan-suppressions". Observe that relative paths such as +# ".tsan-suppressions" might not work. +# +# These suppressions can be, e.g., that a static variable is written to and it +# is always the same value being written, so it doesn't really matter that two +# or more such writes race. + +race:^want_color$ +race:^transfer_debug$ -- 2.14.1.151.gdfeca7a7e