Open Bug 1894309 Opened 18 days ago Updated 11 days ago

Permanent SUMMARY: ThreadSanitizer: data race /builds/worker/workspace/obj-build/dist/include/nsDeque.h:59:42 in GetSize

Categories

(Core :: Audio/Video: Playback, defect)

defect

Tracking

()

People

(Reporter: RyanVM, Unassigned)

References

Details

I've been looking at enabling GTests in TSAN mode and this is currently permafailing.

https://treeherder.mozilla.org/logviewer?job_id=456452275&repo=try&lineNumber=34563

TEST-START | MultiWriterQueue.nsDequeBenchmark
DequeWrapperST  threads=1w+0r loops/thread=2097152 pushes=pops=2097152 duration=0.188389s pushes/s=11132002.051941 buffers: live=0 (w 0) reusable=0 (w 0) alloc=0 (w 0)
DequeWrapperAW  threads=1w+0r loops/thread=2097152 pushes=pops=2097152 duration=0.651738s pushes/s=3217782.949616 buffers: live=0 (w 0) reusable=0 (w 0) alloc=0 (w 0)
DequeWrapperMW  threads=1w+0r loops/thread=2097152 pushes=pops=2097152 duration=0.857781s pushes/s=2444855.732041 buffers: live=0 (w 0) reusable=0 (w 0) alloc=0 (w 0)
DequeWrapperMT  threads=1w+0r loops/thread=2097152 pushes=pops=2097152 duration=1.462352s pushes/s=1434095.111954 buffers: live=0 (w 0) reusable=0 (w 0) alloc=0 (w 0)
==================
WARNING: ThreadSanitizer: data race (pid=993)
  Read of size 8 at 0x7ffcff1e0198 by thread T141486:
    #0 GetSize /workspace/obj-build/dist/include/nsDeque.h:59:42 (libxul.so+0x47f8785)
    #1 PopAll<(lambda at /checkouts/gecko/dom/media/doctor/test/gtest/TestMultiWriterQueue.cpp:86:14)> /checkouts/gecko/dom/media/doctor/test/gtest/TestMultiWriterQueue.cpp:349:16 (libxul.so+0x47f8785)
    #2 operator() /checkouts/gecko/dom/media/doctor/test/gtest/TestMultiWriterQueue.cpp:86:7 (libxul.so+0x47f8785)
    #3 mozilla::detail::RunnableFunction<void TestMultiWriterQueueMT<DequeWrapperMT>(int, int, int, char const*)::'lambda'()>::Run() /workspace/obj-build/dist/include/nsThreadUtils.h:548:5 (libxul.so+0x47f8785)
    #4 nsThread::ProcessNextEvent(bool, bool*) /checkouts/gecko/xpcom/threads/nsThread.cpp:1193:16 (libxul.so+0x573dbee)
    #5 NS_ProcessNextEvent(nsIThread*, bool) /checkouts/gecko/xpcom/threads/nsThreadUtils.cpp:480:10 (libxul.so+0x5744184)
    #6 mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*) /checkouts/gecko/ipc/glue/MessagePump.cpp:330:5 (libxul.so+0x6288e19)
    #7 RunInternal /checkouts/gecko/ipc/chromium/src/base/message_loop.cc:370:10 (libxul.so+0x61fbe08)
    #8 RunHandler /checkouts/gecko/ipc/chromium/src/base/message_loop.cc:363:3 (libxul.so+0x61fbe08)
    #9 MessageLoop::Run() /checkouts/gecko/ipc/chromium/src/base/message_loop.cc:345:3 (libxul.so+0x61fbe08)
    #10 nsThread::ThreadFunc(void*) /checkouts/gecko/xpcom/threads/nsThread.cpp:370:10 (libxul.so+0x5739473)
    #11 _pt_root /checkouts/gecko/nsprpub/pr/src/pthreads/ptthread.c:201:5 (libnspr4.so+0x4ba79)
  Previous write of size 8 at 0x7ffcff1e0198 by thread T141487 (mutexes: write M0):
    #0 mozilla::detail::nsDequeBase::PushFront(void*, std::nothrow_t const&) /checkouts/gecko/xpcom/ds/nsDeque.cpp:175:8 (libxul.so+0x5690fd0)
    #1 PushFront /workspace/obj-build/dist/include/nsDeque.h:309:23 (libxul.so+0x47f8945)
    #2 Push /checkouts/gecko/dom/media/doctor/test/gtest/TestMultiWriterQueue.cpp:340:9 (libxul.so+0x47f8945)
    #3 operator() /checkouts/gecko/dom/media/doctor/test/gtest/TestMultiWriterQueue.cpp:123:17 (libxul.so+0x47f8945)
    #4 mozilla::detail::RunnableFunction<void TestMultiWriterQueueMT<DequeWrapperMT>(int, int, int, char const*)::'lambda0'()>::Run() /workspace/obj-build/dist/include/nsThreadUtils.h:548:5 (libxul.so+0x47f8945)
    #5 nsThread::ProcessNextEvent(bool, bool*) /checkouts/gecko/xpcom/threads/nsThread.cpp:1193:16 (libxul.so+0x573dbee)
    #6 NS_ProcessNextEvent(nsIThread*, bool) /checkouts/gecko/xpcom/threads/nsThreadUtils.cpp:480:10 (libxul.so+0x5744184)
    #7 mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*) /checkouts/gecko/ipc/glue/MessagePump.cpp:300:20 (libxul.so+0x6288d5e)
    #8 RunInternal /checkouts/gecko/ipc/chromium/src/base/message_loop.cc:370:10 (libxul.so+0x61fbe08)
    #9 RunHandler /checkouts/gecko/ipc/chromium/src/base/message_loop.cc:363:3 (libxul.so+0x61fbe08)
    #10 MessageLoop::Run() /checkouts/gecko/ipc/chromium/src/base/message_loop.cc:345:3 (libxul.so+0x61fbe08)
    #11 nsThread::ThreadFunc(void*) /checkouts/gecko/xpcom/threads/nsThread.cpp:370:10 (libxul.so+0x5739473)
    #12 _pt_root /checkouts/gecko/nsprpub/pr/src/pthreads/ptthread.c:201:5 (libnspr4.so+0x4ba79)
  Location is stack of main thread.
  Location is global '??' at 0x7ffcff1c2000 ([stack]+0x1e198)
  Mutex M0 (0x7ffcff1e0218) created at:
    #0 pthread_mutex_init /fetches/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1313:3 (firefox-bin+0xc73a0)
    #1 mozilla::detail::MutexImpl::MutexImpl() /checkouts/gecko/mozglue/misc/Mutex_posix.cpp:76:3 (firefox-bin+0x1bb5b4)
    #2 OffTheBooksMutex /workspace/obj-build/dist/include/mozilla/Mutex.h:47:12 (libxul.so+0x47f12de)
    #3 Mutex /workspace/obj-build/dist/include/mozilla/Mutex.h:126:39 (libxul.so+0x47f12de)
    #4 DequeWrapperMW /checkouts/gecko/dom/media/doctor/test/gtest/TestMultiWriterQueue.cpp:336:22 (libxul.so+0x47f12de)
    #5 DequeWrapperMT /checkouts/gecko/dom/media/doctor/test/gtest/TestMultiWriterQueue.cpp:346:8 (libxul.so+0x47f12de)
    #6 void TestMultiWriterQueueMT<DequeWrapperMT>(int, int, int, char const*) /checkouts/gecko/dom/media/doctor/test/gtest/TestMultiWriterQueue.cpp:73:5 (libxul.so+0x47f12de)
    #7 MultiWriterQueue_nsDequeBenchmark_Test::TestBody() /checkouts/gecko/dom/media/doctor/test/gtest/TestMultiWriterQueue.cpp:371:3 (libxul.so+0x47ef4d8)
    #8 void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc (libxul.so+0x428833d)
    #9 testing::Test::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:2688:5 (libxul.so+0x42881a9)
    #10 testing::TestInfo::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:2837:11 (libxul.so+0x4289bb8)
    #11 testing::TestSuite::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:3016:30 (libxul.so+0x428b1b4)
    #12 testing::internal::UnitTestImpl::RunAllTests() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:5922:44 (libxul.so+0x42a8c49)
    #13 testing::Test::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:2688:5 (libxul.so+0x42881a9)
    #14 testing::TestInfo::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:2837:11 (libxul.so+0x4289bb8)
    #15 testing::TestSuite::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:3016:30 (libxul.so+0x428b1b4)
    #16 testing::internal::UnitTestImpl::RunAllTests() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:5922:44 (libxul.so+0x42a8c49)
    #17 testing::Test::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:2688:5 (libxul.so+0x42881a9)
    #18 testing::TestInfo::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:2837:11 (libxul.so+0x4289bb8)
    #19 testing::TestSuite::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:3016:30 (libxul.so+0x428b1b4)
    #20 testing::internal::UnitTestImpl::RunAllTests() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:5922:44 (libxul.so+0x42a8c49)
    #21 bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc (libxul.so+0x42a83ed)
    #22 testing::UnitTest::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:5486:10 (libxul.so+0x42a8190)
    #23 RUN_ALL_TESTS /workspace/obj-build/dist/include/gtest/gtest.h:2319:73 (libxul.so+0x425db1f)
    #24 mozilla::RunGTestFunc(int*, char**) /checkouts/gecko/testing/gtest/mozilla/GTestRunner.cpp:167:10 (libxul.so+0x425db1f)
    #25 XREMain::XRE_mainStartup(bool*) /checkouts/gecko/toolkit/xre/nsAppRunner.cpp:4686:16 (libxul.so+0xc1d6c09)
    #26 XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&) /checkouts/gecko/toolkit/xre/nsAppRunner.cpp:5946:12 (libxul.so+0xc1de932)
    #27 XRE_main(int, char**, mozilla::BootstrapConfig const&) /checkouts/gecko/toolkit/xre/nsAppRunner.cpp:6015:21 (libxul.so+0xc1df071)
    #28 mozilla::BootstrapImpl::XRE_main(int, char**, mozilla::BootstrapConfig const&) /checkouts/gecko/toolkit/xre/Bootstrap.cpp:45:12 (libxul.so+0xc1edf62)
    #29 do_main /checkouts/gecko/browser/app/nsBrowserApp.cpp:227:22 (firefox-bin+0x14ea00)
    #30 main /checkouts/gecko/browser/app/nsBrowserApp.cpp:445:16 (firefox-bin+0x14ea00)
  Thread T141486 'MWQThread' (tid=13945, running) created by main thread at:
    #0 pthread_create /fetches/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1020:3 (firefox-bin+0xc59bb)
    #1 _PR_CreateThread /checkouts/gecko/nsprpub/pr/src/pthreads/ptthread.c:458:14 (libnspr4.so+0x42cee)
    #2 PR_CreateThread /checkouts/gecko/nsprpub/pr/src/pthreads/ptthread.c:533:12 (libnspr4.so+0x37f84)
    #3 nsThread::Init(nsTSubstring<char> const&) /checkouts/gecko/xpcom/threads/nsThread.cpp:620:20 (libxul.so+0x573ac17)
    #4 nsThreadManager::NewNamedThread(nsTSubstring<char> const&, nsIThreadManager::ThreadCreationOptions, nsIThread**) /checkouts/gecko/xpcom/threads/nsThreadManager.cpp:602:22 (libxul.so+0x5742cbd)
    #5 NS_NewNamedThread(nsTSubstring<char> const&, nsIThread**, already_AddRefed<nsIRunnable>, nsIThreadManager::ThreadCreationOptions) /checkouts/gecko/xpcom/threads/nsThreadUtils.cpp:176:57 (libxul.so+0x574b973)
    #6 NS_NewNamedThread<10UL> /workspace/obj-build/dist/include/nsThreadUtils.h:87:10 (libxul.so+0x47f1541)
    #7 void TestMultiWriterQueueMT<DequeWrapperMT>(int, int, int, char const*) /checkouts/gecko/dom/media/doctor/test/gtest/TestMultiWriterQueue.cpp:113:21 (libxul.so+0x47f1541)
    #8 MultiWriterQueue_nsDequeBenchmark_Test::TestBody() /checkouts/gecko/dom/media/doctor/test/gtest/TestMultiWriterQueue.cpp:371:3 (libxul.so+0x47ef4d8)
    #9 void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc (libxul.so+0x428833d)
    #10 testing::Test::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:2688:5 (libxul.so+0x42881a9)
    #11 testing::TestInfo::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:2837:11 (libxul.so+0x4289bb8)
    #12 testing::TestSuite::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:3016:30 (libxul.so+0x428b1b4)
    #13 testing::internal::UnitTestImpl::RunAllTests() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:5922:44 (libxul.so+0x42a8c49)
    #14 testing::Test::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:2688:5 (libxul.so+0x42881a9)
    #15 testing::TestInfo::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:2837:11 (libxul.so+0x4289bb8)
    #16 testing::TestSuite::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:3016:30 (libxul.so+0x428b1b4)
    #17 testing::internal::UnitTestImpl::RunAllTests() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:5922:44 (libxul.so+0x42a8c49)
    #18 testing::Test::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:2688:5 (libxul.so+0x42881a9)
    #19 testing::TestInfo::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:2837:11 (libxul.so+0x4289bb8)
    #20 testing::TestSuite::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:3016:30 (libxul.so+0x428b1b4)
    #21 testing::internal::UnitTestImpl::RunAllTests() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:5922:44 (libxul.so+0x42a8c49)
    #22 bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc (libxul.so+0x42a83ed)
    #23 testing::UnitTest::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:5486:10 (libxul.so+0x42a8190)
    #24 RUN_ALL_TESTS /workspace/obj-build/dist/include/gtest/gtest.h:2319:73 (libxul.so+0x425db1f)
    #25 mozilla::RunGTestFunc(int*, char**) /checkouts/gecko/testing/gtest/mozilla/GTestRunner.cpp:167:10 (libxul.so+0x425db1f)
    #26 XREMain::XRE_mainStartup(bool*) /checkouts/gecko/toolkit/xre/nsAppRunner.cpp:4686:16 (libxul.so+0xc1d6c09)
    #27 XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&) /checkouts/gecko/toolkit/xre/nsAppRunner.cpp:5946:12 (libxul.so+0xc1de932)
    #28 XRE_main(int, char**, mozilla::BootstrapConfig const&) /checkouts/gecko/toolkit/xre/nsAppRunner.cpp:6015:21 (libxul.so+0xc1df071)
    #29 mozilla::BootstrapImpl::XRE_main(int, char**, mozilla::BootstrapConfig const&) /checkouts/gecko/toolkit/xre/Bootstrap.cpp:45:12 (libxul.so+0xc1edf62)
    #30 do_main /checkouts/gecko/browser/app/nsBrowserApp.cpp:227:22 (firefox-bin+0x14ea00)
    #31 main /checkouts/gecko/browser/app/nsBrowserApp.cpp:445:16 (firefox-bin+0x14ea00)
  Thread T141487 'MWQThread' (tid=13946, running) created by main thread at:
    #0 pthread_create /fetches/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1020:3 (firefox-bin+0xc59bb)
    #1 _PR_CreateThread /checkouts/gecko/nsprpub/pr/src/pthreads/ptthread.c:458:14 (libnspr4.so+0x42cee)
    #2 PR_CreateThread /checkouts/gecko/nsprpub/pr/src/pthreads/ptthread.c:533:12 (libnspr4.so+0x37f84)
    #3 nsThread::Init(nsTSubstring<char> const&) /checkouts/gecko/xpcom/threads/nsThread.cpp:620:20 (libxul.so+0x573ac17)
    #4 nsThreadManager::NewNamedThread(nsTSubstring<char> const&, nsIThreadManager::ThreadCreationOptions, nsIThread**) /checkouts/gecko/xpcom/threads/nsThreadManager.cpp:602:22 (libxul.so+0x5742cbd)
    #5 NS_NewNamedThread(nsTSubstring<char> const&, nsIThread**, already_AddRefed<nsIRunnable>, nsIThreadManager::ThreadCreationOptions) /checkouts/gecko/xpcom/threads/nsThreadUtils.cpp:176:57 (libxul.so+0x574b973)
    #6 NS_NewNamedThread<10UL> /workspace/obj-build/dist/include/nsThreadUtils.h:87:10 (libxul.so+0x47f189f)
    #7 void TestMultiWriterQueueMT<DequeWrapperMT>(int, int, int, char const*) /checkouts/gecko/dom/media/doctor/test/gtest/TestMultiWriterQueue.cpp:132:21 (libxul.so+0x47f189f)
    #8 MultiWriterQueue_nsDequeBenchmark_Test::TestBody() /checkouts/gecko/dom/media/doctor/test/gtest/TestMultiWriterQueue.cpp:371:3 (libxul.so+0x47ef4d8)
    #9 void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc (libxul.so+0x428833d)
    #10 testing::Test::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:2688:5 (libxul.so+0x42881a9)
    #11 testing::TestInfo::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:2837:11 (libxul.so+0x4289bb8)
    #12 testing::TestSuite::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:3016:30 (libxul.so+0x428b1b4)
    #13 testing::internal::UnitTestImpl::RunAllTests() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:5922:44 (libxul.so+0x42a8c49)
    #14 testing::Test::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:2688:5 (libxul.so+0x42881a9)
    #15 testing::TestInfo::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:2837:11 (libxul.so+0x4289bb8)
    #16 testing::TestSuite::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:3016:30 (libxul.so+0x428b1b4)
    #17 testing::internal::UnitTestImpl::RunAllTests() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:5922:44 (libxul.so+0x42a8c49)
    #18 testing::Test::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:2688:5 (libxul.so+0x42881a9)
    #19 testing::TestInfo::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:2837:11 (libxul.so+0x4289bb8)
    #20 testing::TestSuite::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:3016:30 (libxul.so+0x428b1b4)
    #21 testing::internal::UnitTestImpl::RunAllTests() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:5922:44 (libxul.so+0x42a8c49)
    #22 bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc (libxul.so+0x42a83ed)
    #23 testing::UnitTest::Run() /checkouts/gecko/third_party/googletest/googletest/src/gtest.cc:5486:10 (libxul.so+0x42a8190)
    #24 RUN_ALL_TESTS /workspace/obj-build/dist/include/gtest/gtest.h:2319:73 (libxul.so+0x425db1f)
    #25 mozilla::RunGTestFunc(int*, char**) /checkouts/gecko/testing/gtest/mozilla/GTestRunner.cpp:167:10 (libxul.so+0x425db1f)
    #26 XREMain::XRE_mainStartup(bool*) /checkouts/gecko/toolkit/xre/nsAppRunner.cpp:4686:16 (libxul.so+0xc1d6c09)
    #27 XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&) /checkouts/gecko/toolkit/xre/nsAppRunner.cpp:5946:12 (libxul.so+0xc1de932)
    #28 XRE_main(int, char**, mozilla::BootstrapConfig const&) /checkouts/gecko/toolkit/xre/nsAppRunner.cpp:6015:21 (libxul.so+0xc1df071)
    #29 mozilla::BootstrapImpl::XRE_main(int, char**, mozilla::BootstrapConfig const&) /checkouts/gecko/toolkit/xre/Bootstrap.cpp:45:12 (libxul.so+0xc1edf62)
    #30 do_main /checkouts/gecko/browser/app/nsBrowserApp.cpp:227:22 (firefox-bin+0x14ea00)
    #31 main /checkouts/gecko/browser/app/nsBrowserApp.cpp:445:16 (firefox-bin+0x14ea00)
SUMMARY: ThreadSanitizer: data race /workspace/obj-build/dist/include/nsDeque.h:59:42 in GetSize

FYI, you'll need to revert the below change to re-enable the test when there's a fix ready.
https://hg.mozilla.org/mozilla-central/diff/8ceeacec0dfd1398a7cc01d1b5a08ae5be835435/dom/media/doctor/test/gtest/moz.build

The media doctor thing isn't a shipping feature.

Severity: -- → S3
You need to log in before you can comment on or make changes to this bug.