New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 1 user

Issue metadata

Status: Available
Owner:
Last visit 19 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment
link

Issue 915200: HeapTest.CrossThreadWeakPersistent, HeapTest.ThreadedStrongification fail under tsan

Reported by thakis@chromium.org, Dec 14 Project Member

Issue description

Splitting this out from issue 831674


[ RUN      ] HeapTest.CrossThreadWeakPersistent
==================
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=6875)
  Cycle in lock order graph: M1741 (0x7b0c000267c0) => M1689 (0x7b0c00026790) => M1741

  Mutex M1689 acquired here while holding mutex M1741 in thread T4:
    #0 pthread_mutex_lock /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_common_interceptors.inc:4097 (blink_heap_unittests+0x179dba4)
    #1 WTF::MutexBase::lock() third_party/blink/renderer/platform/wtf/threading_pthreads.cc:86:16 (blink_heap_unittests+0x521cf99)
    #2 lock third_party/blink/renderer/platform/wtf/threading_primitives.h:98:54 (blink_heap_unittests+0x18a9cf2)
    #3 MutexLocker third_party/blink/renderer/platform/wtf/threading_primitives.h:118 (blink_heap_unittests+0x18a9cf2)
    #4 WakeMainThread third_party/blink/renderer/platform/heap/heap_test.cc:5381 (blink_heap_unittests+0x18a9cf2)
    #5 blink::(anonymous namespace)::WorkerThreadMainForCrossThreadWeakPersistentTest(blink::DestructorLockingObject**) third_party/blink/renderer/platform/heap/heap_test.cc:6371 (blink_heap_unittests+0x18a9cf2)
    #6 Invoke<void (*const &)(blink::DestructorLockingObject **), blink::DestructorLockingObject **> base/bind_internal.h:416:12 (blink_heap_unittests+0x1934e74)
    #7 MakeItSo<void (*const &)(blink::DestructorLockingObject **), blink::DestructorLockingObject **> base/bind_internal.h:616 (blink_heap_unittests+0x1934e74)
    #8 RunImpl<void (*const &)(blink::DestructorLockingObject **), const std::__1::tuple<WTF::CrossThreadUnretainedWrapper<blink::DestructorLockingObject *> > &, 0> base/bind_internal.h:689 (blink_heap_unittests+0x1934e74)
    #9 base::internal::Invoker<base::internal::BindState<void (*)(blink::DestructorLockingObject**), WTF::CrossThreadUnretainedWrapper<blink::DestructorLockingObject*> >, void ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:671 (blink_heap_unittests+0x1934e74)
    #10 Run base/callback.h:140:12 (blink_heap_unittests+0x325cee3)
    #11 Run third_party/blink/renderer/platform/wtf/functional.h:331 (blink_heap_unittests+0x325cee3)
    #12 blink::(anonymous namespace)::RunCrossThreadClosure(WTF::CrossThreadFunction<void ()>) third_party/blink/renderer/platform/scheduler/common/post_cross_thread_task.cc:14 (blink_heap_unittests+0x325cee3)
    #13 Invoke<void (*)(WTF::CrossThreadFunction<void ()>), WTF::CrossThreadFunction<void ()> > base/bind_internal.h:416:12 (blink_heap_unittests+0x325cf50)
    #14 MakeItSo<void (*)(WTF::CrossThreadFunction<void ()>), WTF::CrossThreadFunction<void ()> > base/bind_internal.h:616 (blink_heap_unittests+0x325cf50)
    #15 RunImpl<void (*)(WTF::CrossThreadFunction<void ()>), std::__1::tuple<WTF::CrossThreadFunction<void ()> >, 0> base/bind_internal.h:689 (blink_heap_unittests+0x325cf50)
    #16 base::internal::Invoker<base::internal::BindState<void (*)(WTF::CrossThreadFunction<void ()>), WTF::CrossThreadFunction<void ()> >, void ()>::RunOnce(base::internal::BindStateBase*) base/bind_internal.h:658 (blink_heap_unittests+0x325cf50)
    #17 Run base/callback.h:99:12 (blink_heap_unittests+0x3cd58ef)
    #18 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) base/debug/task_annotator.cc:99 (blink_heap_unittests+0x3cd58ef)
    #19 base::sequence_manager::internal::ThreadControllerImpl::DoWork(base::sequence_manager::internal::ThreadControllerImpl::WorkType) base/task/sequence_manager/thread_controller_impl.cc:209:23 (blink_heap_unittests+0x3d2fe27)
    #20 Invoke<void (base::sequence_manager::internal::ThreadControllerImpl::*)(base::sequence_manager::internal::ThreadControllerImpl::WorkType), const base::WeakPtr<base::sequence_manager::internal::ThreadControllerImpl> &, const base::sequence_manager::internal::ThreadControllerImpl::WorkType &> base/bind_internal.h:516:12 (blink_heap_unittests+0x3d31551)
    #21 MakeItSo<void (base::sequence_manager::internal::ThreadControllerImpl::*const &)(base::sequence_manager::internal::ThreadControllerImpl::WorkType), const base::WeakPtr<base::sequence_manager::internal::ThreadControllerImpl> &, const base::sequence_manager::internal::ThreadControllerImpl::WorkType &> base/bind_internal.h:636 (blink_heap_unittests+0x3d31551)
    #22 RunImpl<void (base::sequence_manager::internal::ThreadControllerImpl::*const &)(base::sequence_manager::internal::ThreadControllerImpl::WorkType), const std::__1::tuple<base::WeakPtr<base::sequence_manager::internal::ThreadControllerImpl>, base::sequence_manager::internal::ThreadControllerImpl::WorkType> &, 0, 1> base/bind_internal.h:689 (blink_heap_unittests+0x3d31551)
    #23 base::internal::Invoker<base::internal::BindState<void (base::sequence_manager::internal::ThreadControllerImpl::*)(base::sequence_manager::internal::ThreadControllerImpl::WorkType), base::WeakPtr<base::sequence_manager::internal::ThreadControllerImpl>, base::sequence_manager::internal::ThreadControllerImpl::WorkType>, void ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:671 (blink_heap_unittests+0x3d31551)
    #24 Run base/callback.h:99:12 (blink_heap_unittests+0x3cd58ef)
    #25 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) base/debug/task_annotator.cc:99 (blink_heap_unittests+0x3cd58ef)
    #26 base::MessageLoopImpl::RunTask(base::PendingTask*) base/message_loop/message_loop_impl.cc:374:46 (blink_heap_unittests+0x3cd4670)
    #27 DeferOrRunPendingTask base/message_loop/message_loop_impl.cc:385:5 (blink_heap_unittests+0x3cd4e6b)
    #28 base::MessageLoopImpl::DoWork() base/message_loop/message_loop_impl.cc:473 (blink_heap_unittests+0x3cd4e6b)
    #29 non-virtual thunk to base::MessageLoopImpl::DoWork() base/message_loop/message_loop_impl.cc (blink_heap_unittests+0x3cd4ead)
    #30 base::MessagePumpDefault::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_default.cc:39:31 (blink_heap_unittests+0x3cd7d41)
    #31 Run base/message_loop/message_loop_impl.cc:326:12 (blink_heap_unittests+0x3cd424f)
    #32 non-virtual thunk to base::MessageLoopImpl::Run(bool) base/message_loop/message_loop_impl.cc (blink_heap_unittests+0x3cd424f)
    #33 base::RunLoop::Run() base/run_loop.cc:102:14 (blink_heap_unittests+0x3cfba1a)
    #34 base::Thread::Run(base::RunLoop*) base/threading/thread.cc:250:13 (blink_heap_unittests+0x3d5fec9)
    #35 base::Thread::ThreadMain() base/threading/thread.cc:332:3 (blink_heap_unittests+0x3d60170)
    #36 base::(anonymous namespace)::ThreadFunc(void*) base/threading/platform_thread_posix.cc:81:13 (blink_heap_unittests+0x3da8094)

  Mutex M1741 previously acquired by the same thread here:
    #0 pthread_mutex_lock /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_common_interceptors.inc:4097 (blink_heap_unittests+0x179dba4)
    #1 WTF::MutexBase::lock() third_party/blink/renderer/platform/wtf/threading_pthreads.cc:86:16 (blink_heap_unittests+0x521cf99)
    #2 lock third_party/blink/renderer/platform/wtf/threading_primitives.h:98:54 (blink_heap_unittests+0x18a9cca)
    #3 MutexLocker third_party/blink/renderer/platform/wtf/threading_primitives.h:118 (blink_heap_unittests+0x18a9cca)
    #4 blink::(anonymous namespace)::WorkerThreadMainForCrossThreadWeakPersistentTest(blink::DestructorLockingObject**) third_party/blink/renderer/platform/heap/heap_test.cc:6368 (blink_heap_unittests+0x18a9cca)
    #5 Invoke<void (*const &)(blink::DestructorLockingObject **), blink::DestructorLockingObject **> base/bind_internal.h:416:12 (blink_heap_unittests+0x1934e74)
    #6 MakeItSo<void (*const &)(blink::DestructorLockingObject **), blink::DestructorLockingObject **> base/bind_internal.h:616 (blink_heap_unittests+0x1934e74)
    #7 RunImpl<void (*const &)(blink::DestructorLockingObject **), const std::__1::tuple<WTF::CrossThreadUnretainedWrapper<blink::DestructorLockingObject *> > &, 0> base/bind_internal.h:689 (blink_heap_unittests+0x1934e74)
    #8 base::internal::Invoker<base::internal::BindState<void (*)(blink::DestructorLockingObject**), WTF::CrossThreadUnretainedWrapper<blink::DestructorLockingObject*> >, void ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:671 (blink_heap_unittests+0x1934e74)
    #9 Run base/callback.h:140:12 (blink_heap_unittests+0x325cee3)
    #10 Run third_party/blink/renderer/platform/wtf/functional.h:331 (blink_heap_unittests+0x325cee3)
    #11 blink::(anonymous namespace)::RunCrossThreadClosure(WTF::CrossThreadFunction<void ()>) third_party/blink/renderer/platform/scheduler/common/post_cross_thread_task.cc:14 (blink_heap_unittests+0x325cee3)
    #12 Invoke<void (*)(WTF::CrossThreadFunction<void ()>), WTF::CrossThreadFunction<void ()> > base/bind_internal.h:416:12 (blink_heap_unittests+0x325cf50)
    #13 MakeItSo<void (*)(WTF::CrossThreadFunction<void ()>), WTF::CrossThreadFunction<void ()> > base/bind_internal.h:616 (blink_heap_unittests+0x325cf50)
    #14 RunImpl<void (*)(WTF::CrossThreadFunction<void ()>), std::__1::tuple<WTF::CrossThreadFunction<void ()> >, 0> base/bind_internal.h:689 (blink_heap_unittests+0x325cf50)
    #15 base::internal::Invoker<base::internal::BindState<void (*)(WTF::CrossThreadFunction<void ()>), WTF::CrossThreadFunction<void ()> >, void ()>::RunOnce(base::internal::BindStateBase*) base/bind_internal.h:658 (blink_heap_unittests+0x325cf50)
    #16 Run base/callback.h:99:12 (blink_heap_unittests+0x3cd58ef)
    #17 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) base/debug/task_annotator.cc:99 (blink_heap_unittests+0x3cd58ef)
    #18 base::sequence_manager::internal::ThreadControllerImpl::DoWork(base::sequence_manager::internal::ThreadControllerImpl::WorkType) base/task/sequence_manager/thread_controller_impl.cc:209:23 (blink_heap_unittests+0x3d2fe27)
    #19 Invoke<void (base::sequence_manager::internal::ThreadControllerImpl::*)(base::sequence_manager::internal::ThreadControllerImpl::WorkType), const base::WeakPtr<base::sequence_manager::internal::ThreadControllerImpl> &, const base::sequence_manager::internal::ThreadControllerImpl::WorkType &> base/bind_internal.h:516:12 (blink_heap_unittests+0x3d31551)
    #20 MakeItSo<void (base::sequence_manager::internal::ThreadControllerImpl::*const &)(base::sequence_manager::internal::ThreadControllerImpl::WorkType), const base::WeakPtr<base::sequence_manager::internal::ThreadControllerImpl> &, const base::sequence_manager::internal::ThreadControllerImpl::WorkType &> base/bind_internal.h:636 (blink_heap_unittests+0x3d31551)
    #21 RunImpl<void (base::sequence_manager::internal::ThreadControllerImpl::*const &)(base::sequence_manager::internal::ThreadControllerImpl::WorkType), const std::__1::tuple<base::WeakPtr<base::sequence_manager::internal::ThreadControllerImpl>, base::sequence_manager::internal::ThreadControllerImpl::WorkType> &, 0, 1> base/bind_internal.h:689 (blink_heap_unittests+0x3d31551)
    #22 base::internal::Invoker<base::internal::BindState<void (base::sequence_manager::internal::ThreadControllerImpl::*)(base::sequence_manager::internal::ThreadControllerImpl::WorkType), base::WeakPtr<base::sequence_manager::internal::ThreadControllerImpl>, base::sequence_manager::internal::ThreadControllerImpl::WorkType>, void ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:671 (blink_heap_unittests+0x3d31551)
    #23 Run base/callback.h:99:12 (blink_heap_unittests+0x3cd58ef)
    #24 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) base/debug/task_annotator.cc:99 (blink_heap_unittests+0x3cd58ef)
    #25 base::MessageLoopImpl::RunTask(base::PendingTask*) base/message_loop/message_loop_impl.cc:374:46 (blink_heap_unittests+0x3cd4670)
    #26 DeferOrRunPendingTask base/message_loop/message_loop_impl.cc:385:5 (blink_heap_unittests+0x3cd4e6b)
    #27 base::MessageLoopImpl::DoWork() base/message_loop/message_loop_impl.cc:473 (blink_heap_unittests+0x3cd4e6b)
    #28 non-virtual thunk to base::MessageLoopImpl::DoWork() base/message_loop/message_loop_impl.cc (blink_heap_unittests+0x3cd4ead)
    #29 base::MessagePumpDefault::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_default.cc:39:31 (blink_heap_unittests+0x3cd7d41)
    #30 Run base/message_loop/message_loop_impl.cc:326:12 (blink_heap_unittests+0x3cd424f)
    #31 non-virtual thunk to base::MessageLoopImpl::Run(bool) base/message_loop/message_loop_impl.cc (blink_heap_unittests+0x3cd424f)
    #32 base::RunLoop::Run() base/run_loop.cc:102:14 (blink_heap_unittests+0x3cfba1a)
    #33 base::Thread::Run(base::RunLoop*) base/threading/thread.cc:250:13 (blink_heap_unittests+0x3d5fec9)
    #34 base::Thread::ThreadMain() base/threading/thread.cc:332:3 (blink_heap_unittests+0x3d60170)
    #35 base::(anonymous namespace)::ThreadFunc(void*) base/threading/platform_thread_posix.cc:81:13 (blink_heap_unittests+0x3da8094)

  Mutex M1741 acquired here while holding mutex M1689 in main thread:
    #0 pthread_mutex_lock /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_common_interceptors.inc:4097 (blink_heap_unittests+0x179dba4)
    #1 WTF::MutexBase::lock() third_party/blink/renderer/platform/wtf/threading_pthreads.cc:86:16 (blink_heap_unittests+0x521cf99)
    #2 lock third_party/blink/renderer/platform/wtf/threading_primitives.h:98:54 (blink_heap_unittests+0x18a9813)
    #3 MutexLocker third_party/blink/renderer/platform/wtf/threading_primitives.h:118 (blink_heap_unittests+0x18a9813)
    #4 WakeWorkerThread third_party/blink/renderer/platform/heap/heap_test.cc:5401 (blink_heap_unittests+0x18a9813)
    #5 blink::HeapTest_CrossThreadWeakPersistent_Test::TestBody() third_party/blink/renderer/platform/heap/heap_test.cc:6417 (blink_heap_unittests+0x18a9813)
    #6 HandleExceptionsInMethodIfSupported<testing::Test, void> third_party/googletest/src/googletest/src/gtest.cc (blink_heap_unittests+0x1b82a8f)
    #7 testing::Test::Run() third_party/googletest/src/googletest/src/gtest.cc:2522 (blink_heap_unittests+0x1b82a8f)
    #8 testing::TestInfo::Run() third_party/googletest/src/googletest/src/gtest.cc:2703:11 (blink_heap_unittests+0x1b83728)
    #9 testing::TestCase::Run() third_party/googletest/src/googletest/src/gtest.cc:2825:28 (blink_heap_unittests+0x1b84056)
    #10 testing::internal::UnitTestImpl::RunAllTests() third_party/googletest/src/googletest/src/gtest.cc:5227:43 (blink_heap_unittests+0x1b94ff6)
    #11 HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> third_party/googletest/src/googletest/src/gtest.cc (blink_heap_unittests+0x1b948d8)
    #12 testing::UnitTest::Run() third_party/googletest/src/googletest/src/gtest.cc:4835 (blink_heap_unittests+0x1b948d8)
    #13 RUN_ALL_TESTS third_party/googletest/src/googletest/include/gtest/gtest.h:2369:46 (blink_heap_unittests+0x3db8615)
    #14 base::TestSuite::Run() base/test/test_suite.cc:294 (blink_heap_unittests+0x3db8615)
    #15 runHelper(base::TestSuite*) third_party/blink/renderer/platform/heap/run_all_tests.cc:49:27 (blink_heap_unittests+0x198defb)
    #16 Invoke<int (*)(base::TestSuite *), base::TestSuite *> base/bind_internal.h:416:12 (blink_heap_unittests+0x198e0b4)
    #17 MakeItSo<int (*)(base::TestSuite *), base::TestSuite *> base/bind_internal.h:616 (blink_heap_unittests+0x198e0b4)
    #18 RunImpl<int (*)(base::TestSuite *), std::__1::tuple<base::internal::UnretainedWrapper<base::TestSuite> >, 0> base/bind_internal.h:689 (blink_heap_unittests+0x198e0b4)
    #19 base::internal::Invoker<base::internal::BindState<int (*)(base::TestSuite*), base::internal::UnretainedWrapper<base::TestSuite> >, int ()>::RunOnce(base::internal::BindStateBase*) base/bind_internal.h:658 (blink_heap_unittests+0x198e0b4)
    #20 Run base/callback.h:99:12 (blink_heap_unittests+0x3dbbead)
    #21 base::(anonymous namespace)::LaunchUnitTestsInternal(base::OnceCallback<int ()>, unsigned long, int, bool, base::OnceCallback<void ()>) base/test/launcher/unit_test_launcher.cc:225 (blink_heap_unittests+0x3dbbead)
    #22 base::LaunchUnitTests(int, char**, base::OnceCallback<int ()>) base/test/launcher/unit_test_launcher.cc:575:10 (blink_heap_unittests+0x3dbbd10)
    #23 main third_party/blink/renderer/platform/heap/run_all_tests.cc:56:10 (blink_heap_unittests+0x198e034)

  Mutex M1689 previously acquired by the same thread here:
    #0 pthread_cond_wait /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:1177 (blink_heap_unittests+0x17a0415)
    #1 WTF::ThreadCondition::Wait() third_party/blink/renderer/platform/wtf/threading_pthreads.cc:158:16 (blink_heap_unittests+0x521d0f6)
    #2 ParkMainThread third_party/blink/renderer/platform/heap/heap_test.cc:5377:25 (blink_heap_unittests+0x18a9525)
    #3 blink::HeapTest_CrossThreadWeakPersistent_Test::TestBody() third_party/blink/renderer/platform/heap/heap_test.cc:6407 (blink_heap_unittests+0x18a9525)
    #4 HandleExceptionsInMethodIfSupported<testing::Test, void> third_party/googletest/src/googletest/src/gtest.cc (blink_heap_unittests+0x1b82a8f)
    #5 testing::Test::Run() third_party/googletest/src/googletest/src/gtest.cc:2522 (blink_heap_unittests+0x1b82a8f)
    #6 testing::TestInfo::Run() third_party/googletest/src/googletest/src/gtest.cc:2703:11 (blink_heap_unittests+0x1b83728)
    #7 testing::TestCase::Run() third_party/googletest/src/googletest/src/gtest.cc:2825:28 (blink_heap_unittests+0x1b84056)
    #8 testing::internal::UnitTestImpl::RunAllTests() third_party/googletest/src/googletest/src/gtest.cc:5227:43 (blink_heap_unittests+0x1b94ff6)
    #9 HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> third_party/googletest/src/googletest/src/gtest.cc (blink_heap_unittests+0x1b948d8)
    #10 testing::UnitTest::Run() third_party/googletest/src/googletest/src/gtest.cc:4835 (blink_heap_unittests+0x1b948d8)
    #11 RUN_ALL_TESTS third_party/googletest/src/googletest/include/gtest/gtest.h:2369:46 (blink_heap_unittests+0x3db8615)
    #12 base::TestSuite::Run() base/test/test_suite.cc:294 (blink_heap_unittests+0x3db8615)
    #13 runHelper(base::TestSuite*) third_party/blink/renderer/platform/heap/run_all_tests.cc:49:27 (blink_heap_unittests+0x198defb)
    #14 Invoke<int (*)(base::TestSuite *), base::TestSuite *> base/bind_internal.h:416:12 (blink_heap_unittests+0x198e0b4)
    #15 MakeItSo<int (*)(base::TestSuite *), base::TestSuite *> base/bind_internal.h:616 (blink_heap_unittests+0x198e0b4)
    #16 RunImpl<int (*)(base::TestSuite *), std::__1::tuple<base::internal::UnretainedWrapper<base::TestSuite> >, 0> base/bind_internal.h:689 (blink_heap_unittests+0x198e0b4)
    #17 base::internal::Invoker<base::internal::BindState<int (*)(base::TestSuite*), base::internal::UnretainedWrapper<base::TestSuite> >, int ()>::RunOnce(base::internal::BindStateBase*) base/bind_internal.h:658 (blink_heap_unittests+0x198e0b4)
    #18 Run base/callback.h:99:12 (blink_heap_unittests+0x3dbbead)
    #19 base::(anonymous namespace)::LaunchUnitTestsInternal(base::OnceCallback<int ()>, unsigned long, int, bool, base::OnceCallback<void ()>) base/test/launcher/unit_test_launcher.cc:225 (blink_heap_unittests+0x3dbbead)
    #20 base::LaunchUnitTests(int, char**, base::OnceCallback<int ()>) base/test/launcher/unit_test_launcher.cc:575:10 (blink_heap_unittests+0x3dbbd10)
    #21 main third_party/blink/renderer/platform/heap/run_all_tests.cc:56:10 (blink_heap_unittests+0x198e034)

  Thread T4 'Test Worker Thread' (tid=6942, running) created by main thread at:
    #0 pthread_create /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:980 (blink_heap_unittests+0x1781256)
    #1 base::(anonymous namespace)::CreateThread(unsigned long, bool, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) base/threading/platform_thread_posix.cc:120:13 (blink_heap_unittests+0x3da7b87)
    #2 base::PlatformThread::CreateWithPriority(unsigned long, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) base/threading/platform_thread_posix.cc:238:10 (blink_heap_unittests+0x3da7a85)
    #3 base::Thread::StartWithOptions(base::Thread::Options const&) base/threading/thread.cc:112:15 (blink_heap_unittests+0x3d5fb7d)
    #4 blink::scheduler::WorkerThread::WorkerThread(blink::ThreadCreationParams const&) third_party/blink/renderer/platform/scheduler/worker/worker_thread.cc:28:27 (blink_heap_unittests+0x329ba3c)
    #5 make_unique<blink::scheduler::WorkerThread, const blink::ThreadCreationParams &> buildtools/third_party/libc++/trunk/include/memory:3118:32 (blink_heap_unittests+0x325ea00)
    #6 blink::Thread::CreateThread(blink::ThreadCreationParams const&) third_party/blink/renderer/platform/scheduler/common/thread.cc:87 (blink_heap_unittests+0x325ea00)
    #7 blink::Platform::CreateThread(blink::ThreadCreationParams const&) third_party/blink/renderer/platform/exported/platform.cc:283:10 (blink_heap_unittests+0x5654030)
    #8 blink::HeapTest_CrossThreadWeakPersistent_Test::TestBody() third_party/blink/renderer/platform/heap/heap_test.cc:6399:64 (blink_heap_unittests+0x18a9410)
    #9 HandleExceptionsInMethodIfSupported<testing::Test, void> third_party/googletest/src/googletest/src/gtest.cc (blink_heap_unittests+0x1b82a8f)
    #10 testing::Test::Run() third_party/googletest/src/googletest/src/gtest.cc:2522 (blink_heap_unittests+0x1b82a8f)
    #11 testing::TestInfo::Run() third_party/googletest/src/googletest/src/gtest.cc:2703:11 (blink_heap_unittests+0x1b83728)
    #12 testing::TestCase::Run() third_party/googletest/src/googletest/src/gtest.cc:2825:28 (blink_heap_unittests+0x1b84056)
    #13 testing::internal::UnitTestImpl::RunAllTests() third_party/googletest/src/googletest/src/gtest.cc:5227:43 (blink_heap_unittests+0x1b94ff6)
    #14 HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> third_party/googletest/src/googletest/src/gtest.cc (blink_heap_unittests+0x1b948d8)
    #15 testing::UnitTest::Run() third_party/googletest/src/googletest/src/gtest.cc:4835 (blink_heap_unittests+0x1b948d8)
    #16 RUN_ALL_TESTS third_party/googletest/src/googletest/include/gtest/gtest.h:2369:46 (blink_heap_unittests+0x3db8615)
    #17 base::TestSuite::Run() base/test/test_suite.cc:294 (blink_heap_unittests+0x3db8615)
    #18 runHelper(base::TestSuite*) third_party/blink/renderer/platform/heap/run_all_tests.cc:49:27 (blink_heap_unittests+0x198defb)
    #19 Invoke<int (*)(base::TestSuite *), base::TestSuite *> base/bind_internal.h:416:12 (blink_heap_unittests+0x198e0b4)
    #20 MakeItSo<int (*)(base::TestSuite *), base::TestSuite *> base/bind_internal.h:616 (blink_heap_unittests+0x198e0b4)
    #21 RunImpl<int (*)(base::TestSuite *), std::__1::tuple<base::internal::UnretainedWrapper<base::TestSuite> >, 0> base/bind_internal.h:689 (blink_heap_unittests+0x198e0b4)
    #22 base::internal::Invoker<base::internal::BindState<int (*)(base::TestSuite*), base::internal::UnretainedWrapper<base::TestSuite> >, int ()>::RunOnce(base::internal::BindStateBase*) base/bind_internal.h:658 (blink_heap_unittests+0x198e0b4)
    #23 Run base/callback.h:99:12 (blink_heap_unittests+0x3dbbead)
    #24 base::(anonymous namespace)::LaunchUnitTestsInternal(base::OnceCallback<int ()>, unsigned long, int, bool, base::OnceCallback<void ()>) base/test/launcher/unit_test_launcher.cc:225 (blink_heap_unittests+0x3dbbead)
    #25 base::LaunchUnitTests(int, char**, base::OnceCallback<int ()>) base/test/launcher/unit_test_launcher.cc:575:10 (blink_heap_unittests+0x3dbbd10)
    #26 main third_party/blink/renderer/platform/heap/run_all_tests.cc:56:10 (blink_heap_unittests+0x198e034)

SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) third_party/blink/renderer/platform/wtf/threading_pthreads.cc:86:16 in WTF::MutexBase::lock()





WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=6865)
  Cycle in lock order graph: M1328 (0x7b0c000269d0) => M1274 (0x7b0c00026a60) => M1328

  Mutex M1274 acquired here while holding mutex M1328 in thread T4:
    #0 pthread_mutex_lock /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_common_interceptors.inc:4097 (blink_heap_unittests+0x179dba4)
    #1 WTF::MutexBase::lock() third_party/blink/renderer/platform/wtf/threading_pthreads.cc:86:16 (blink_heap_unittests+0x521cf99)
    #2 lock third_party/blink/renderer/platform/wtf/threading_primitives.h:98:54 (blink_heap_unittests+0x18c88d4)
    #3 MutexLocker third_party/blink/renderer/platform/wtf/threading_primitives.h:118 (blink_heap_unittests+0x18c88d4)
    #4 WakeMainThread third_party/blink/renderer/platform/heap/heap_test.cc:5381 (blink_heap_unittests+0x18c88d4)
    #5 AllocateCollection third_party/blink/renderer/platform/heap/heap_test.cc:5463 (blink_heap_unittests+0x18c88d4)
    #6 blink::ThreadedStrongificationTester::WorkerThreadMain() third_party/blink/renderer/platform/heap/heap_test.cc:5478 (blink_heap_unittests+0x18c88d4)
    #7 Invoke<void (*const &)()> base/bind_internal.h:416:12 (blink_heap_unittests+0x18c8e7d)
    #8 MakeItSo<void (*const &)()> base/bind_internal.h:616 (blink_heap_unittests+0x18c8e7d)
    #9 RunImpl<void (*const &)(), const std::__1::tuple<> &> base/bind_internal.h:689 (blink_heap_unittests+0x18c8e7d)
    #10 base::internal::Invoker<base::internal::BindState<void (*)()>, void ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:671 (blink_heap_unittests+0x18c8e7d)
    #11 Run base/callback.h:140:12 (blink_heap_unittests+0x325cee3)
    #12 Run third_party/blink/renderer/platform/wtf/functional.h:331 (blink_heap_unittests+0x325cee3)
    #13 blink::(anonymous namespace)::RunCrossThreadClosure(WTF::CrossThreadFunction<void ()>) third_party/blink/renderer/platform/scheduler/common/post_cross_thread_task.cc:14 (blink_heap_unittests+0x325cee3)
    #14 Invoke<void (*)(WTF::CrossThreadFunction<void ()>), WTF::CrossThreadFunction<void ()> > base/bind_internal.h:416:12 (blink_heap_unittests+0x325cf50)
    #15 MakeItSo<void (*)(WTF::CrossThreadFunction<void ()>), WTF::CrossThreadFunction<void ()> > base/bind_internal.h:616 (blink_heap_unittests+0x325cf50)
    #16 RunImpl<void (*)(WTF::CrossThreadFunction<void ()>), std::__1::tuple<WTF::CrossThreadFunction<void ()> >, 0> base/bind_internal.h:689 (blink_heap_unittests+0x325cf50)
    #17 base::internal::Invoker<base::internal::BindState<void (*)(WTF::CrossThreadFunction<void ()>), WTF::CrossThreadFunction<void ()> >, void ()>::RunOnce(base::internal::BindStateBase*) base/bind_internal.h:658 (blink_heap_unittests+0x325cf50)
    #18 Run base/callback.h:99:12 (blink_heap_unittests+0x3cd58ef)
    #19 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) base/debug/task_annotator.cc:99 (blink_heap_unittests+0x3cd58ef)
    #20 base::sequence_manager::internal::ThreadControllerImpl::DoWork(base::sequence_manager::internal::ThreadControllerImpl::WorkType) base/task/sequence_manager/thread_controller_impl.cc:209:23 (blink_heap_unittests+0x3d2fe27)
    #21 Invoke<void (base::sequence_manager::internal::ThreadControllerImpl::*)(base::sequence_manager::internal::ThreadControllerImpl::WorkType), const base::WeakPtr<base::sequence_manager::internal::ThreadControllerImpl> &, const base::sequence_manager::internal::ThreadControllerImpl::WorkType &> base/bind_internal.h:516:12 (blink_heap_unittests+0x3d31551)
    #22 MakeItSo<void (base::sequence_manager::internal::ThreadControllerImpl::*const &)(base::sequence_manager::internal::ThreadControllerImpl::WorkType), const base::WeakPtr<base::sequence_manager::internal::ThreadControllerImpl> &, const base::sequence_manager::internal::ThreadControllerImpl::WorkType &> base/bind_internal.h:636 (blink_heap_unittests+0x3d31551)
    #23 RunImpl<void (base::sequence_manager::internal::ThreadControllerImpl::*const &)(base::sequence_manager::internal::ThreadControllerImpl::WorkType), const std::__1::tuple<base::WeakPtr<base::sequence_manager::internal::ThreadControllerImpl>, base::sequence_manager::internal::ThreadControllerImpl::WorkType> &, 0, 1> base/bind_internal.h:689 (blink_heap_unittests+0x3d31551)
    #24 base::internal::Invoker<base::internal::BindState<void (base::sequence_manager::internal::ThreadControllerImpl::*)(base::sequence_manager::internal::ThreadControllerImpl::WorkType), base::WeakPtr<base::sequence_manager::internal::ThreadControllerImpl>, base::sequence_manager::internal::ThreadControllerImpl::WorkType>, void ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:671 (blink_heap_unittests+0x3d31551)
    #25 Run base/callback.h:99:12 (blink_heap_unittests+0x3cd58ef)
    #26 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) base/debug/task_annotator.cc:99 (blink_heap_unittests+0x3cd58ef)
    #27 base::MessageLoopImpl::RunTask(base::PendingTask*) base/message_loop/message_loop_impl.cc:374:46 (blink_heap_unittests+0x3cd4670)
    #28 DeferOrRunPendingTask base/message_loop/message_loop_impl.cc:385:5 (blink_heap_unittests+0x3cd4e6b)
    #29 base::MessageLoopImpl::DoWork() base/message_loop/message_loop_impl.cc:473 (blink_heap_unittests+0x3cd4e6b)
    #30 non-virtual thunk to base::MessageLoopImpl::DoWork() base/message_loop/message_loop_impl.cc (blink_heap_unittests+0x3cd4ead)
    #31 base::MessagePumpDefault::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_default.cc:39:31 (blink_heap_unittests+0x3cd7d41)
    #32 Run base/message_loop/message_loop_impl.cc:326:12 (blink_heap_unittests+0x3cd424f)
    #33 non-virtual thunk to base::MessageLoopImpl::Run(bool) base/message_loop/message_loop_impl.cc (blink_heap_unittests+0x3cd424f)
    #34 base::RunLoop::Run() base/run_loop.cc:102:14 (blink_heap_unittests+0x3cfba1a)
    #35 base::Thread::Run(base::RunLoop*) base/threading/thread.cc:250:13 (blink_heap_unittests+0x3d5fec9)
    #36 base::Thread::ThreadMain() base/threading/thread.cc:332:3 (blink_heap_unittests+0x3d60170)
    #37 base::(anonymous namespace)::ThreadFunc(void*) base/threading/platform_thread_posix.cc:81:13 (blink_heap_unittests+0x3da8094)

  Mutex M1328 previously acquired by the same thread here:
    #0 pthread_mutex_lock /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_common_interceptors.inc:4097 (blink_heap_unittests+0x179dba4)
    #1 WTF::MutexBase::lock() third_party/blink/renderer/platform/wtf/threading_pthreads.cc:86:16 (blink_heap_unittests+0x521cf99)
    #2 lock third_party/blink/renderer/platform/wtf/threading_primitives.h:98:54 (blink_heap_unittests+0x18c838d)
    #3 MutexLocker third_party/blink/renderer/platform/wtf/threading_primitives.h:118 (blink_heap_unittests+0x18c838d)
    #4 blink::ThreadedStrongificationTester::WorkerThreadMain() third_party/blink/renderer/platform/heap/heap_test.cc:5473 (blink_heap_unittests+0x18c838d)
    #5 Invoke<void (*const &)()> base/bind_internal.h:416:12 (blink_heap_unittests+0x18c8e7d)
    #6 MakeItSo<void (*const &)()> base/bind_internal.h:616 (blink_heap_unittests+0x18c8e7d)
    #7 RunImpl<void (*const &)(), const std::__1::tuple<> &> base/bind_internal.h:689 (blink_heap_unittests+0x18c8e7d)
    #8 base::internal::Invoker<base::internal::BindState<void (*)()>, void ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:671 (blink_heap_unittests+0x18c8e7d)
    #9 Run base/callback.h:140:12 (blink_heap_unittests+0x325cee3)
    #10 Run third_party/blink/renderer/platform/wtf/functional.h:331 (blink_heap_unittests+0x325cee3)
    #11 blink::(anonymous namespace)::RunCrossThreadClosure(WTF::CrossThreadFunction<void ()>) third_party/blink/renderer/platform/scheduler/common/post_cross_thread_task.cc:14 (blink_heap_unittests+0x325cee3)
    #12 Invoke<void (*)(WTF::CrossThreadFunction<void ()>), WTF::CrossThreadFunction<void ()> > base/bind_internal.h:416:12 (blink_heap_unittests+0x325cf50)
    #13 MakeItSo<void (*)(WTF::CrossThreadFunction<void ()>), WTF::CrossThreadFunction<void ()> > base/bind_internal.h:616 (blink_heap_unittests+0x325cf50)
    #14 RunImpl<void (*)(WTF::CrossThreadFunction<void ()>), std::__1::tuple<WTF::CrossThreadFunction<void ()> >, 0> base/bind_internal.h:689 (blink_heap_unittests+0x325cf50)
    #15 base::internal::Invoker<base::internal::BindState<void (*)(WTF::CrossThreadFunction<void ()>), WTF::CrossThreadFunction<void ()> >, void ()>::RunOnce(base::internal::BindStateBase*) base/bind_internal.h:658 (blink_heap_unittests+0x325cf50)
    #16 Run base/callback.h:99:12 (blink_heap_unittests+0x3cd58ef)
    #17 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) base/debug/task_annotator.cc:99 (blink_heap_unittests+0x3cd58ef)
    #18 base::sequence_manager::internal::ThreadControllerImpl::DoWork(base::sequence_manager::internal::ThreadControllerImpl::WorkType) base/task/sequence_manager/thread_controller_impl.cc:209:23 (blink_heap_unittests+0x3d2fe27)
    #19 Invoke<void (base::sequence_manager::internal::ThreadControllerImpl::*)(base::sequence_manager::internal::ThreadControllerImpl::WorkType), const base::WeakPtr<base::sequence_manager::internal::ThreadControllerImpl> &, const base::sequence_manager::internal::ThreadControllerImpl::WorkType &> base/bind_internal.h:516:12 (blink_heap_unittests+0x3d31551)
    #20 MakeItSo<void (base::sequence_manager::internal::ThreadControllerImpl::*const &)(base::sequence_manager::internal::ThreadControllerImpl::WorkType), const base::WeakPtr<base::sequence_manager::internal::ThreadControllerImpl> &, const base::sequence_manager::internal::ThreadControllerImpl::WorkType &> base/bind_internal.h:636 (blink_heap_unittests+0x3d31551)
    #21 RunImpl<void (base::sequence_manager::internal::ThreadControllerImpl::*const &)(base::sequence_manager::internal::ThreadControllerImpl::WorkType), const std::__1::tuple<base::WeakPtr<base::sequence_manager::internal::ThreadControllerImpl>, base::sequence_manager::internal::ThreadControllerImpl::WorkType> &, 0, 1> base/bind_internal.h:689 (blink_heap_unittests+0x3d31551)
    #22 base::internal::Invoker<base::internal::BindState<void (base::sequence_manager::internal::ThreadControllerImpl::*)(base::sequence_manager::internal::ThreadControllerImpl::WorkType), base::WeakPtr<base::sequence_manager::internal::ThreadControllerImpl>, base::sequence_manager::internal::ThreadControllerImpl::WorkType>, void ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:671 (blink_heap_unittests+0x3d31551)
    #23 Run base/callback.h:99:12 (blink_heap_unittests+0x3cd58ef)
    #24 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) base/debug/task_annotator.cc:99 (blink_heap_unittests+0x3cd58ef)
    #25 base::MessageLoopImpl::RunTask(base::PendingTask*) base/message_loop/message_loop_impl.cc:374:46 (blink_heap_unittests+0x3cd4670)
    #26 DeferOrRunPendingTask base/message_loop/message_loop_impl.cc:385:5 (blink_heap_unittests+0x3cd4e6b)
    #27 base::MessageLoopImpl::DoWork() base/message_loop/message_loop_impl.cc:473 (blink_heap_unittests+0x3cd4e6b)
    #28 non-virtual thunk to base::MessageLoopImpl::DoWork() base/message_loop/message_loop_impl.cc (blink_heap_unittests+0x3cd4ead)
    #29 base::MessagePumpDefault::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_default.cc:39:31 (blink_heap_unittests+0x3cd7d41)
    #30 Run base/message_loop/message_loop_impl.cc:326:12 (blink_heap_unittests+0x3cd424f)
    #31 non-virtual thunk to base::MessageLoopImpl::Run(bool) base/message_loop/message_loop_impl.cc (blink_heap_unittests+0x3cd424f)
    #32 base::RunLoop::Run() base/run_loop.cc:102:14 (blink_heap_unittests+0x3cfba1a)
    #33 base::Thread::Run(base::RunLoop*) base/threading/thread.cc:250:13 (blink_heap_unittests+0x3d5fec9)
    #34 base::Thread::ThreadMain() base/threading/thread.cc:332:3 (blink_heap_unittests+0x3d60170)
    #35 base::(anonymous namespace)::ThreadFunc(void*) base/threading/platform_thread_posix.cc:81:13 (blink_heap_unittests+0x3da8094)

  Mutex M1328 acquired here while holding mutex M1274 in main thread:
    #0 pthread_mutex_lock /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_common_interceptors.inc:4097 (blink_heap_unittests+0x179dba4)
    #1 WTF::MutexBase::lock() third_party/blink/renderer/platform/wtf/threading_pthreads.cc:86:16 (blink_heap_unittests+0x521cf99)
    #2 lock third_party/blink/renderer/platform/wtf/threading_primitives.h:98:54 (blink_heap_unittests+0x18a35e3)
    #3 MutexLocker third_party/blink/renderer/platform/wtf/threading_primitives.h:118 (blink_heap_unittests+0x18a35e3)
    #4 WakeWorkerThread third_party/blink/renderer/platform/heap/heap_test.cc:5401 (blink_heap_unittests+0x18a35e3)
    #5 blink::ThreadedStrongificationTester::Test() third_party/blink/renderer/platform/heap/heap_test.cc:5433 (blink_heap_unittests+0x18a35e3)
    #6 blink::HeapTest_ThreadedStrongification_Test::TestBody() third_party/blink/renderer/platform/heap/heap_test.cc:5503:3 (blink_heap_unittests+0x18a3461)
    #7 HandleExceptionsInMethodIfSupported<testing::Test, void> third_party/googletest/src/googletest/src/gtest.cc (blink_heap_unittests+0x1b82a8f)
    #8 testing::Test::Run() third_party/googletest/src/googletest/src/gtest.cc:2522 (blink_heap_unittests+0x1b82a8f)
    #9 testing::TestInfo::Run() third_party/googletest/src/googletest/src/gtest.cc:2703:11 (blink_heap_unittests+0x1b83728)
    #10 testing::TestCase::Run() third_party/googletest/src/googletest/src/gtest.cc:2825:28 (blink_heap_unittests+0x1b84056)
    #11 testing::internal::UnitTestImpl::RunAllTests() third_party/googletest/src/googletest/src/gtest.cc:5227:43 (blink_heap_unittests+0x1b94ff6)
    #12 HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> third_party/googletest/src/googletest/src/gtest.cc (blink_heap_unittests+0x1b948d8)
    #13 testing::UnitTest::Run() third_party/googletest/src/googletest/src/gtest.cc:4835 (blink_heap_unittests+0x1b948d8)
    #14 RUN_ALL_TESTS third_party/googletest/src/googletest/include/gtest/gtest.h:2369:46 (blink_heap_unittests+0x3db8615)
    #15 base::TestSuite::Run() base/test/test_suite.cc:294 (blink_heap_unittests+0x3db8615)
    #16 runHelper(base::TestSuite*) third_party/blink/renderer/platform/heap/run_all_tests.cc:49:27 (blink_heap_unittests+0x198defb)
    #17 Invoke<int (*)(base::TestSuite *), base::TestSuite *> base/bind_internal.h:416:12 (blink_heap_unittests+0x198e0b4)
    #18 MakeItSo<int (*)(base::TestSuite *), base::TestSuite *> base/bind_internal.h:616 (blink_heap_unittests+0x198e0b4)
    #19 RunImpl<int (*)(base::TestSuite *), std::__1::tuple<base::internal::UnretainedWrapper<base::TestSuite> >, 0> base/bind_internal.h:689 (blink_heap_unittests+0x198e0b4)
    #20 base::internal::Invoker<base::internal::BindState<int (*)(base::TestSuite*), base::internal::UnretainedWrapper<base::TestSuite> >, int ()>::RunOnce(base::internal::BindStateBase*) base/bind_internal.h:658 (blink_heap_unittests+0x198e0b4)
    #21 Run base/callback.h:99:12 (blink_heap_unittests+0x3dbbead)
    #22 base::(anonymous namespace)::LaunchUnitTestsInternal(base::OnceCallback<int ()>, unsigned long, int, bool, base::OnceCallback<void ()>) base/test/launcher/unit_test_launcher.cc:225 (blink_heap_unittests+0x3dbbead)
    #23 base::LaunchUnitTests(int, char**, base::OnceCallback<int ()>) base/test/launcher/unit_test_launcher.cc:575:10 (blink_heap_unittests+0x3dbbd10)
    #24 main third_party/blink/renderer/platform/heap/run_all_tests.cc:56:10 (blink_heap_unittests+0x198e034)

  Mutex M1274 previously acquired by the same thread here:
    #0 pthread_cond_wait /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:1177 (blink_heap_unittests+0x17a0415)
    #1 WTF::ThreadCondition::Wait() third_party/blink/renderer/platform/wtf/threading_pthreads.cc:158:16 (blink_heap_unittests+0x521d0f6)
    #2 ParkMainThread third_party/blink/renderer/platform/heap/heap_test.cc:5377:25 (blink_heap_unittests+0x18a35c9)
    #3 blink::ThreadedStrongificationTester::Test() third_party/blink/renderer/platform/heap/heap_test.cc:5420 (blink_heap_unittests+0x18a35c9)
    #4 blink::HeapTest_ThreadedStrongification_Test::TestBody() third_party/blink/renderer/platform/heap/heap_test.cc:5503:3 (blink_heap_unittests+0x18a3461)
    #5 HandleExceptionsInMethodIfSupported<testing::Test, void> third_party/googletest/src/googletest/src/gtest.cc (blink_heap_unittests+0x1b82a8f)
    #6 testing::Test::Run() third_party/googletest/src/googletest/src/gtest.cc:2522 (blink_heap_unittests+0x1b82a8f)
    #7 testing::TestInfo::Run() third_party/googletest/src/googletest/src/gtest.cc:2703:11 (blink_heap_unittests+0x1b83728)
    #8 testing::TestCase::Run() third_party/googletest/src/googletest/src/gtest.cc:2825:28 (blink_heap_unittests+0x1b84056)
    #9 testing::internal::UnitTestImpl::RunAllTests() third_party/googletest/src/googletest/src/gtest.cc:5227:43 (blink_heap_unittests+0x1b94ff6)
    #10 HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> third_party/googletest/src/googletest/src/gtest.cc (blink_heap_unittests+0x1b948d8)
    #11 testing::UnitTest::Run() third_party/googletest/src/googletest/src/gtest.cc:4835 (blink_heap_unittests+0x1b948d8)
    #12 RUN_ALL_TESTS third_party/googletest/src/googletest/include/gtest/gtest.h:2369:46 (blink_heap_unittests+0x3db8615)
    #13 base::TestSuite::Run() base/test/test_suite.cc:294 (blink_heap_unittests+0x3db8615)
    #14 runHelper(base::TestSuite*) third_party/blink/renderer/platform/heap/run_all_tests.cc:49:27 (blink_heap_unittests+0x198defb)
    #15 Invoke<int (*)(base::TestSuite *), base::TestSuite *> base/bind_internal.h:416:12 (blink_heap_unittests+0x198e0b4)
    #16 MakeItSo<int (*)(base::TestSuite *), base::TestSuite *> base/bind_internal.h:616 (blink_heap_unittests+0x198e0b4)
    #17 RunImpl<int (*)(base::TestSuite *), std::__1::tuple<base::internal::UnretainedWrapper<base::TestSuite> >, 0> base/bind_internal.h:689 (blink_heap_unittests+0x198e0b4)
    #18 base::internal::Invoker<base::internal::BindState<int (*)(base::TestSuite*), base::internal::UnretainedWrapper<base::TestSuite> >, int ()>::RunOnce(base::internal::BindStateBase*) base/bind_internal.h:658 (blink_heap_unittests+0x198e0b4)
    #19 Run base/callback.h:99:12 (blink_heap_unittests+0x3dbbead)
    #20 base::(anonymous namespace)::LaunchUnitTestsInternal(base::OnceCallback<int ()>, unsigned long, int, bool, base::OnceCallback<void ()>) base/test/launcher/unit_test_launcher.cc:225 (blink_heap_unittests+0x3dbbead)
    #21 base::LaunchUnitTests(int, char**, base::OnceCallback<int ()>) base/test/launcher/unit_test_launcher.cc:575:10 (blink_heap_unittests+0x3dbbd10)
    #22 main third_party/blink/renderer/platform/heap/run_all_tests.cc:56:10 (blink_heap_unittests+0x198e034)

  Thread T4 'Test Worker Thread' (tid=6961, running) created by main thread at:
    #0 pthread_create /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:980 (blink_heap_unittests+0x1781256)
    #1 base::(anonymous namespace)::CreateThread(unsigned long, bool, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) base/threading/platform_thread_posix.cc:120:13 (blink_heap_unittests+0x3da7b87)
    #2 base::PlatformThread::CreateWithPriority(unsigned long, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) base/threading/platform_thread_posix.cc:238:10 (blink_heap_unittests+0x3da7a85)
    #3 base::Thread::StartWithOptions(base::Thread::Options const&) base/threading/thread.cc:112:15 (blink_heap_unittests+0x3d5fb7d)
    #4 blink::scheduler::WorkerThread::WorkerThread(blink::ThreadCreationParams const&) third_party/blink/renderer/platform/scheduler/worker/worker_thread.cc:28:27 (blink_heap_unittests+0x329ba3c)
    #5 make_unique<blink::scheduler::WorkerThread, const blink::ThreadCreationParams &> buildtools/third_party/libc++/trunk/include/memory:3118:32 (blink_heap_unittests+0x325ea00)
    #6 blink::Thread::CreateThread(blink::ThreadCreationParams const&) third_party/blink/renderer/platform/scheduler/common/thread.cc:87 (blink_heap_unittests+0x325ea00)
    #7 blink::Platform::CreateThread(blink::ThreadCreationParams const&) third_party/blink/renderer/platform/exported/platform.cc:283:10 (blink_heap_unittests+0x5654030)
    #8 blink::ThreadedStrongificationTester::Test() third_party/blink/renderer/platform/heap/heap_test.cc:5411:66 (blink_heap_unittests+0x18a34e1)
    #9 blink::HeapTest_ThreadedStrongification_Test::TestBody() third_party/blink/renderer/platform/heap/heap_test.cc:5503:3 (blink_heap_unittests+0x18a3461)
    #10 HandleExceptionsInMethodIfSupported<testing::Test, void> third_party/googletest/src/googletest/src/gtest.cc (blink_heap_unittests+0x1b82a8f)
    #11 testing::Test::Run() third_party/googletest/src/googletest/src/gtest.cc:2522 (blink_heap_unittests+0x1b82a8f)
    #12 testing::TestInfo::Run() third_party/googletest/src/googletest/src/gtest.cc:2703:11 (blink_heap_unittests+0x1b83728)
    #13 testing::TestCase::Run() third_party/googletest/src/googletest/src/gtest.cc:2825:28 (blink_heap_unittests+0x1b84056)
    #14 testing::internal::UnitTestImpl::RunAllTests() third_party/googletest/src/googletest/src/gtest.cc:5227:43 (blink_heap_unittests+0x1b94ff6)
    #15 HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> third_party/googletest/src/googletest/src/gtest.cc (blink_heap_unittests+0x1b948d8)
    #16 testing::UnitTest::Run() third_party/googletest/src/googletest/src/gtest.cc:4835 (blink_heap_unittests+0x1b948d8)
    #17 RUN_ALL_TESTS third_party/googletest/src/googletest/include/gtest/gtest.h:2369:46 (blink_heap_unittests+0x3db8615)
    #18 base::TestSuite::Run() base/test/test_suite.cc:294 (blink_heap_unittests+0x3db8615)
    #19 runHelper(base::TestSuite*) third_party/blink/renderer/platform/heap/run_all_tests.cc:49:27 (blink_heap_unittests+0x198defb)
    #20 Invoke<int (*)(base::TestSuite *), base::TestSuite *> base/bind_internal.h:416:12 (blink_heap_unittests+0x198e0b4)
    #21 MakeItSo<int (*)(base::TestSuite *), base::TestSuite *> base/bind_internal.h:616 (blink_heap_unittests+0x198e0b4)
    #22 RunImpl<int (*)(base::TestSuite *), std::__1::tuple<base::internal::UnretainedWrapper<base::TestSuite> >, 0> base/bind_internal.h:689 (blink_heap_unittests+0x198e0b4)
    #23 base::internal::Invoker<base::internal::BindState<int (*)(base::TestSuite*), base::internal::UnretainedWrapper<base::TestSuite> >, int ()>::RunOnce(base::internal::BindStateBase*) base/bind_internal.h:658 (blink_heap_unittests+0x198e0b4)
    #24 Run base/callback.h:99:12 (blink_heap_unittests+0x3dbbead)
    #25 base::(anonymous namespace)::LaunchUnitTestsInternal(base::OnceCallback<int ()>, unsigned long, int, bool, base::OnceCallback<void ()>) base/test/launcher/unit_test_launcher.cc:225 (blink_heap_unittests+0x3dbbead)
    #26 base::LaunchUnitTests(int, char**, base::OnceCallback<int ()>) base/test/launcher/unit_test_launcher.cc:575:10 (blink_heap_unittests+0x3dbbd10)
    #27 main third_party/blink/renderer/platform/heap/run_all_tests.cc:56:10 (blink_heap_unittests+0x198e034)

SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) third_party/blink/renderer/platform/wtf/threading_pthreads.cc:86:16 in WTF::MutexBase::lock()
 

Comment 1 by bugdroid1@chromium.org, Dec 14

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f8ab18bbd3fa087a3fdd0eb76353eca1a8ffa441

commit f8ab18bbd3fa087a3fdd0eb76353eca1a8ffa441
Author: Nico Weber <thakis@chromium.org>
Date: Fri Dec 14 13:32:59 2018

Disable the two blink_heap_unittests that fail under tsan and run suite on tsan bot.

Disables HeapTest.CrossThreadWeakPersistent and HeapTest.ThreadedStrongification
under TSan.

Bug: 843511,915200,831674, 913704 
Change-Id: I6ab71b83fa937f739a57452a97bd43ef6375bf2c
Reviewed-on: https://chromium-review.googlesource.com/c/1377517
Reviewed-by: Hans Wennborg <hans@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616652}
[modify] https://crrev.com/f8ab18bbd3fa087a3fdd0eb76353eca1a8ffa441/testing/buildbot/chromium.memory.json
[modify] https://crrev.com/f8ab18bbd3fa087a3fdd0eb76353eca1a8ffa441/testing/buildbot/test_suite_exceptions.pyl
[modify] https://crrev.com/f8ab18bbd3fa087a3fdd0eb76353eca1a8ffa441/third_party/blink/renderer/platform/heap/heap_test.cc

