From: Jeff King Date: Fri, 25 Aug 2017 17:04:12 GMT Subject: Re: [PATCH v2 4/4] ThreadSanitizer: add suppressions Message-ID: <20170825170411.qo6miyd46hfg6jzw@sigill.intra.peff.net> In-Reply-To: <09bbbcd1429a28774ea2d8c67ef6106ab558c296.1503323391.git.martin.agren@gmail.com> On Mon, Aug 21, 2017 at 07:43:48PM +0200, Martin Ă…gren wrote: > 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. This looks good to me. -Peff