New issue
Advanced search Search tips

Issue 845173 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

SnapshotAuraTest.FullScreenWindow racy under tsan

Project Member Reported by thakis@chromium.org, May 21 2018

Issue description

I'm adding snapshot_unittests to the memory bots in https://chromium-review.googlesource.com/c/chromium/src/+/1067167. tsan reports a race in SnapshotAuraTest.FullScreenWindow:

https://logs.chromium.org/v/?s=chromium%2Fbuildbucket%2Fcr-buildbucket.appspot.com%2F8945912105887399840%2F%2B%2Fsteps%2Fsnapshot_unittests__with_patch_%2F0%2Flogs%2FSnapshotAuraTest.FullScreenWindow%2F0

[ RUN      ] SnapshotAuraTest.FullScreenWindow
==================
WARNING: ThreadSanitizer: data race (pid=29816)
  Write of size 4 at 0x7b1c00000ac8 by thread T6 (mutexes: write M585):
    #0 gpu::CommandBufferHelper::GetSpace(int) gpu/command_buffer/client/cmd_buffer_helper.h:126:5 (snapshot_unittests+0xb93c00)
    #1 GetCmdSpace<gpu::gles2::cmds::WaitSyncTokenCHROMIUM> gpu/command_buffer/client/cmd_buffer_helper.h:158:31 (snapshot_unittests+0x1616cba)
    #2 WaitSyncTokenCHROMIUM gpu/command_buffer/client/gles2_cmd_helper_autogen.h:2703 (snapshot_unittests+0x1616cba)
    #3 gpu::gles2::GLES2Implementation::WaitSyncTokenCHROMIUM(signed char const*) gpu/command_buffer/client/gles2_implementation.cc:6046 (snapshot_unittests+0x1616cba)
    #4 gpu::raster::RasterImplementationGLES::WaitSyncTokenCHROMIUM(signed char const*) gpu/command_buffer/client/raster_implementation_gles.cc:109:8 (snapshot_unittests+0xbdb7c9)
    #5 cc::OneCopyRasterBufferProvider::CopyOnWorkerThread(cc::StagingBuffer*, cc::RasterSource const*, gfx::Rect const&, viz::ResourceFormat, gfx::Size const&, gpu::Mailbox const&, unsigned int, bool, bool, gpu::SyncToken const&, gfx::ColorSpace const&) cc/raster/one_copy_raster_buffer_provider.cc:383:7 (snapshot_unittests+0x17a8722)
    #6 cc::OneCopyRasterBufferProvider::PlaybackAndCopyOnWorkerThread(gpu::Mailbox const&, unsigned int, bool, bool, gpu::SyncToken const&, cc::RasterSource const*, gfx::Rect const&, gfx::Rect const&, gfx::AxisTransform2d const&, gfx::Size const&, viz::ResourceFormat, gfx::ColorSpace const&, cc::RasterSource::PlaybackSettings const&, unsigned long, unsigned long) cc/raster/one_copy_raster_buffer_provider.cc:292:44 (snapshot_unittests+0x17a70ef)
    #7 cc::OneCopyRasterBufferProvider::RasterBufferImpl::Playback(cc::RasterSource const*, gfx::Rect const&, gfx::Rect const&, unsigned long, gfx::AxisTransform2d const&, cc::RasterSource::PlaybackSettings const&) cc/raster/one_copy_raster_buffer_provider.cc:117:39 (snapshot_unittests+0x17a6ef8)
    #8 cc::(anonymous namespace)::RasterTaskImpl::RunOnWorkerThread() cc/tiles/tile_manager.cc:125:21 (snapshot_unittests+0x16f832c)
    #9 cc::SingleThreadTaskGraphRunner::RunTaskWithLockAcquired() cc/raster/single_thread_task_graph_runner.cc:154:28 (snapshot_unittests+0x16c4c05)
    #10 cc::SingleThreadTaskGraphRunner::Run() cc/raster/single_thread_task_graph_runner.cc:117:10 (snapshot_unittests+0x16c49af)
    #11 non-virtual thunk to cc::SingleThreadTaskGraphRunner::Run() cc/raster/single_thread_task_graph_runner.cc (snapshot_unittests+0x16c4ecd)
    #12 base::DelegateSimpleThread::Run() base/threading/simple_thread.cc:105:13 (snapshot_unittests+0xda834a)
    #13 base::SimpleThread::ThreadMain() base/threading/simple_thread.cc:81:3 (snapshot_unittests+0xda80d7)
    #14 base::(anonymous namespace)::ThreadFunc(void*) base/threading/platform_thread_posix.cc:76:13 (snapshot_unittests+0xdee018)
  Previous write of size 4 at 0x7b1c00000ac8 by main thread:
    [failed to restore the stack]
  Location is heap block of size 104 at 0x7b1c00000a80 allocated by main thread:
    #0 operator new(unsigned long) /b/build/slave/linux_upload_clang/build/src/third_party/llvm/compiler-rt/lib/tsan/rtl/tsan_new_delete.cc:57:3 (snapshot_unittests+0x6f8859)
    #1 make_unique<gpu::gles2::GLES2CmdHelper, gpu::InProcessCommandBuffer *> buildtools/third_party/libc++/trunk/include/memory:3114:28 (snapshot_unittests+0x1821b60)
    #2 gpu::(anonymous namespace)::GLInProcessContextImpl::Initialize(scoped_refptr<gpu::InProcessCommandBuffer::Service>, scoped_refptr<gl::GLSurface>, bool, unsigned long, gpu::ContextCreationAttribs const&, gpu::SharedMemoryLimits const&, gpu::GpuMemoryBufferManager*, gpu::ImageFactory*, gpu::GpuChannelManagerDelegate*, scoped_refptr<base::SingleThreadTaskRunner>) gpu/ipc/gl_in_process_context.cc:149 (snapshot_unittests+0x1821b60)
    #3 ui::InProcessContextProvider::BindToCurrentThread() ui/compositor/test/in_process_context_provider.cc:99:28 (snapshot_unittests+0x1141134)
    #4 ui::InProcessContextFactory::CreateLayerTreeFrameSink(base::WeakPtr<ui::Compositor>) ui/compositor/test/in_process_context_factory.cc:203:52 (snapshot_unittests+0x113c143)
    #5 ui::Compositor::RequestNewLayerTreeFrameSink() ui/compositor/compositor.cc:593:23 (snapshot_unittests+0x11f1668)
    #6 cc::LayerTreeHost::RequestNewLayerTreeFrameSink() cc/trees/layer_tree_host.cc:474:12 (snapshot_unittests+0x17338cf)
    #7 cc::SingleThreadProxy::RequestNewLayerTreeFrameSink() cc/trees/single_thread_proxy.cc:122:21 (snapshot_unittests+0x1815c61)
    #8 Invoke<void (cc::SingleThreadProxy::*)(), const base::WeakPtr<cc::SingleThreadProxy> &> base/bind_internal.h:447:12 (snapshot_unittests+0x181bec2)
    #9 MakeItSo<void (cc::SingleThreadProxy::*const &)(), const base::WeakPtr<cc::SingleThreadProxy> &> base/bind_internal.h:567 (snapshot_unittests+0x181bec2)
    #10 RunImpl<void (cc::SingleThreadProxy::*const &)(), const std::__1::tuple<base::WeakPtr<cc::SingleThreadProxy> > &, 0> base/bind_internal.h:621 (snapshot_unittests+0x181bec2)
    #11 base::internal::Invoker<base::internal::BindState<void (cc::SingleThreadProxy::*)(), base::WeakPtr<cc::SingleThreadProxy> >, void ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:603 (snapshot_unittests+0x181bec2)
    #12 Run base/callback.h:125:12 (snapshot_unittests+0xbfabb0)
    #13 void base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> >::ForwardRepeating<>() base/cancelable_callback.h:120 (snapshot_unittests+0xbfabb0)
    #14 Invoke<void (base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> >::*)(), const base::WeakPtr<base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> > > &> base/bind_internal.h:447:12 (snapshot_unittests+0xbfacf2)
    #15 MakeItSo<void (base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> >::*const &)(), const base::WeakPtr<base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> > > &> base/bind_internal.h:567 (snapshot_unittests+0xbfacf2)
    #16 RunImpl<void (base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> >::*const &)(), const std::__1::tuple<base::WeakPtr<base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> > > > &, 0> base/bind_internal.h:621 (snapshot_unittests+0xbfacf2)
    #17 base::internal::Invoker<base::internal::BindState<void (base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> >::*)(), base::WeakPtr<base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> > > >, void ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:603 (snapshot_unittests+0xbfacf2)
    #18 Run base/callback.h:96:12 (snapshot_unittests+0xd4e96b)
    #19 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) base/debug/task_annotator.cc:101 (snapshot_unittests+0xd4e96b)
    #20 base::internal::IncomingTaskQueue::RunTask(base::PendingTask*) base/message_loop/incoming_task_queue.cc:124:19 (snapshot_unittests+0xd4b6ce)
    #21 base::MessageLoop::RunTask(base::PendingTask*) base/message_loop/message_loop.cc:319:25 (snapshot_unittests+0xd482a3)
    #22 base::MessageLoop::DeferOrRunPendingTask(base::PendingTask) base/message_loop/message_loop.cc:329:5 (snapshot_unittests+0xd48bbc)
    #23 base::MessageLoop::DoWork() base/message_loop/message_loop.cc:373:16 (snapshot_unittests+0xd48f55)
    #24 base::MessagePumpGlib::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_glib.cc:309:49 (snapshot_unittests+0xd4fc4b)
    #25 base::MessageLoop::Run(bool) base/message_loop/message_loop.cc:271:12 (snapshot_unittests+0xd47997)
    #26 non-virtual thunk to base::MessageLoop::Run(bool) base/message_loop/message_loop.cc (snapshot_unittests+0xd47a84)
    #27 base::RunLoop::Run() base/run_loop.cc:131:14 (snapshot_unittests+0xd70d3f)
    #28 ui::DrawWaiterForTest::WaitImpl(ui::Compositor*) ui/compositor/test/draw_waiter_for_test.cc:37:19 (snapshot_unittests+0x113b103)
    #29 ui::DrawWaiterForTest::WaitForCompositingEnded(ui::Compositor*) ui/compositor/test/draw_waiter_for_test.cc:19:10 (snapshot_unittests+0x113b179)
    #30 WaitForDraw ui/snapshot/snapshot_aura_unittest.cc:129:5 (snapshot_unittests+0x6f967d)
    #31 ui::SnapshotAuraTest_FullScreenWindow_Test::TestBody() ui/snapshot/snapshot_aura_unittest.cc:189 (snapshot_unittests+0x6f967d)
    #32 testing::Test::Run() third_party/googletest/src/googletest/src/gtest.cc (snapshot_unittests+0xccb936)
    #33 testing::TestInfo::Run() third_party/googletest/src/googletest/src/gtest.cc:2667:11 (snapshot_unittests+0xccc4cc)
    #34 testing::TestCase::Run() third_party/googletest/src/googletest/src/gtest.cc:2785:28 (snapshot_unittests+0xcccd56)
    #35 testing::internal::UnitTestImpl::RunAllTests() third_party/googletest/src/googletest/src/gtest.cc:5047:43 (snapshot_unittests+0xcdd2f6)
    #36 testing::UnitTest::Run() third_party/googletest/src/googletest/src/gtest.cc (snapshot_unittests+0xcdcbda)
    #37 RUN_ALL_TESTS third_party/googletest/src/googletest/include/gtest/gtest.h:2329:46 (snapshot_unittests+0xdf4e35)
    #38 base::TestSuite::Run() base/test/test_suite.cc:275 (snapshot_unittests+0xdf4e35)
    #39 Invoke<int (base::TestSuite::*)(), ui::test::CompositorTestSuite *> base/bind_internal.h:447:12 (snapshot_unittests+0x6ff618)
    #40 MakeItSo<int (base::TestSuite::*)(), ui::test::CompositorTestSuite *> base/bind_internal.h:547 (snapshot_unittests+0x6ff618)
    #41 RunImpl<int (base::TestSuite::*)(), std::__1::tuple<base::internal::UnretainedWrapper<ui::test::CompositorTestSuite> >, 0> base/bind_internal.h:621 (snapshot_unittests+0x6ff618)
    #42 base::internal::Invoker<base::internal::BindState<int (base::TestSuite::*)(), base::internal::UnretainedWrapper<ui::test::CompositorTestSuite> >, int ()>::RunOnce(base::internal::BindStateBase*) base/bind_internal.h:589 (snapshot_unittests+0x6ff618)
    #43 Run base/callback.h:96:12 (snapshot_unittests+0xdf8610)
    #44 base::(anonymous namespace)::LaunchUnitTestsInternal(base::OnceCallback<int ()>, unsigned long, int, bool, base::OnceCallback<void ()>) base/test/launcher/unit_test_launcher.cc:225 (snapshot_unittests+0xdf8610)
    #45 base::LaunchUnitTests(int, char**, base::OnceCallback<int ()>) base/test/launcher/unit_test_launcher.cc:576:10 (snapshot_unittests+0xdf8423)
    #46 main ui/snapshot/test/run_all_unittests.cc:17:10 (snapshot_unittests+0x6ff56b)
  Mutex M585 (0x7b4800001938) created at:
    #0 pthread_mutex_init /b/build/slave/linux_upload_clang/build/src/third_party/llvm/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:1184:3 (snapshot_unittests+0x690233)
    #1 base::internal::LockImpl::LockImpl() base/synchronization/lock_impl_posix.cc:72:8 (snapshot_unittests+0xde875b)
    #2 base::Lock::Lock() base/synchronization/lock.cc:15:16 (snapshot_unittests+0xd80bfc)
    #3 ui::InProcessContextProvider::InProcessContextProvider(gpu::ContextCreationAttribs const&, gpu::GpuMemoryBufferManager*, gpu::ImageFactory*, unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) ui/compositor/test/in_process_context_provider.cc:60:27 (snapshot_unittests+0x1140a39)
    #4 ui::InProcessContextProvider::CreateOffscreen(gpu::GpuMemoryBufferManager*, gpu::ImageFactory*, bool) ui/compositor/test/in_process_context_provider.cc:55:14 (snapshot_unittests+0x114087b)
    #5 ui::InProcessContextFactory::CreateLayerTreeFrameSink(base::WeakPtr<ui::Compositor>) ui/compositor/test/in_process_context_factory.cc:201:39 (snapshot_unittests+0x113c0a1)
    #6 ui::Compositor::RequestNewLayerTreeFrameSink() ui/compositor/compositor.cc:593:23 (snapshot_unittests+0x11f1668)
    #7 cc::LayerTreeHost::RequestNewLayerTreeFrameSink() cc/trees/layer_tree_host.cc:474:12 (snapshot_unittests+0x17338cf)
    #8 cc::SingleThreadProxy::RequestNewLayerTreeFrameSink() cc/trees/single_thread_proxy.cc:122:21 (snapshot_unittests+0x1815c61)
    #9 Invoke<void (cc::SingleThreadProxy::*)(), const base::WeakPtr<cc::SingleThreadProxy> &> base/bind_internal.h:447:12 (snapshot_unittests+0x181bec2)
    #10 MakeItSo<void (cc::SingleThreadProxy::*const &)(), const base::WeakPtr<cc::SingleThreadProxy> &> base/bind_internal.h:567 (snapshot_unittests+0x181bec2)
    #11 RunImpl<void (cc::SingleThreadProxy::*const &)(), const std::__1::tuple<base::WeakPtr<cc::SingleThreadProxy> > &, 0> base/bind_internal.h:621 (snapshot_unittests+0x181bec2)
    #12 base::internal::Invoker<base::internal::BindState<void (cc::SingleThreadProxy::*)(), base::WeakPtr<cc::SingleThreadProxy> >, void ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:603 (snapshot_unittests+0x181bec2)
    #13 Run base/callback.h:125:12 (snapshot_unittests+0xbfabb0)
    #14 void base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> >::ForwardRepeating<>() base/cancelable_callback.h:120 (snapshot_unittests+0xbfabb0)
    #15 Invoke<void (base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> >::*)(), const base::WeakPtr<base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> > > &> base/bind_internal.h:447:12 (snapshot_unittests+0xbfacf2)
    #16 MakeItSo<void (base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> >::*const &)(), const base::WeakPtr<base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> > > &> base/bind_internal.h:567 (snapshot_unittests+0xbfacf2)
    #17 RunImpl<void (base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> >::*const &)(), const std::__1::tuple<base::WeakPtr<base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> > > > &, 0> base/bind_internal.h:621 (snapshot_unittests+0xbfacf2)
    #18 base::internal::Invoker<base::internal::BindState<void (base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> >::*)(), base::WeakPtr<base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> > > >, void ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:603 (snapshot_unittests+0xbfacf2)
    #19 Run base/callback.h:96:12 (snapshot_unittests+0xd4e96b)
    #20 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) base/debug/task_annotator.cc:101 (snapshot_unittests+0xd4e96b)
    #21 base::internal::IncomingTaskQueue::RunTask(base::PendingTask*) base/message_loop/incoming_task_queue.cc:124:19 (snapshot_unittests+0xd4b6ce)
    #22 base::MessageLoop::RunTask(base::PendingTask*) base/message_loop/message_loop.cc:319:25 (snapshot_unittests+0xd482a3)
    #23 base::MessageLoop::DeferOrRunPendingTask(base::PendingTask) base/message_loop/message_loop.cc:329:5 (snapshot_unittests+0xd48bbc)
    #24 base::MessageLoop::DoWork() base/message_loop/message_loop.cc:373:16 (snapshot_unittests+0xd48f55)
    #25 base::MessagePumpGlib::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_glib.cc:309:49 (snapshot_unittests+0xd4fc4b)
    #26 base::MessageLoop::Run(bool) base/message_loop/message_loop.cc:271:12 (snapshot_unittests+0xd47997)
    #27 non-virtual thunk to base::MessageLoop::Run(bool) base/message_loop/message_loop.cc (snapshot_unittests+0xd47a84)
    #28 base::RunLoop::Run() base/run_loop.cc:131:14 (snapshot_unittests+0xd70d3f)
    #29 ui::DrawWaiterForTest::WaitImpl(ui::Compositor*) ui/compositor/test/draw_waiter_for_test.cc:37:19 (snapshot_unittests+0x113b103)
    #30 ui::DrawWaiterForTest::WaitForCompositingEnded(ui::Compositor*) ui/compositor/test/draw_waiter_for_test.cc:19:10 (snapshot_unittests+0x113b179)
    #31 WaitForDraw ui/snapshot/snapshot_aura_unittest.cc:129:5 (snapshot_unittests+0x6f967d)
    #32 ui::SnapshotAuraTest_FullScreenWindow_Test::TestBody() ui/snapshot/snapshot_aura_unittest.cc:189 (snapshot_unittests+0x6f967d)
    #33 testing::Test::Run() third_party/googletest/src/googletest/src/gtest.cc (snapshot_unittests+0xccb936)
    #34 testing::TestInfo::Run() third_party/googletest/src/googletest/src/gtest.cc:2667:11 (snapshot_unittests+0xccc4cc)
    #35 testing::TestCase::Run() third_party/googletest/src/googletest/src/gtest.cc:2785:28 (snapshot_unittests+0xcccd56)
    #36 testing::internal::UnitTestImpl::RunAllTests() third_party/googletest/src/googletest/src/gtest.cc:5047:43 (snapshot_unittests+0xcdd2f6)
    #37 testing::UnitTest::Run() third_party/googletest/src/googletest/src/gtest.cc (snapshot_unittests+0xcdcbda)
    #38 RUN_ALL_TESTS third_party/googletest/src/googletest/include/gtest/gtest.h:2329:46 (snapshot_unittests+0xdf4e35)
    #39 base::TestSuite::Run() base/test/test_suite.cc:275 (snapshot_unittests+0xdf4e35)
    #40 Invoke<int (base::TestSuite::*)(), ui::test::CompositorTestSuite *> base/bind_internal.h:447:12 (snapshot_unittests+0x6ff618)
    #41 MakeItSo<int (base::TestSuite::*)(), ui::test::CompositorTestSuite *> base/bind_internal.h:547 (snapshot_unittests+0x6ff618)
    #42 RunImpl<int (base::TestSuite::*)(), std::__1::tuple<base::internal::UnretainedWrapper<ui::test::CompositorTestSuite> >, 0> base/bind_internal.h:621 (snapshot_unittests+0x6ff618)
    #43 base::internal::Invoker<base::internal::BindState<int (base::TestSuite::*)(), base::internal::UnretainedWrapper<ui::test::CompositorTestSuite> >, int ()>::RunOnce(base::internal::BindStateBase*) base/bind_internal.h:589 (snapshot_unittests+0x6ff618)
    #44 Run base/callback.h:96:12 (snapshot_unittests+0xdf8610)
    #45 base::(anonymous namespace)::LaunchUnitTestsInternal(base::OnceCallback<int ()>, unsigned long, int, bool, base::OnceCallback<void ()>) base/test/launcher/unit_test_launcher.cc:225 (snapshot_unittests+0xdf8610)
    #46 base::LaunchUnitTests(int, char**, base::OnceCallback<int ()>) base/test/launcher/unit_test_launcher.cc:576:10 (snapshot_unittests+0xdf8423)
    #47 main ui/snapshot/test/run_all_unittests.cc:17:10 (snapshot_unittests+0x6ff56b)
  Thread T6 'TestTaskGraphRu' (tid=29828, running) created by main thread at:
    #0 pthread_create /b/build/slave/linux_upload_clang/build/src/third_party/llvm/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:965:3 (snapshot_unittests+0x68f125)
    #1 base::(anonymous namespace)::CreateThread(unsigned long, bool, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) base/threading/platform_thread_posix.cc:115:13 (snapshot_unittests+0xdedb16)
    #2 base::PlatformThread::CreateWithPriority(unsigned long, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) base/threading/platform_thread_posix.cc:200:10 (snapshot_unittests+0xded9d5)
    #3 base::SimpleThread::StartAsync() base/threading/simple_thread.cc:52:13 (snapshot_unittests+0xda7da8)
    #4 base::SimpleThread::Start() base/threading/simple_thread.cc:31:3 (snapshot_unittests+0xda7c8e)
    #5 cc::SingleThreadTaskGraphRunner::Start(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, base::SimpleThread::Options const&) cc/raster/single_thread_task_graph_runner.cc:30:12 (snapshot_unittests+0x16c3ae4)
    #6 cc::TestTaskGraphRunner::TestTaskGraphRunner() cc/test/test_task_graph_runner.cc:10:3 (snapshot_unittests+0x1ce5477)
    #7 ui::InProcessContextFactory::InProcessContextFactory(viz::HostFrameSinkManager*, viz::FrameSinkManagerImpl*) ui/compositor/test/in_process_context_factory.cc:153:26 (snapshot_unittests+0x113b43d)
    #8 ui::InitializeContextFactoryForTests(bool, ui::ContextFactory**, ui::ContextFactoryPrivate**) ui/compositor/test/context_factories_for_test.cc:48:28 (snapshot_unittests+0x113ae63)
    #9 ui::SnapshotAuraTest::SetUp() ui/snapshot/snapshot_aura_unittest.cc:105:5 (snapshot_unittests+0x6fbfca)
    #10 testing::Test::Run() third_party/googletest/src/googletest/src/gtest.cc (snapshot_unittests+0xccb80b)
    #11 testing::TestInfo::Run() third_party/googletest/src/googletest/src/gtest.cc:2667:11 (snapshot_unittests+0xccc4cc)
    #12 testing::TestCase::Run() third_party/googletest/src/googletest/src/gtest.cc:2785:28 (snapshot_unittests+0xcccd56)
    #13 testing::internal::UnitTestImpl::RunAllTests() third_party/googletest/src/googletest/src/gtest.cc:5047:43 (snapshot_unittests+0xcdd2f6)
    #14 testing::UnitTest::Run() third_party/googletest/src/googletest/src/gtest.cc (snapshot_unittests+0xcdcbda)
    #15 RUN_ALL_TESTS third_party/googletest/src/googletest/include/gtest/gtest.h:2329:46 (snapshot_unittests+0xdf4e35)
    #16 base::TestSuite::Run() base/test/test_suite.cc:275 (snapshot_unittests+0xdf4e35)
    #17 Invoke<int (base::TestSuite::*)(), ui::test::CompositorTestSuite *> base/bind_internal.h:447:12 (snapshot_unittests+0x6ff618)
    #18 MakeItSo<int (base::TestSuite::*)(), ui::test::CompositorTestSuite *> base/bind_internal.h:547 (snapshot_unittests+0x6ff618)
    #19 RunImpl<int (base::TestSuite::*)(), std::__1::tuple<base::internal::UnretainedWrapper<ui::test::CompositorTestSuite> >, 0> base/bind_internal.h:621 (snapshot_unittests+0x6ff618)
    #20 base::internal::Invoker<base::internal::BindState<int (base::TestSuite::*)(), base::internal::UnretainedWrapper<ui::test::CompositorTestSuite> >, int ()>::RunOnce(base::internal::BindStateBase*) base/bind_internal.h:589 (snapshot_unittests+0x6ff618)
    #21 Run base/callback.h:96:12 (snapshot_unittests+0xdf8610)
    #22 base::(anonymous namespace)::LaunchUnitTestsInternal(base::OnceCallback<int ()>, unsigned long, int, bool, base::OnceCallback<void ()>) base/test/launcher/unit_test_launcher.cc:225 (snapshot_unittests+0xdf8610)
    #23 base::LaunchUnitTests(int, char**, base::OnceCallback<int ()>) base/test/launcher/unit_test_launcher.cc:576:10 (snapshot_unittests+0xdf8423)
    #24 main ui/snapshot/test/run_all_unittests.cc:17:10 (snapshot_unittests+0x6ff56b)
