Source code

Revision control

Other Tools

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at */
#include "mozilla/Attributes.h"
#include "mozilla/TsanOptions.h"
#ifndef _MSC_VER // Not supported by clang-cl yet
// When running with ThreadSanitizer, we sometimes need to suppress existing
// races. However, in any case, it should be either because
// 1) a bug is on file. In this case, the bug number should always be
// included with the suppression.
// or 2) this is an intentional race. Please be very careful with judging
// races as intentional and benign. Races in C++ are undefined behavior
// and compilers increasingly rely on exploiting this for optimizations.
// Hence, many seemingly benign races cause harmful or unexpected
// side-effects.
// See also:
// Also, when adding any race suppressions here, make sure to always add
// a signature for each of the two race stacks. Sometimes, TSan fails to
// symbolize one of the two traces and this can cause suppressed races to
// show up intermittently.
// clang-format off
extern "C" const char* __tsan_default_suppressions() {
return "# Add your suppressions below\n"
// External uninstrumented libraries
// TSan internals
// Uninstrumented code causing false positives
// These libraries are uninstrumented and cause mutex false positives.
// However, they can be unloaded by GTK early which we cannot avoid.
// Bug 1637707 - permanent
// ~GLContextGLX unlocks a libGL mutex.
// Bug 1651446 - permanent (ffmpeg)
// For some reason, the suppressions on
// through `called_from_lib` only work partially.
// This is a callback from libglib-2 that is apparently
// not fully suppressed through `called_from_lib`.
// This is likely a false positive involving a mutex from GTK.
// See also bug 1642653 - permanent.
// Bug 1688716 - Failure due to fire_glxtest_process
// calling into uninstrumented external graphics driver code.
// For example: and
// Bug 1722721 - WebRender using uninstrumented Mesa drivers
// Deadlock reports on single-threaded runtime.
// This is a known false positive from TSan where it reports
// a potential deadlock even though all mutexes are only
// taken by a single thread. For applications/tasks where we
// are absolutely sure that no second thread will be involved
// we should suppress these issues.
// Bug 1614605 - permanent
// Bug 1643087 - permanent
// Bug 1606804 - permanent
// Bug 1651770 - permanent
// Bug 1606804 - permanent
// Bug 1680655 - permanent
// Bug 1682861 - permanent
// Benign races in third-party code (should be fixed upstream)
// No Bug - permanent
// No Upstream Bug Filed!
// SIMD Initialization in libjpeg, potentially runs
// initialization twice, but otherwise benign. Init
// routine itself is in native assembler.
// Bug 1615228 - permanent
// No Upstream Bug Filed!
// Likely benign race in ipc/chromium/ where we set
// `message_loop_` to `NULL` on two threads when stopping
// a thread at the same time it is already finishing.
// Bug 1615569 - permanent
// No Upstream Bug Filed!
// NSS is using freebl from two different threads but freebl isn't
// that threadsafe.
// Bug 1652499 - permanent
// No Upstream Bug Filed!
// Likely benign race in code - race while updating the
// minimum log severity.
// Bug 1652174 - permanent
// Likely benign write-write race in libevent to set a sticky boolean
// flag to true.
// Bug 1648606 - permanent
// No Upstream Bug Filed!
// Race on some flag being checking in libusrsctp.
// Bug 1653618 - permanent
// Might lead to scheduled timers in libusrsctp getting dropped?
// Bug 1648604 - permanent
// Likely benign race in libusrsctp allocator during a free.
// Bug 1153409 - permanent
// No Upstream Bug Filed!
// Probably benign - sqlite has a few optimizations where it does
// racy reads and then does properly synchornized integrity checks
// afterwards. Some concern of compiler optimizations messing this
// up due to "volatile" being too weak for this.
// Bug 1674770 - permanent
// parking_lot using incorrect atomic orderings in RwLock, upstream
// fix already up for review.
// No Bug - permanent
// Probably a false-positive from crossbeam's deque not being
// understood by tsan.
// The rest of these suppressions are miscellaneous issues in gecko
// that should be investigated and ideally fixed.
// Bug 1671574 - Permanent
// The StartupCache thread intentionally races with the main thread to
// trigger OS-level paging. It is never joined with the main thread.
// Bug 1734262 - Permanent
// When spawning async processes, we create a helper thread to wait for
// the process to terminate in order to asynchronously report the exit
// code to Gecko. This thread waits on a syscall for the process to end,
// which means there's no easy way to cancel and join it during Gecko
// shutdown. Suppress thread leak reports for this thread.
// No Bug - Logging bug in Mochitests
// This thread does not seem to be stopped/joined.
// ImageBridgeChild should be turned back into a background
// task queue in bug 1647628, in which case these suppressions
// can be removed.
// Bug 1722721 - This is a benign race creating worker/SW compositor threads.
// Bug 1722721 - This is a false positive during SW-WR rendering.
// End of suppressions.
; // Please keep this semicolon.
// clang-format on
#endif // _MSC_VER