Comment 2 by mlippautz@chromium.org, Dec 14

Cc: mlippautz@chromium.org
Status: Assigned (was: Untriaged)
Keishi, can you have a look whether this is actionable. 

Lock-inversion could be dangerous.

Comment 3 by keishi@google.com, Dec 17

Status: WontFix (was: Assigned)
I stepped through the code but I think a dead lock would never happen because the threads get synchronized at ThreadConditions.
CrossThreadWeakPersistentTest.pdf
31.9 KB Download

Comment 4 by mlippautz@google.com, Dec 18

Can you elaborate a bit.

If I interpret your pdf correctly, then we need MTM.lock() before sending the signal. However, MTM is already locked by the main thread in this case.

We redesigned (with significant effort) all locks in V8's GC so that we don't have order inversions as they almost always are real issues.

Comment 5 by keishi@google.com, Dec 20

I don't have experience using condition variables so I am not confident, but assuming the code gets synchronize at the black lines (wait/signal), It looks like we guarantee that unlock will be called.

You're probably right that this is doing something wrong so I've created a CL to simplify the code to only use one mutex
https://chromium-review.googlesource.com/c/chromium/src/+/1384384

Comment 6 by bugdroid1@chromium.org, Dec 22

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/dc3fde2e427aa046fd4f0a7a16f8fd72b9c6a96b