SUMMARY: ThreadSanitizer: data race gpu/command_buffer/client/cmd_buffer_helper.h:126:5 in gpu::CommandBufferHelper::GetSpace(int)


(and some more)
 

Comment 1 by enne@chromium.org, May 21 2018

Cc: danakj@chromium.org sunn...@chromium.org piman@chromium.org

Comment 2 by piman@chromium.org, May 21 2018

Cc: m...@chromium.org
  Previous write of size 4 at 0x7b1c00000ac8 by main thread:
    [failed to restore the stack]

Doh.

Comment 3 by piman@chromium.org, May 21 2018

Cc: ericrk@chromium.org
Owner: piman@chromium.org
Status: Started (was: Untriaged)
Running locally:

  Write of size 1 at 0x7b1c00000c84 by thread T6 (mutexes: write M272):
    #0 gpu::CommandBufferHelper::SetGetBuffer(int, scoped_refptr<gpu::Buffer>) gpu/command_buffer/client/cmd_buffer_helper.cc:122:26 (libgpu.so+0x5f5bc)
    #1 gpu::CommandBufferHelper::AllocateRingBuffer() gpu/command_buffer/client/cmd_buffer_helper.cc:101:3 (libgpu.so+0x5f291)
    #2 gpu::CommandBufferHelper::WaitForAvailableEntries(int) gpu/command_buffer/client/cmd_buffer_helper.cc:284:8 (libgpu.so+0x609ca)
    #3 GetSpace gpu/command_buffer/client/cmd_buffer_helper.h:135:7 (libgles2_implementation.so+0x694bb)
    #4 GetCmdSpace<gpu::gles2::cmds::WaitSyncTokenCHROMIUM> gpu/command_buffer/client/cmd_buffer_helper.h:158 (libgles2_implementation.so+0x694bb)
    #5 gpu::gles2::GLES2CmdHelper::WaitSyncTokenCHROMIUM(int, unsigned long, unsigned long) gpu/command_buffer/client/gles2_cmd_helper_autogen.h:2703 (libgles2_implementation.so+0x694bb)
    #6 gpu::gles2::GLES2Implementation::WaitSyncTokenCHROMIUM(signed char const*) gpu/command_buffer/client/gles2_implementation.cc:6067:12 (libgles2_implementation.so+0x693bc)
    #7 gpu::raster::RasterImplementationGLES::WaitSyncTokenCHROMIUM(signed char const*) gpu/command_buffer/client/raster_implementation_gles.cc:109:8 (libraster.so+0x1e969)
    #8 cc::OneCopyRasterBufferProvider::CopyOnWorkerThread(cc::StagingBuffer*, cc::RasterSource const*, gfx::Rect const&, viz::ResourceFormat, gfx::Size const&, gpu::Mailbox const&, unsigned int, bool, bool, gpu::SyncToken const&, gfx::ColorSpace const&) cc/raster/one_copy_raster_buffer_provider.cc:383:7 (libcc.so+0x130b36)
    #9 cc::OneCopyRasterBufferProvider::PlaybackAndCopyOnWorkerThread(gpu::Mailbox const&, unsigned int, bool, bool, gpu::SyncToken const&, cc::RasterSource const*, gfx::Rect const&, gfx::Rect const&, gfx::AxisTransform2d const&, gfx::Size const&, viz::ResourceFormat, gfx::ColorSpace const&, cc::RasterSource::PlaybackSettings const&, unsigned long, unsigned long) cc/raster/one_copy_raster_buffer_provider.cc:292:44 (libcc.so+0x12fccf)
    #10 cc::OneCopyRasterBufferProvider::RasterBufferImpl::Playback(cc::RasterSource const*, gfx::Rect const&, gfx::Rect const&, unsigned long, gfx::AxisTransform2d const&, cc::RasterSource::PlaybackSettings const&) cc/raster/one_copy_raster_buffer_provider.cc:117:39 (libcc.so+0x12fad8)
    #11 cc::(anonymous namespace)::RasterTaskImpl::RunOnWorkerThread() cc/tiles/tile_manager.cc:125:21 (libcc.so+0x1b6e2f)
    #12 cc::SingleThreadTaskGraphRunner::RunTaskWithLockAcquired() cc/raster/single_thread_task_graph_runner.cc:154:28 (libcc.so+0x135324)
    #13 Run cc/raster/single_thread_task_graph_runner.cc:117:10 (libcc.so+0x1355ef)
    #14 non-virtual thunk to cc::SingleThreadTaskGraphRunner::Run() cc/raster/single_thread_task_graph_runner.cc (libcc.so+0x1355ef)
    #15 base::DelegateSimpleThread::Run() base/threading/simple_thread.cc:105:13 (libbase.so+0x1c90d8)
    #16 base::SimpleThread::ThreadMain() base/threading/simple_thread.cc:81:3 (libbase.so+0x1c8df7)
    #17 base::(anonymous namespace)::ThreadFunc(void*) base/threading/platform_thread_posix.cc:76:13 (libbase.so+0x23a10d)

  Previous write of size 1 at 0x7b1c00000c84 by main thread:
    #0 gpu::CommandBufferHelper::SetGetBuffer(int, scoped_refptr<gpu::Buffer>) gpu/command_buffer/client/cmd_buffer_helper.cc:122:26 (libgpu.so+0x5f5bc)
    #1 gpu::CommandBufferHelper::FreeRingBuffer() gpu/command_buffer/client/cmd_buffer_helper.cc:130:5 (libgpu.so+0x5f6e3)
    #2 gpu::ImplementationBase::FreeEverything() gpu/command_buffer/client/implementation_base.cc:49:12 (libgles2_implementation.so+0x954c4)
    #3 FlushHelper gpu/command_buffer/client/gles2_implementation.cc:1245:5 (libgles2_implementation.so+0x4ac33)
    #4 gpu::gles2::GLES2Implementation::Flush() gpu/command_buffer/client/gles2_implementation.cc:1225 (libgles2_implementation.so+0x4ac33)
    #5 gpu::gles2::GLES2Implementation::SetAggressivelyFreeResources(bool) gpu/command_buffer/client/gles2_implementation.cc:412:5 (libgles2_implementation.so+0x47053)
    #6 non-virtual thunk to gpu::gles2::GLES2Implementation::SetAggressivelyFreeResources(bool) gpu/command_buffer/client/gles2_implementation.cc (libgles2_implementation.so+0x471b4)
    #7 viz::ContextCacheController::OnIdle(unsigned int) components/viz/common/gpu/context_cache_controller.cc:166:21 (libviz_common.so+0x359ca)
    #8 Invoke<void (viz::ContextCacheController::*)(unsigned int), base::WeakPtr<viz::ContextCacheController>, unsigned int> base/bind_internal.h:447:12 (libviz_common.so+0x35cb1)
    #9 MakeItSo<void (viz::ContextCacheController::*)(unsigned int), base::WeakPtr<viz::ContextCacheController>, unsigned int> base/bind_internal.h:567 (libviz_common.so+0x35cb1)
    #10 RunImpl<void (viz::ContextCacheController::*)(unsigned int), std::__1::tuple<base::WeakPtr<viz::ContextCacheController>, unsigned int>, 0, 1> base/bind_internal.h:621 (libviz_common.so+0x35cb1)
    #11 base::internal::Invoker<base::internal::BindState<void (viz::ContextCacheController::*)(unsigned int), base::WeakPtr<viz::ContextCacheController>, unsigned int>, void ()>::RunOnce(base::internal::BindStateBase*) base/bind_internal.h:589 (libviz_common.so+0x35cb1)
    #12 Run base/callback.h:96:12 (libbase.so+0xf789a)
    #13 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) base/debug/task_annotator.cc:101 (libbase.so+0xf789a)
    #14 base::internal::IncomingTaskQueue::RunTask(base::PendingTask*) base/message_loop/incoming_task_queue.cc:124:19 (libbase.so+0x12d62b)
    #15 base::MessageLoop::RunTask(base::PendingTask*) base/message_loop/message_loop.cc:319:25 (libbase.so+0x1312cd)
    #16 DeferOrRunPendingTask base/message_loop/message_loop.cc:329:5 (libbase.so+0x131ee0)
    #17 base::MessageLoop::DoDelayedWork(base::TimeTicks*) base/message_loop/message_loop.cc:413 (libbase.so+0x131ee0)
    #18 base::MessagePumpGlib::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_glib.cc:314:27 (libbase.so+0x134dc2)
    #19 Run base/message_loop/message_loop.cc:271:12 (libbase.so+0x130cf0)
    #20 non-virtual thunk to base::MessageLoop::Run(bool) base/message_loop/message_loop.cc (libbase.so+0x130cf0)
    #21 base::RunLoop::Run() base/run_loop.cc:131:14 (libbase.so+0x1758fa)
    #22 ui::DrawWaiterForTest::WaitImpl(ui::Compositor*) ui/compositor/test/draw_waiter_for_test.cc:37:19 (snapshot_unittests+0x37f863)
    #23 ui::DrawWaiterForTest::WaitForCompositingEnded(ui::Compositor*) ui/compositor/test/draw_waiter_for_test.cc:19:10 (snapshot_unittests+0x37f8d9)
    #24 WaitForDraw ui/snapshot/snapshot_aura_unittest.cc:129:5 (snapshot_unittests+0x31c0f0)
    #25 ui::SnapshotAuraTest_FullScreenWindow_Test::TestBody() ui/snapshot/snapshot_aura_unittest.cc:189 (snapshot_unittests+0x31c0f0)
    #26 testing::Test::Run() third_party/googletest/src/googletest/src/gtest.cc (snapshot_unittests+0x33a366)
    #27 testing::TestInfo::Run() third_party/googletest/src/googletest/src/gtest.cc:2667:11 (snapshot_unittests+0x33aefc)
    #28 testing::TestCase::Run() third_party/googletest/src/googletest/src/gtest.cc:2785:28 (snapshot_unittests+0x33b786)
    #29 testing::internal::UnitTestImpl::RunAllTests() third_party/googletest/src/googletest/src/gtest.cc:5047:43 (snapshot_unittests+0x34bd46)
    #30 testing::UnitTest::Run() third_party/googletest/src/googletest/src/gtest.cc (snapshot_unittests+0x34b62b)
    #31 RUN_ALL_TESTS third_party/googletest/src/googletest/include/gtest/gtest.h:2329:46 (snapshot_unittests+0x364596)
    #32 base::TestSuite::Run() base/test/test_suite.cc:275 (snapshot_unittests+0x364596)
    #33 Invoke<int (base::TestSuite::*)(), ui::test::CompositorTestSuite *> base/bind_internal.h:447:12 (snapshot_unittests+0x322598)
    #34 MakeItSo<int (base::TestSuite::*)(), ui::test::CompositorTestSuite *> base/bind_internal.h:547 (snapshot_unittests+0x322598)
    #35 RunImpl<int (base::TestSuite::*)(), std::__1::tuple<base::internal::UnretainedWrapper<ui::test::CompositorTestSuite> >, 0> base/bind_internal.h:621 (snapshot_unittests+0x322598)
    #36 base::internal::Invoker<base::internal::BindState<int (base::TestSuite::*)(), base::internal::UnretainedWrapper<ui::test::CompositorTestSuite> >, int ()>::RunOnce(base::internal::BindStateBase*) base/bind_internal.h:589 (snapshot_unittests+0x322598)
    #37 Run base/callback.h:96:12 (snapshot_unittests+0x368003)
    #38 base::(anonymous namespace)::LaunchUnitTestsInternal(base::OnceCallback<int ()>, unsigned long, int, bool, base::OnceCallback<void ()>) base/test/launcher/unit_test_launcher.cc:225 (snapshot_unittests+0x368003)
    #39 base::LaunchUnitTests(int, char**, base::OnceCallback<int ()>) base/test/launcher/unit_test_launcher.cc:576:10 (snapshot_unittests+0x367e63)
    #40 main ui/snapshot/test/run_all_unittests.cc:17:10 (snapshot_unittests+0x3224eb)


