ThreadSanitizer: add suppressions
commit6cdf8a7929688ea5702ab53f450d038e973e64e1
authorMartin Ågren <martin.agren@gmail.com>
Mon, 21 Aug 2017 17:43:48 +0000 (21 19:43 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 23 Aug 2017 17:38:56 +0000 (23 10:38 -0700)
tree6bc1c2972542be1c7ada97faefa345278b582c7e
parent65961d5a75e28aa04a90ee65106f71da177fd4b3
ThreadSanitizer: add suppressions

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>
.tsan-suppressions [new file with mode: 0644]
color.c
transport-helper.c