commit dc3fde2e427aa046fd4f0a7a16f8fd72b9c6a96b
Author: Keishi Hattori <keishi@chromium.org>
Date: Sat Dec 22 15:50:52 2018

Oilpan: Replace Main/WorkerThreadMutex with one ActiveThreadMutex

TSAN reported lock-order-inversion because we were using two mutexes. Simplify the code to use just one.

Bug: 915200
Change-Id: I5dbda4ca21cd4f5fa95ecb1c9b51922262798169
Reviewed-on: https://chromium-review.googlesource.com/c/1384384
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#618754}
[modify] https://crrev.com/dc3fde2e427aa046fd4f0a7a16f8fd72b9c6a96b/third_party/blink/renderer/platform/heap/BUILD.gn
[modify] https://crrev.com/dc3fde2e427aa046fd4f0a7a16f8fd72b9c6a96b/third_party/blink/renderer/platform/heap/heap_test.cc
[add] https://crrev.com/dc3fde2e427aa046fd4f0a7a16f8fd72b9c6a96b/third_party/blink/renderer/platform/heap/heap_thread_test.cc

Comment 7 by bugdroid1@chromium.org, Dec 24

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/15a84b7dc0b8e783f0cec043b5eaed3b212073f8

commit 15a84b7dc0b8e783f0cec043b5eaed3b212073f8
Author: Avi Drissman <avi@chromium.org>
Date: Mon Dec 24 18:18:56 2018

