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

Issue 646668 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
please use my google.com address
Closed: Sep 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

Race between SetBrowserClientForTesting and Mojo

Project Member Reported by jyasskin@chromium.org, Sep 14 2016

Issue description

Seems to be flaky. https://build.chromium.org/p/chromium.memory.full/builders/Linux%20TSan%20Tests/builds/1580/steps/content_browsertests%20on%20Ubuntu-12.04/logs/stdio at r418291 has:

WARNING: ThreadSanitizer: data race (pid=25771)
  Read of size 8 at 0x7d1000011888 by thread T12:
    #0 browser content/public/common/content_client.h:80:44 (content_browsertests+0x000002265f93)
    #1 content::(anonymous namespace)::BuiltinManifestProvider::GetManifest(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) content/browser/mojo/mojo_shell_context.cc:175 (content_browsertests+0x000002265f93)
    #2 catalog::Reader::CreateEntryForName(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::unique_ptr<catalog::Entry, std::__1::default_delete<catalog::Entry> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::unique_ptr<catalog::Entry, std::__1::default_delete<catalog::Entry> > > > >*, base::Callback<void (mojo::StructPtr<shell::mojom::ResolveResult>), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) services/catalog/reader.cc:183:29 (content_browsertests+0x000000d2ba27)
    #3 catalog::Instance::ResolveMojoName(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, base::Callback<void (mojo::StructPtr<shell::mojom::ResolveResult>), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) services/catalog/instance.cc:84:19 (content_browsertests+0x000000d27ee2)
    #4 shell::mojom::ResolverStub::AcceptWithResponder(mojo::Message*, mojo::MessageReceiverWithStatus*) out/Release/gen/services/shell/public/interfaces/resolver.mojom.cc:259:14 (content_browsertests+0x000000b19639)
    #5 mojo::internal::Router::HandleMessageInternal(mojo::Message*) mojo/public/cpp/bindings/lib/router.cc:266:32 (content_browsertests+0x000002727407)
    #6 mojo::internal::Router::HandleIncomingMessage(mojo::Message*) mojo/public/cpp/bindings/lib/router.cc:225:10 (content_browsertests+0x000002726261)
    #7 mojo::internal::Router::HandleIncomingMessageThunk::Accept(mojo::Message*) mojo/public/cpp/bindings/lib/router.cc:114:19 (content_browsertests+0x0000027260da)
    #8 mojo::FilterChain::Accept(mojo::Message*) mojo/public/cpp/bindings/lib/filter_chain.cc:40:17 (content_browsertests+0x00000271883d)
    #9 mojo::Connector::ReadSingleMessage(unsigned int*) mojo/public/cpp/bindings/lib/connector.cc:276:51 (content_browsertests+0x000002717045)
    #10 ReadAllAvailableMessages mojo/public/cpp/bindings/lib/connector.cc:302:10 (content_browsertests+0x00000271750a)
    #11 OnHandleReadyInternal mojo/public/cpp/bindings/lib/connector.cc:234 (content_browsertests+0x00000271750a)
    #12 mojo::Connector::OnWatcherHandleReady(unsigned int) mojo/public/cpp/bindings/lib/connector.cc:214 (content_browsertests+0x00000271750a)
    #13 Invoke<mojo::Connector *, unsigned int> base/bind_internal.h:214:12 (content_browsertests+0x0000027176d4)
    #14 MakeItSo<void (mojo::Connector::*const &)(unsigned int), mojo::Connector *, unsigned int> base/bind_internal.h:285 (content_browsertests+0x0000027176d4)
    #15 RunImpl<void (mojo::Connector::*const &)(unsigned int), const std::__1::tuple<base::internal::UnretainedWrapper<mojo::Connector> > &, 0> base/bind_internal.h:361 (content_browsertests+0x0000027176d4)
    #16 base::internal::Invoker<base::internal::BindState<void (mojo::Connector::*)(unsigned int), base::internal::UnretainedWrapper<mojo::Connector> >, void (unsigned int)>::Run(base::internal::BindStateBase*, unsigned int&&) base/bind_internal.h:339 (content_browsertests+0x0000027176d4)
    #17 Run base/callback.h:64:12 (content_browsertests+0x000000b22180)
    #18 mojo::Watcher::OnHandleReady(unsigned int) mojo/public/cpp/system/watcher.cc:122 (content_browsertests+0x000000b22180)
    #19 Invoke<const base::WeakPtr<mojo::Watcher> &, const unsigned int &> base/bind_internal.h:214:12 (content_browsertests+0x000000b223ee)
    #20 MakeItSo<void (mojo::Watcher::*const &)(unsigned int), const base::WeakPtr<mojo::Watcher> &, const unsigned int &> base/bind_internal.h:305 (content_browsertests+0x000000b223ee)
    #21 RunImpl<void (mojo::Watcher::*const &)(unsigned int), const std::__1::tuple<base::WeakPtr<mojo::Watcher>, unsigned int> &, 0, 1> base/bind_internal.h:361 (content_browsertests+0x000000b223ee)
    #22 base::internal::Invoker<base::internal::BindState<void (mojo::Watcher::*)(unsigned int), base::WeakPtr<mojo::Watcher>, unsigned int>, void ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:339 (content_browsertests+0x000000b223ee)
    #23 Run base/callback.h:64:12 (content_browsertests+0x000002ad2e83)
    #24 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask const&) base/debug/task_annotator.cc:54 (content_browsertests+0x000002ad2e83)
    #25 base::MessageLoop::RunTask(base::PendingTask const&) base/message_loop/message_loop.cc:488:19 (content_browsertests+0x000002a3d75b)
    #26 base::MessageLoop::DeferOrRunPendingTask(base::PendingTask) base/message_loop/message_loop.cc:497:5 (content_browsertests+0x000002a3dd2d)
    #27 base::MessageLoop::DoWork() base/message_loop/message_loop.cc:621:13 (content_browsertests+0x000002a3e4f4)
    #28 base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_libevent.cc:217:31 (content_browsertests+0x000002a42e50)
    #29 base::MessageLoop::RunHandler() base/message_loop/message_loop.cc:451:10 (content_browsertests+0x000002a3d0eb)
    #30 base::RunLoop::Run() base/run_loop.cc:35:10 (content_browsertests+0x000002a661e7)
    #31 base::Thread::Run(base::RunLoop*) base/threading/thread.cc:229:13 (content_browsertests+0x000002a90c79)
    #32 content::BrowserThreadImpl::IOThreadRun(base::RunLoop*) content/browser/browser_thread_impl.cc:243:11 (content_browsertests+0x000001fe00ef)
    #33 content::BrowserThreadImpl::Run(base::RunLoop*) content/browser/browser_thread_impl.cc:278:14 (content_browsertests+0x000001fe0312)
    #34 base::Thread::ThreadMain() base/threading/thread.cc:307:3 (content_browsertests+0x000002a90ea5)
    #35 base::(anonymous namespace)::ThreadFunc(void*) base/threading/platform_thread_posix.cc:71:13 (content_browsertests+0x000002a8ad7d)

  Previous write of size 8 at 0x7d1000011888 by main thread:
    #0 SetBrowser content/public/common/content_client.cc:22:24 (content_browsertests+0x0000009c8c35)
    #1 content::SetBrowserClientForTesting(content::ContentBrowserClient*) content/public/common/content_client.cc:53 (content_browsertests+0x0000009c8c35)
    #2 content::ClearSiteDataThrottleBrowserTest::SetUpOnMainThread() content/browser/browsing_data/clear_site_data_throttle_browsertest.cc:88:5 (content_browsertests+0x00000055c6a8)
    #3 content::ContentBrowserTest::RunTestOnMainThreadLoop() content/public/test/content_browser_test.cc:135:3 (content_browsertests+0x000002607696)
    #4 content::BrowserTestBase::ProxyRunTestOnMainThreadLoop() content/public/test/browser_test_base.cc:336:3 (content_browsertests+0x00000260d8a5)
    #5 Invoke<content::BrowserTestBase *> base/bind_internal.h:214:12 (content_browsertests+0x00000260e3e5)
    #6 MakeItSo<void (content::BrowserTestBase::*const &)(), content::BrowserTestBase *> base/bind_internal.h:285 (content_browsertests+0x00000260e3e5)
    #7 RunImpl<void (content::BrowserTestBase::*const &)(), const std::__1::tuple<base::internal::UnretainedWrapper<content::BrowserTestBase> > &, 0> base/bind_internal.h:361 (content_browsertests+0x00000260e3e5)
    #8 base::internal::Invoker<base::internal::BindState<void (content::BrowserTestBase::*)(), base::internal::UnretainedWrapper<content::BrowserTestBase> >, void ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:339 (content_browsertests+0x00000260e3e5)
    #9 Run base/callback.h:64:12 (content_browsertests+0x00000268a09f)
    #10 content::ShellBrowserMainParts::PreMainMessageLoopRun() content/shell/browser/shell_browser_main_parts.cc:192 (content_browsertests+0x00000268a09f)
    #11 content::BrowserMainLoop::PreMainMessageLoopRun() content/browser/browser_main_loop.cc:937:13 (content_browsertests+0x000001fcfcf8)
    #12 Invoke<content::BrowserMainLoop *> base/bind_internal.h:214:12 (content_browsertests+0x000001fd3285)
    #13 MakeItSo<int (content::BrowserMainLoop::*const &)(), content::BrowserMainLoop *> base/bind_internal.h:285 (content_browsertests+0x000001fd3285)
    #14 RunImpl<int (content::BrowserMainLoop::*const &)(), const std::__1::tuple<base::internal::UnretainedWrapper<content::BrowserMainLoop> > &, 0> base/bind_internal.h:361 (content_browsertests+0x000001fd3285)
    #15 base::internal::Invoker<base::internal::BindState<int (content::BrowserMainLoop::*)(), base::internal::UnretainedWrapper<content::BrowserMainLoop> >, int ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:339 (content_browsertests+0x000001fd3285)
    #16 Run base/callback.h:64:12 (content_browsertests+0x0000024321ec)
    #17 content::StartupTaskRunner::RunAllTasksNow() content/browser/startup_task_runner.cc:45 (content_browsertests+0x0000024321ec)
    #18 content::BrowserMainLoop::CreateStartupTasks() content/browser/browser_main_loop.cc:827:25 (content_browsertests+0x000001fcdb4e)
    #19 content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&) content/browser/browser_main_runner.cc:140:17 (content_browsertests+0x000001fd3a32)
    #20 ShellBrowserMain(content::MainFunctionParams const&, std::__1::unique_ptr<content::BrowserMainRunner, std::__1::default_delete<content::BrowserMainRunner> > const&) content/shell/browser/shell_browser_main.cc:23:32 (content_browsertests+0x000002665ef7)
    #21 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:295:16 (content_browsertests+0x0000026590f3)
    #22 content::RunNamedProcessTypeMain(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, content::MainFunctionParams const&, content::ContentMainDelegate*) content/app/content_main_runner.cc:405:35 (content_browsertests+0x000001ef57ab)
    #23 content::ContentMainRunnerImpl::Run() content/app/content_main_runner.cc:786:12 (content_browsertests+0x000001ef64bd)
    #24 content::ContentMain(content::ContentMainParams const&) content/app/content_main.cc:20:28 (content_browsertests+0x000001eed53e)
    #25 content::BrowserTestBase::SetUp() content/public/test/browser_test_base.cc:308:3 (content_browsertests+0x00000260d558)
    #26 content::ContentBrowserTest::SetUp() content/public/test/content_browser_test.cc:94:20 (content_browsertests+0x000002607526)
    #27 HandleExceptionsInMethodIfSupported<testing::Test, void> testing/gtest/src/gtest.cc:2458:12 (content_browsertests+0x0000027fbefd)
    #28 testing::Test::Run() testing/gtest/src/gtest.cc:2470 (content_browsertests+0x0000027fbefd)
    #29 testing::TestInfo::Run() testing/gtest/src/gtest.cc:2656:11 (content_browsertests+0x0000027fd07d)
    #30 testing::TestCase::Run() testing/gtest/src/gtest.cc:2774:28 (content_browsertests+0x0000027fd956)
    #31 testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4647:43 (content_browsertests+0x000002806dc6)
    #32 HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> testing/gtest/src/gtest.cc:2458:12 (content_browsertests+0x000002806774)
    #33 testing::UnitTest::Run() testing/gtest/src/gtest.cc:4255 (content_browsertests+0x000002806774)
    #34 RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2237:46 (content_browsertests+0x000002639a34)
    #35 base::TestSuite::Run() base/test/test_suite.cc:246 (content_browsertests+0x000002639a34)
    #36 content::ContentTestLauncherDelegate::RunTestSuite(int, char**) content/test/content_test_launcher.cc:105:48 (content_browsertests+0x00000260c80b)
    #37 content::LaunchTests(content::TestLauncherDelegate*, int, int, char**) content/public/test/test_launcher.cc:517:31 (content_browsertests+0x000002626dc4)
    #38 main content/test/content_test_launcher.cc:131:10 (content_browsertests+0x00000260c792)

  Location is heap block of size 64 at 0x7d1000011880 allocated by main thread:
    #0 operator new(unsigned long) <null> (content_browsertests+0x0000005101c2)
    #1 content::ShellMainDelegate::BasicStartupComplete(int*) content/shell/app/shell_main_delegate.cc:228:31 (content_browsertests+0x000002658e0b)
    #2 content::ContentMainRunnerImpl::Initialize(content::ContentMainParams const&) content/app/content_main_runner.cc:554:33 (content_browsertests+0x000001ef5cb0)
    #3 content::ContentMain(content::ContentMainParams const&) content/app/content_main.cc:16:32 (content_browsertests+0x000001eed51e)
    #4 content::BrowserTestBase::SetUp() content/public/test/browser_test_base.cc:308:3 (content_browsertests+0x00000260d558)
    #5 content::ContentBrowserTest::SetUp() content/public/test/content_browser_test.cc:94:20 (content_browsertests+0x000002607526)
    #6 HandleExceptionsInMethodIfSupported<testing::Test, void> testing/gtest/src/gtest.cc:2458:12 (content_browsertests+0x0000027fbefd)
    #7 testing::Test::Run() testing/gtest/src/gtest.cc:2470 (content_browsertests+0x0000027fbefd)
    #8 testing::TestInfo::Run() testing/gtest/src/gtest.cc:2656:11 (content_browsertests+0x0000027fd07d)
    #9 testing::TestCase::Run() testing/gtest/src/gtest.cc:2774:28 (content_browsertests+0x0000027fd956)
    #10 testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4647:43 (content_browsertests+0x000002806dc6)
    #11 HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> testing/gtest/src/gtest.cc:2458:12 (content_browsertests+0x000002806774)
    #12 testing::UnitTest::Run() testing/gtest/src/gtest.cc:4255 (content_browsertests+0x000002806774)
    #13 RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2237:46 (content_browsertests+0x000002639a34)
    #14 base::TestSuite::Run() base/test/test_suite.cc:246 (content_browsertests+0x000002639a34)
    #15 content::ContentTestLauncherDelegate::RunTestSuite(int, char**) content/test/content_test_launcher.cc:105:48 (content_browsertests+0x00000260c80b)
    #16 content::LaunchTests(content::TestLauncherDelegate*, int, int, char**) content/public/test/test_launcher.cc:517:31 (content_browsertests+0x000002626dc4)
    #17 main content/test/content_test_launcher.cc:131:10 (content_browsertests+0x00000260c792)

  Thread T12 'Chrome_IOThread' (tid=25821, running) created by main thread at:
    #0 pthread_create <null> (content_browsertests+0x0000004b1965)
    #1 base::(anonymous namespace)::CreateThread(unsigned long, bool, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) base/threading/platform_thread_posix.cc:110:13 (content_browsertests+0x000002a8aa47)
    #2 base::PlatformThread::CreateWithPriority(unsigned long, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) base/threading/platform_thread_posix.cc:191:10 (content_browsertests+0x000002a8a945)
    #3 base::Thread::StartWithOptions(base::Thread::Options const&) base/threading/thread.cc:108:15 (content_browsertests+0x000002a907b9)
    #4 content::BrowserThreadImpl::StartWithOptions(base::Thread::Options const&) content/browser/browser_thread_impl.cc:349:25 (content_browsertests+0x000001fe0834)
    #5 content::BrowserMainLoop::CreateThreads() content/browser/browser_main_loop.cc:919:32 (content_browsertests+0x000001fce66a)
    #6 Invoke<content::BrowserMainLoop *> base/bind_internal.h:214:12 (content_browsertests+0x000001fd3285)
    #7 MakeItSo<int (content::BrowserMainLoop::*const &)(), content::BrowserMainLoop *> base/bind_internal.h:285 (content_browsertests+0x000001fd3285)
    #8 RunImpl<int (content::BrowserMainLoop::*const &)(), const std::__1::tuple<base::internal::UnretainedWrapper<content::BrowserMainLoop> > &, 0> base/bind_internal.h:361 (content_browsertests+0x000001fd3285)
    #9 base::internal::Invoker<base::internal::BindState<int (content::BrowserMainLoop::*)(), base::internal::UnretainedWrapper<content::BrowserMainLoop> >, int ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:339 (content_browsertests+0x000001fd3285)
    #10 Run base/callback.h:64:12 (content_browsertests+0x0000024321ec)
    #11 content::StartupTaskRunner::RunAllTasksNow() content/browser/startup_task_runner.cc:45 (content_browsertests+0x0000024321ec)
    #12 content::BrowserMainLoop::CreateStartupTasks() content/browser/browser_main_loop.cc:827:25 (content_browsertests+0x000001fcdb4e)
    #13 content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&) content/browser/browser_main_runner.cc:140:17 (content_browsertests+0x000001fd3a32)
    #14 ShellBrowserMain(content::MainFunctionParams const&, std::__1::unique_ptr<content::BrowserMainRunner, std::__1::default_delete<content::BrowserMainRunner> > const&) content/shell/browser/shell_browser_main.cc:23:32 (content_browsertests+0x000002665ef7)
    #15 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:295:16 (content_browsertests+0x0000026590f3)
    #16 content::RunNamedProcessTypeMain(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, content::MainFunctionParams const&, content::ContentMainDelegate*) content/app/content_main_runner.cc:405:35 (content_browsertests+0x000001ef57ab)
    #17 content::ContentMainRunnerImpl::Run() content/app/content_main_runner.cc:786:12 (content_browsertests+0x000001ef64bd)
    #18 content::ContentMain(content::ContentMainParams const&) content/app/content_main.cc:20:28 (content_browsertests+0x000001eed53e)
    #19 content::BrowserTestBase::SetUp() content/public/test/browser_test_base.cc:308:3 (content_browsertests+0x00000260d558)
    #20 content::ContentBrowserTest::SetUp() content/public/test/content_browser_test.cc:94:20 (content_browsertests+0x000002607526)
    #21 HandleExceptionsInMethodIfSupported<testing::Test, void> testing/gtest/src/gtest.cc:2458:12 (content_browsertests+0x0000027fbefd)
    #22 testing::Test::Run() testing/gtest/src/gtest.cc:2470 (content_browsertests+0x0000027fbefd)
    #23 testing::TestInfo::Run() testing/gtest/src/gtest.cc:2656:11 (content_browsertests+0x0000027fd07d)
    #24 testing::TestCase::Run() testing/gtest/src/gtest.cc:2774:28 (content_browsertests+0x0000027fd956)
    #25 testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4647:43 (content_browsertests+0x000002806dc6)
    #26 HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> testing/gtest/src/gtest.cc:2458:12 (content_browsertests+0x000002806774)
    #27 testing::UnitTest::Run() testing/gtest/src/gtest.cc:4255 (content_browsertests+0x000002806774)
    #28 RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2237:46 (content_browsertests+0x000002639a34)
    #29 base::TestSuite::Run() base/test/test_suite.cc:246 (content_browsertests+0x000002639a34)
    #30 content::ContentTestLauncherDelegate::RunTestSuite(int, char**) content/test/content_test_launcher.cc:105:48 (content_browsertests+0x00000260c80b)
    #31 content::LaunchTests(content::TestLauncherDelegate*, int, int, char**) content/public/test/test_launcher.cc:517:31 (content_browsertests+0x000002626dc4)
    #32 main content/test/content_test_launcher.cc:131:10 (content_browsertests+0x00000260c792)

SUMMARY: ThreadSanitizer: data race content/public/common/content_client.h:80:44 in browser


The call to SetBrowserClientForTesting from within SetUpOnMainThread() seems fine; Mojo shouldn't be active and using ContentClient::browser() at that point between tests.
 
Cc: roc...@chromium.org
Ken, could you point the right person at this?

Comment 2 by roc...@chromium.org, Sep 14 2016

Cc: -roc...@chromium.org
Owner: roc...@chromium.org
Status: Assigned (was: Untriaged)

Comment 3 by roc...@chromium.org, Sep 21 2016

Status: WontFix (was: Assigned)
Pretty sure this has been caused by https://codereview.chromium.org/2259903002/ which has been landed and reverted a few times. ben's working on a fix, but the code is not currently in the tree anymore so there's nothing to do here.

Sign in to add a comment