It looks like the context lock isn't given to the ContextCacheController. Should be an easy fix.

Comment 4 by piman@chromium.org, May 21 2018

Cc: vmi...@chromium.org
https://chromium-review.googlesource.com/c/chromium/src/+/1067537 fixes locally.
Project Member

Comment 5 by bugdroid1@chromium.org, May 21 2018

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

commit d93ee21630e68ca2397327786bbfb22220b7795f
Author: Antoine Labour <piman@chromium.org>
Date: Mon May 21 21:54:42 2018

Correctly set up the context lock in ui::InProcessContextProvider

ContextCacheController needs the context lock, but was not set up in
ui::InProcessContextProvider, causing data races.

Bug:  845173 
Change-Id: Ia9e3ae509efd2aa880f80fde55d92bd835db32b9
Reviewed-on: https://chromium-review.googlesource.com/1067537
Reviewed-by: Victor Miura <vmiura@chromium.org>
Commit-Queue: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560358}
[modify] https://crrev.com/d93ee21630e68ca2397327786bbfb22220b7795f/ui/compositor/test/in_process_context_provider.cc

Comment 6 by thakis@chromium.org, May 21 2018

Awesome, thanks for the quick fix! You probably want to reenable the test as well.

Comment 7 by piman@chromium.org, May 21 2018

Oops, didn't realized it was disabled. https://chromium-review.googlesource.com/c/chromium/src/+/1068033
Project Member

Comment 8 by bugdroid1@chromium.org, May 21 2018

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

commit a9aecd86b8517c10d4c424b5e9b93cf95bff844a
Author: Antoine Labour <piman@chromium.org>
Date: Mon May 21 23:01:47 2018

Reenable SnapshotAuraTest.FullScreenWindow

Bug:  845173 
Change-Id: I1017a04bdfd18ac9e027de332875c24ed5b28bbc
Reviewed-on: https://chromium-review.googlesource.com/1068033
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560390}
[modify] https://crrev.com/a9aecd86b8517c10d4c424b5e9b93cf95bff844a/ui/snapshot/snapshot_aura_unittest.cc

Comment 9 by piman@chromium.org, May 21 2018

Status: Fixed (was: Started)

Sign in to add a comment