Revert "Oilpan: Replace Main/WorkerThreadMutex with one ActiveThreadMutex"

This reverts commit dc3fde2e427aa046fd4f0a7a16f8fd72b9c6a96b.

Reason for revert: fast/js/try-catch-crash.html is burning on WebKit Linux Trusty MSAN; this is a suspect

Original change's description:
> Oilpan: Replace Main/WorkerThreadMutex with one ActiveThreadMutex
> 
> TSAN reported lock-order-inversion because we were using two mutexes. Simplify the code to use just one.
> 
> Bug: 915200
> Change-Id: I5dbda4ca21cd4f5fa95ecb1c9b51922262798169
> Reviewed-on: https://chromium-review.googlesource.com/c/1384384
> Commit-Queue: Keishi Hattori <keishi@chromium.org>
> Reviewed-by: Kentaro Hara <haraken@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#618754}

TBR=haraken@chromium.org,keishi@chromium.org,mlippautz@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 915200
Change-Id: If4be6a8156292d27790a7f12a62f2d559c730236
Reviewed-on: https://chromium-review.googlesource.com/c/1390426
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#618828}
[modify] https://crrev.com/15a84b7dc0b8e783f0cec043b5eaed3b212073f8/third_party/blink/renderer/platform/heap/BUILD.gn
[modify] https://crrev.com/15a84b7dc0b8e783f0cec043b5eaed3b212073f8/third_party/blink/renderer/platform/heap/heap_test.cc
[delete] https://crrev.com/04bcefe63df561cc11c563e21ef7b15d79204be6/third_party/blink/renderer/platform/heap/heap_thread_test.cc

