Status: Assigned
Owner:
dmaz...@chromium.orgCC:
davi...@chromium.org,
chromium-ac...@chromium.org Labels: Stability-ThreadSanitizer Team-Accessibility
Pri: 1
Type: Bug
New issue 946481 by
gli...@google.com: TSan reports data races on command line in content::DumpAccessibilityTestBase
https://bugs.chromium.org/p/chromium/issues/detail?id=946481According to buildbot logs from
https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8917832371169415328/+/steps/content_browsertests/0/stdout, there're races on the command line in content::DumpAccessibilityTestBase:
==================
WARNING: ThreadSanitizer: data race (pid=23872)
Write of size 8 at 0x7b100001c3a0 by main thread:
#0 memset /b/swarming/w/ir/k/src/third_party/llvm/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_common_interceptors.inc:773:3 (content_browsertests+0x2579f92)
#1 __detach buildtools/third_party/libc++/trunk/include/__tree:1563:12 (content_browsertests+0x65fc46c)
#2 void std::__1::__tree<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::__map_value_compare<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::less<void>, true>, std::__1::allocator<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >::__assign_multi<std::__1::__tree_const_iterator<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::__tree_node<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, void*>*, long> >(std::__1::__tree_const_iterator<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::__tree_node<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, void*>*, long>, std::__1::__tree_const_iterator<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::__tree_node<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, void*>*, long>) buildtools/third_party/libc++/trunk/include/__tree:1669 (content_browsertests+0x65fc46c)
#3 operator= buildtools/third_party/libc++/trunk/include/__tree:1606:9 (content_browsertests+0x65f9a9d)
#4 operator= buildtools/third_party/libc++/trunk/include/map:1015 (content_browsertests+0x65f9a9d)
#5 base::CommandLine::operator=(base::CommandLine const&) base/command_line.cc:182 (content_browsertests+0x65f9a9d)
#6 base::test::ScopedCommandLine::~ScopedCommandLine() base/test/scoped_command_line.cc:14:43 (content_browsertests+0x60ca431)
#7 content::DumpAccessibilityTestBase::RunTestForPlatform(base::FilePath, char const*) content/browser/accessibility/dump_accessibility_browsertest_base.cc:449:1 (content_browsertests+0x260a9bb)
#8 content::DumpAccessibilityTestBase::RunTest(base::FilePath, char const*) content/browser/accessibility/dump_accessibility_browsertest_base.cc:210:5 (content_browsertests+0x2608a88)
#9 content::DumpAccessibilityEventsTest::RunEventTest(char const*) content/browser/accessibility/dump_accessibility_events_browsertest.cc:206:3 (content_browsertests+0x260ca98)
#10 content::DumpAccessibilityEventsTest_AccessibilityEventsAddChildOfBody_Test::RunTestOnMainThread() content/browser/accessibility/dump_accessibility_events_browsertest.cc:298:3 (content_browsertests+0x260ce40)
#11 content::BrowserTestBase::ProxyRunTestOnMainThreadLoop() content/public/test/browser_test_base.cc:435:5 (content_browsertests+0x60767f3)
#12 Invoke<void (content::BrowserTestBase::*)(), content::BrowserTestBase *> base/bind_internal.h:499:12 (content_browsertests+0x6077a68)
#13 MakeItSo<void (content::BrowserTestBase::*const &)(), content::BrowserTestBase *> base/bind_internal.h:599 (content_browsertests+0x6077a68)
#14 RunImpl<void (content::BrowserTestBase::*const &)(), const std::__1::tuple<base::internal::UnretainedWrapper<content::BrowserTestBase> > &, 0> base/bind_internal.h:672 (content_browsertests+0x6077a68)
#15 base::internal::Invoker<base::internal::BindState<void (content::BrowserTestBase::*)(), base::internal::UnretainedWrapper<content::BrowserTestBase> >, void ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:654 (content_browsertests+0x6077a68)
#16 Run base/callback.h:136:12 (content_browsertests+0x610dc8d)
#17 content::ShellBrowserMainParts::PreMainMessageLoopRun() content/shell/browser/shell_browser_main_parts.cc:174 (content_browsertests+0x610dc8d)
#18 content::BrowserMainLoop::PreMainMessageLoopRun() content/browser/browser_main_loop.cc:977:13 (content_browsertests+0x55c6145)
#19 Invoke<int (content::BrowserMainLoop::*)(), content::BrowserMainLoop *> base/bind_internal.h:499:12 (content_browsertests+0x55c8b78)
#20 MakeItSo<int (content::BrowserMainLoop::*const &)(), content::BrowserMainLoop *> base/bind_internal.h:599 (content_browsertests+0x55c8b78)
#21 RunImpl<int (content::BrowserMainLoop::*const &)(), const std::__1::tuple<base::internal::UnretainedWrapper<content::BrowserMainLoop> > &, 0> base/bind_internal.h:672 (content_browsertests+0x55c8b78)
#22 base::internal::Invoker<base::internal::BindState<int (content::BrowserMainLoop::*)(), base::internal::UnretainedWrapper<content::BrowserMainLoop> >, int ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:654 (content_browsertests+0x55c8b78)
#23 Run base/callback.h:136:12 (content_browsertests+0x5c557be)
#24 content::StartupTaskRunner::RunAllTasksNow() content/browser/startup_task_runner.cc:41 (content_browsertests+0x5c557be)
#25 content::BrowserMainLoop::CreateStartupTasks() content/browser/browser_main_loop.cc:908:25 (content_browsertests+0x55c4874)
#26 content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&) content/browser/browser_main_runner_impl.cc:144:15 (content_browsertests+0x55c9362)
#27 ShellBrowserMain(content::MainFunctionParams const&, std::__1::unique_ptr<content::BrowserMainRunner, std::__1::default_delete<content::BrowserMainRunner> > const&) content/shell/browser/shell_browser_main.cc:22:32 (content_browsertests+0x6108a97)
#28 content::ShellMainDelegate::RunProcess(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, content::MainFunctionParams const&) content/shell/app/shell_main_delegate.cc:374:16 (content_browsertests+0x60fd9ae)
#29 RunBrowserProcessMain content/app/content_main_runner_impl.cc:545:29 (content_browsertests+0x542a212)
#30 content::ContentMainRunnerImpl::RunServiceManager(content::MainFunctionParams&, bool) content/app/content_main_runner_impl.cc:982 (content_browsertests+0x542a212)
#31 content::ContentMainRunnerImpl::Run(bool) content/app/content_main_runner_impl.cc:878:12 (content_browsertests+0x5429cb8)
#32 content::ContentServiceManagerMainDelegate::RunEmbedderProcess() content/app/content_service_manager_main_delegate.cc:52:32 (content_browsertests+0x41d9aef)
#33 service_manager::Main(service_manager::MainParams const&) services/service_manager/embedder/main.cc:415:29 (content_browsertests+0x88ccfc6)
#34 content::ContentMain(content::ContentMainParams const&) content/app/content_main.cc:19:10 (content_browsertests+0x41da27b)
#35 content::BrowserTestBase::SetUp() content/public/test/browser_test_base.cc:348:3 (content_browsertests+0x6076335)
#36 content::ContentBrowserTest::SetUp() content/public/test/content_browser_test.cc:106:20 (content_browsertests+0x6065ac0)
#37 content::DumpAccessibilityTestBase::SetUp() content/browser/accessibility/dump_accessibility_browsertest_base.cc:110:23 (content_browsertests+0x26075ac)
#38 HandleExceptionsInMethodIfSupported<testing::Test, void> third_party/googletest/src/googletest/src/gtest.cc (content_browsertests+0x3f03112)
#39 testing::Test::Run() third_party/googletest/src/googletest/src/gtest.cc:2494 (content_browsertests+0x3f03112)
#40 testing::TestInfo::Run() third_party/googletest/src/googletest/src/gtest.cc:2675:11 (content_browsertests+0x3f044b8)
#41 testing::TestSuite::Run() third_party/googletest/src/googletest/src/gtest.cc:2805:28 (content_browsertests+0x3f05096)
#42 testing::internal::UnitTestImpl::RunAllTests() third_party/googletest/src/googletest/src/gtest.cc:5243:44 (content_browsertests+0x3f16916)
#43 HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> third_party/googletest/src/googletest/src/gtest.cc (content_browsertests+0x3f160f9)
#44 testing::UnitTest::Run() third_party/googletest/src/googletest/src/gtest.cc:4845 (content_browsertests+0x3f160f9)
#45 RUN_ALL_TESTS third_party/googletest/src/googletest/include/gtest/gtest.h:2469:46 (content_browsertests+0x60cf832)
#46 base::TestSuite::Run() base/test/test_suite.cc:316 (content_browsertests+0x60cf832)
#47 content::ContentTestLauncherDelegate::RunTestSuite(int, char**) content/test/content_test_launcher.cc:110:48 (content_browsertests+0x606ceb4)
#48 content::LaunchTests(content::TestLauncherDelegate*, unsigned long, int, char**) content/public/test/test_launcher.cc:658:31 (content_browsertests+0x60a51b4)
#49 main content/test/content_test_launcher.cc:140:10 (content_browsertests+0x606ce3d)
Previous read of size 8 at 0x7b100001c3a0 by thread T4:
#0 __root buildtools/third_party/libc++/trunk/include/__tree:1082:59 (content_browsertests+0x65fcb1b)
#1 std::__1::__tree_const_iterator<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::__tree_node<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, void*>*, long> std::__1::__tree<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::__map_value_compare<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::less<void>, true>, std::__1::allocator<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >::find<base::BasicStringPiece<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >(base::BasicStringPiece<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) const buildtools/third_party/libc++/trunk/include/__tree:2616 (content_browsertests+0x65fcb1b)
#2 find<base::BasicStringPiece<std::string> > buildtools/third_party/libc++/trunk/include/map:1385:68 (content_browsertests+0x65fa19f)
#3 ContainsKey<std::__1::map<std::__1::basic_string<char>, std::__1::basic_string<char>, std::__1::less<void>, std::__1::allocator<std::__1::pair<const std::__1::basic_string<char>, std::__1::basic_string<char> > > >, base::BasicStringPiece<std::string> > base/stl_util.h:141 (content_browsertests+0x65fa19f)
#4 HasSwitch base/command_line.cc:289 (content_browsertests+0x65fa19f)
#5 base::CommandLine::HasSwitch(char const*) const base/command_line.cc:293 (content_browsertests+0x65fa19f)
#6 base::GetShmemTempDir(bool, base::FilePath*) base/files/file_util_posix.cc:1003:55 (content_browsertests+0x670a750)
#7 base::subtle::PlatformSharedMemoryRegion::Create(base::subtle::PlatformSharedMemoryRegion::Mode, unsigned long) base/memory/platform_shared_memory_region_posix.cc:227:8 (content_browsertests+0x671e18e)
#8 base::subtle::PlatformSharedMemoryRegion::CreateUnsafe(unsigned long) base/memory/platform_shared_memory_region.cc:22:10 (content_browsertests+0x6625735)
#9 base::UnsafeSharedMemoryRegion::Create(unsigned long) base/memory/unsafe_shared_memory_region.cc:16:7 (content_browsertests+0x662843d)
#10 gpu::GpuMemoryBufferImplSharedMemory::CreateGpuMemoryBuffer(gfx::GenericSharedMemoryId, gfx::Size const&, gfx::BufferFormat, gfx::BufferUsage) gpu/ipc/common/gpu_memory_buffer_impl_shared_memory.cc:84:7 (content_browsertests+0x3c806f8)
#11 viz::HostGpuMemoryBufferManager::AllocateGpuMemoryBuffer(gfx::GenericSharedMemoryId, int, gfx::Size const&, gfx::BufferFormat, gfx::BufferUsage, unsigned long, base::OnceCallback<void (gfx::GpuMemoryBufferHandle)>) components/viz/host/host_gpu_memory_buffer_manager.cc:154:21 (content_browsertests+0x8438ca4)
#12 Invoke<void (viz::HostGpuMemoryBufferManager::*)(gfx::GenericSharedMemoryId, int, const gfx::Size &, gfx::BufferFormat, gfx::BufferUsage, unsigned long, base::OnceCallback<void (gfx::GpuMemoryBufferHandle)>), viz::HostGpuMemoryBufferManager *, gfx::GenericSharedMemoryId, int, gfx::Size, gfx::BufferFormat, gfx::BufferUsage, unsigned long, base::OnceCallback<void (gfx::GpuMemoryBufferHandle)> > base/bind_internal.h:499:12 (content_browsertests+0x843d478)
#13 MakeItSo<void (viz::HostGpuMemoryBufferManager::*)(gfx::GenericSharedMemoryId, int, const gfx::Size &, gfx::BufferFormat, gfx::BufferUsage, unsigned long, base::OnceCallback<void (gfx::GpuMemoryBufferHandle)>), viz::HostGpuMemoryBufferManager *, gfx::GenericSharedMemoryId, int, gfx::Size, gfx::BufferFormat, gfx::BufferUsage, unsigned long, base::OnceCallback<void (gfx::GpuMemoryBufferHandle)> > base/bind_internal.h:599 (content_browsertests+0x843d478)
#14 RunImpl<void (viz::HostGpuMemoryBufferManager::*)(gfx::GenericSharedMemoryId, int, const gfx::Size &, gfx::BufferFormat, gfx::BufferUsage, unsigned long, base::OnceCallback<void (gfx::GpuMemoryBufferHandle)>), std::__1::tuple<base::internal::UnretainedWrapper<viz::HostGpuMemoryBufferManager>, gfx::GenericSharedMemoryId, int, gfx::Size, gfx::BufferFormat, gfx::BufferUsage, unsigned long, base::OnceCallback<void (gfx::GpuMemoryBufferHandle)> >, 0, 1, 2, 3, 4, 5, 6, 7> base/bind_internal.h:672 (content_browsertests+0x843d478)
#15 base::internal::Invoker<base::internal::BindState<void (viz::HostGpuMemoryBufferManager::*)(gfx::GenericSharedMemoryId, int, gfx::Size const&, gfx::BufferFormat, gfx::BufferUsage, unsigned long, base::OnceCallback<void (gfx::GpuMemoryBufferHandle)>), base::internal::UnretainedWrapper<viz::HostGpuMemoryBufferManager>, gfx::GenericSharedMemoryId, int, gfx::Size, gfx::BufferFormat, gfx::BufferUsage, unsigned long, base::OnceCallback<void (gfx::GpuMemoryBufferHandle)> >, void ()>::RunOnce(base::internal::BindStateBase*) base/bind_internal.h:641 (content_browsertests+0x843d478)
#16 Run base/callback.h:97:12 (content_browsertests+0x6679901)
#17 base::TaskAnnotator::RunTask(char const*, base::PendingTask*) base/task/common/task_annotator.cc:119 (content_browsertests+0x6679901)
#18 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::sequence_manager::LazyNow*, bool*) base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:339:23 (content_browsertests+0x66946bf)
#19 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoSomeWork() base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:220:7 (content_browsertests+0x66943bb)
#20 non-virtual thunk to base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoSomeWork() base/task/sequence_manager/thread_controller_with_message_pump_impl.cc (content_browsertests+0x6694a7e)
#21 base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_libevent.cc:208:55 (content_browsertests+0x671cfb4)
#22 Run base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:408:12 (content_browsertests+0x66950b0)
#23 non-virtual thunk to base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool) base/task/sequence_manager/thread_controller_with_message_pump_impl.cc (content_browsertests+0x66950b0)
#24 base::RunLoop::Run() base/run_loop.cc:157:14 (content_browsertests+0x665600e)
#25 base::Thread::Run(base::RunLoop*) base/threading/thread.cc:242:13 (content_browsertests+0x66c2b29)
#26 content::BrowserProcessSubThread::IOThreadRun(base::RunLoop*) content/browser/browser_process_sub_thread.cc:176:11 (content_browsertests+0x55d3696)
#27 content::BrowserProcessSubThread::Run(base::RunLoop*) content/browser/browser_process_sub_thread.cc:128:7 (content_browsertests+0x55d35f8)
#28 base::Thread::ThreadMain() base/threading/thread.cc:312:3 (content_browsertests+0x66c2de1)
#29 base::(anonymous namespace)::ThreadFunc(void*) base/threading/platform_thread_posix.cc:81:13 (content_browsertests+0x6717d94)
Location is heap block of size 56 at 0x7b100001c380 allocated by main thread:
#0 operator new(unsigned long) /b/swarming/w/ir/k/src/third_party/llvm/compiler-rt/lib/tsan/rtl/tsan_new_delete.cc:64:3 (content_browsertests+0x25dfa8b)
#1 base::CommandLine::Init(int, char const* const*) base/command_line.cc:217:34 (content_browsertests+0x65f9be3)
#2 main content/test/content_test_launcher.cc:134:3 (content_browsertests+0x606ce12)