Browse Source
Add a file .tsan-suppressions and list two functions in it: want_color() and transfer_debug(). Both of these use the pattern static int foo = -1; if (foo < 0) foo = bar(); where bar always returns the same non-negative value. This can cause ThreadSanitizer to diagnose a race when foo is written from two threads. That is indeed a race, although it arguably doesn't matter in practice since it's always the same value that is written. Add NEEDSWORK-comments to the functions so that this problem is not forever swept way under the carpet. 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@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
Martin Ågren
8 years ago
committed by
Junio C Hamano
3 changed files with 24 additions and 0 deletions
@ -0,0 +1,10 @@
@@ -0,0 +1,10 @@
|
||||
# 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. |
||||
|
||||
# A static variable is written to racily, but we always write the same value, so |
||||
# in practice it (hopefully!) doesn't matter. |
||||
race:^want_color$ |
||||
race:^transfer_debug$ |
Loading…
Reference in new issue