Comment 8 by avi@google.com, Dec 24

Status: Available (was: WontFix)
This... doesn't seem to have helped.

https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/WebKit%20Linux%20Trusty%20MSAN/11705

Sorry, feel free to re-land.

Comment 9 by avi@google.com, Dec 24

I've confirmed the issue was with the v8 roll (see  bug 917714 ). I'll reland it for you.

Comment 10 by bugdroid1@chromium.org, Dec 24

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/eae7e77a64f007fd05b8362f884ee3ea78f3f40e

commit eae7e77a64f007fd05b8362f884ee3ea78f3f40e
Author: Avi Drissman <avi@chromium.org>
Date: Mon Dec 24 23:17:04 2018

Reland "Oilpan: Replace Main/WorkerThreadMutex with one ActiveThreadMutex"

This reverts commit 15a84b7dc0b8e783f0cec043b5eaed3b212073f8.

Reason for revert: This turns out to not be the reason for the failure; relanding.

Original change's description:
> Revert "Oilpan: Replace Main/WorkerThreadMutex with one ActiveThreadMutex"
> 
> This reverts commit dc3fde2e427aa046fd4f0a7a16f8fd72b9c6a96b.
> 
> Reason for revert: fast/js/try-catch-crash.html is burning on WebKit Linux Trusty MSAN; this is a suspect
> 
> Original change's description:
> > Oilpan: Replace Main/WorkerThreadMutex with one ActiveThreadMutex
> > 
> > TSAN reported lock-order-inversion because we were using two mutexes. Simplify the code to use just one.
> > 
> > Bug: 915200
> > Change-Id: I5dbda4ca21cd4f5fa95ecb1c9b51922262798169
> > Reviewed-on: https://chromium-review.googlesource.com/c/1384384
> > Commit-Queue: Keishi Hattori <keishi@chromium.org>
> > Reviewed-by: Kentaro Hara <haraken@chromium.org>
> > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#618754}
> 
> TBR=haraken@chromium.org,keishi@chromium.org,mlippautz@chromium.org
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Bug: 915200
> Change-Id: If4be6a8156292d27790a7f12a62f2d559c730236
> Reviewed-on: https://chromium-review.googlesource.com/c/1390426
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Commit-Queue: Avi Drissman <avi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#618828}

TBR=avi@chromium.org,haraken@chromium.org,keishi@chromium.org,mlippautz@chromium.org

Change-Id: Iab67bab6c66d0ac8feb9cdafe9e814497142bf3c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 915200
Reviewed-on: https://chromium-review.googlesource.com/c/1390434
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#618845}
[modify] https://crrev.com/eae7e77a64f007fd05b8362f884ee3ea78f3f40e/third_party/blink/renderer/platform/heap/BUILD.gn
[modify] https://crrev.com/eae7e77a64f007fd05b8362f884ee3ea78f3f40e/third_party/blink/renderer/platform/heap/heap_test.cc
[add] https://crrev.com/eae7e77a64f007fd05b8362f884ee3ea78f3f40e/third_party/blink/renderer/platform/heap/heap_thread_test.cc

Sign in to add a comment