New issue
Advanced search Search tips

Issue 915254 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 9
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug
Proj-Servicification



Sign in to add a comment

TSan detects race in network_service_content_browsertests DoNotTrackTest.Worker

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

Issue description

https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8927179163748809648/+/steps/network_service_content_browsertests/0/logs/DoNotTrackTest.Worker/0

For capacity reasons we don't run network_service_content_browsertests on the regular tsan bots, but I'm setting up a new tsan-using bot and I accidentally haven't disabled network_service_content_browsertests yet. So I happened to see this bug.



[ RUN      ] DoNotTrackTest.Worker
Xlib:  extension "RANDR" missing on display ":99".

DevTools listening on ws://127.0.0.1:34570/devtools/browser/c7f4b89d-fb64-46e1-a62a-abfc7eafdd14
==================
WARNING: ThreadSanitizer: data race (pid=32571)
  Write of size 8 at 0x7b1000029e48 by main thread:
    #0 SetBrowser content/public/common/content_client.cc:24:24 (content_browsertests+0x3b8c295)
    #1 content::SetBrowserClientForTesting(content::ContentBrowserClient*) content/public/common/content_client.cc:50 (content_browsertests+0x3b8c295)
    #2 content::(anonymous namespace)::DoNotTrackTest::EnableDoNotTrack() content/browser/do_not_track_browsertest.cc:55:24 (content_browsertests+0x255d8af)
    #3 content::(anonymous namespace)::DoNotTrackTest_Worker_Test::RunTestOnMainThread() content/browser/do_not_track_browsertest.cc:160:8 (content_browsertests+0x255e57f)
    #4 content::BrowserTestBase::ProxyRunTestOnMainThreadLoop() content/public/test/browser_test_base.cc:447:5 (content_browsertests+0x5be584a)
    #5 Invoke<void (content::BrowserTestBase::*)(), content::BrowserTestBase *> base/bind_internal.h:516:12 (content_browsertests+0x5be6b18)
    #6 MakeItSo<void (content::BrowserTestBase::*const &)(), content::BrowserTestBase *> base/bind_internal.h:616 (content_browsertests+0x5be6b18)
    #7 RunImpl<void (content::BrowserTestBase::*const &)(), const std::__1::tuple<base::internal::UnretainedWrapper<content::BrowserTestBase> > &, 0> base/bind_internal.h:689 (content_browsertests+0x5be6b18)
    #8 base::internal::Invoker<base::internal::BindState<void (content::BrowserTestBase::*)(), base::internal::UnretainedWrapper<content::BrowserTestBase> >, void ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:671 (content_browsertests+0x5be6b18)
    #9 Run base/callback.h:129:12 (content_browsertests+0x5c73170)
    #10 content::ShellBrowserMainParts::PreMainMessageLoopRun() content/shell/browser/shell_browser_main_parts.cc:177 (content_browsertests+0x5c73170)
    #11 content::BrowserMainLoop::PreMainMessageLoopRun() content/browser/browser_main_loop.cc:983:13 (content_browsertests+0x50f8b55)
    #12 Invoke<int (content::BrowserMainLoop::*)(), content::BrowserMainLoop *> base/bind_internal.h:516:12 (content_browsertests+0x50fb548)
    #13 MakeItSo<int (content::BrowserMainLoop::*const &)(), content::BrowserMainLoop *> base/bind_internal.h:616 (content_browsertests+0x50fb548)
    #14 RunImpl<int (content::BrowserMainLoop::*const &)(), const std::__1::tuple<base::internal::UnretainedWrapper<content::BrowserMainLoop> > &, 0> base/bind_internal.h:689 (content_browsertests+0x50fb548)
    #15 base::internal::Invoker<base::internal::BindState<int (content::BrowserMainLoop::*)(), base::internal::UnretainedWrapper<content::BrowserMainLoop> >, int ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:671 (content_browsertests+0x50fb548)
    #16 Run base/callback.h:129:12 (content_browsertests+0x575135e)
    #17 content::StartupTaskRunner::RunAllTasksNow() content/browser/startup_task_runner.cc:41 (content_browsertests+0x575135e)
    #18 content::BrowserMainLoop::CreateStartupTasks() content/browser/browser_main_loop.cc:917:25 (content_browsertests+0x50f7311)
    #19 content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&) content/browser/browser_main_runner_impl.cc:144:15 (content_browsertests+0x50fbd12)
    #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:22:32 (content_browsertests+0x5c70027)
    #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:371:16 (content_browsertests+0x5c65205)
    #22 RunBrowserProcessMain content/app/content_main_runner_impl.cc:535:29 (content_browsertests+0x4f86014)
    #23 content::ContentMainRunnerImpl::RunServiceManager(content::MainFunctionParams&, bool) content/app/content_main_runner_impl.cc:954 (content_browsertests+0x4f86014)
    #24 content::ContentMainRunnerImpl::Run(bool) content/app/content_main_runner_impl.cc:868:12 (content_browsertests+0x4f85a75)
    #25 content::ContentServiceManagerMainDelegate::RunEmbedderProcess() content/app/content_service_manager_main_delegate.cc:53:32 (content_browsertests+0x3f365af)
    #26 service_manager::Main(service_manager::MainParams const&) services/service_manager/embedder/main.cc:460:29 (content_browsertests+0x81a3b41)
    #27 content::ContentMain(content::ContentMainParams const&) content/app/content_main.cc:19:10 (content_browsertests+0x3f36d2b)
    #28 content::BrowserTestBase::SetUp() content/public/test/browser_test_base.cc:349:3 (content_browsertests+0x5be5388)
    #29 content::ContentBrowserTest::SetUp() content/public/test/content_browser_test.cc:102:20 (content_browsertests+0x5bd2360)
    #30 HandleExceptionsInMethodIfSupported<testing::Test, void> third_party/googletest/src/googletest/src/gtest.cc (content_browsertests+0x3b6ace2)
    #31 testing::Test::Run() third_party/googletest/src/googletest/src/gtest.cc:2517 (content_browsertests+0x3b6ace2)
    #32 testing::TestInfo::Run() third_party/googletest/src/googletest/src/gtest.cc:2703:11 (content_browsertests+0x3b6c128)
    #33 testing::TestCase::Run() third_party/googletest/src/googletest/src/gtest.cc:2825:28 (content_browsertests+0x3b6ca56)
    #34 testing::internal::UnitTestImpl::RunAllTests() third_party/googletest/src/googletest/src/gtest.cc:5227:43 (content_browsertests+0x3b7d9f6)
    #35 HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> third_party/googletest/src/googletest/src/gtest.cc (content_browsertests+0x3b7d2d8)
    #36 testing::UnitTest::Run() third_party/googletest/src/googletest/src/gtest.cc:4835 (content_browsertests+0x3b7d2d8)
    #37 RUN_ALL_TESTS third_party/googletest/src/googletest/include/gtest/gtest.h:2369:46 (content_browsertests+0x5c391c5)
    #38 base::TestSuite::Run() base/test/test_suite.cc:294 (content_browsertests+0x5c391c5)
    #39 content::ContentTestLauncherDelegate::RunTestSuite(int, char**) content/test/content_test_launcher.cc:111:48 (content_browsertests+0x5bd8551)
    #40 content::LaunchTests(content::TestLauncherDelegate*, unsigned long, int, char**) content/public/test/test_launcher.cc:647:31 (content_browsertests+0x5c11a04)
    #41 main content/test/content_test_launcher.cc:141:10 (content_browsertests+0x5bd84dd)

  Previous read of size 8 at 0x7b1000029e48 by thread T14:
    #0 browser content/public/common/content_client.h:82:44 (content_browsertests+0x58156b1)
    #1 content::internal::CreateDefaultPosixFilesToMap(int, mojo::PlatformChannelEndpoint const&, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, base::CommandLine*) content/browser/child_process_launcher_helper_posix.cc:102 (content_browsertests+0x58156b1)
    #2 content::internal::ChildProcessLauncherHelper::GetFilesToMap() content/browser/child_process_launcher_helper_linux.cc:40:10 (content_browsertests+0x515af1d)
    #3 content::internal::ChildProcessLauncherHelper::LaunchOnLauncherThread() content/browser/child_process_launcher_helper.cc:110:60 (content_browsertests+0x515a31a)
    #4 Invoke<void (content::internal::ChildProcessLauncherHelper::*)(), scoped_refptr<content::internal::ChildProcessLauncherHelper>> base/bind_internal.h:516:12 (content_browsertests+0x515abe9)
    #5 MakeItSo<void (content::internal::ChildProcessLauncherHelper::*)(), scoped_refptr<content::internal::ChildProcessLauncherHelper> > base/bind_internal.h:616 (content_browsertests+0x515abe9)
    #6 RunImpl<void (content::internal::ChildProcessLauncherHelper::*)(), std::__1::tuple<scoped_refptr<content::internal::ChildProcessLauncherHelper> >, 0> base/bind_internal.h:689 (content_browsertests+0x515abe9)
    #7 base::internal::Invoker<base::internal::BindState<void (content::internal::ChildProcessLauncherHelper::*)(), scoped_refptr<content::internal::ChildProcessLauncherHelper> >, void ()>::RunOnce(base::internal::BindStateBase*) base/bind_internal.h:658 (content_browsertests+0x515abe9)
    #8 Run base/callback.h:99:12 (content_browsertests+0x616d1cf)
    #9 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) base/debug/task_annotator.cc:99 (content_browsertests+0x616d1cf)
    #10 base::internal::TaskTracker::RunOrSkipTask(base::internal::Task, base::internal::Sequence*, base::TaskTraits const&, bool) base/task/task_scheduler/task_tracker.cc:647:23 (content_browsertests+0x61f4a6e)
    #11 base::internal::TaskTrackerPosix::RunOrSkipTask(base::internal::Task, base::internal::Sequence*, base::TaskTraits const&, bool) base/task/task_scheduler/task_tracker_posix.cc:24:16 (content_browsertests+0x625ba3f)
    #12 base::internal::TaskTracker::RunAndPopNextTask(scoped_refptr<base::internal::Sequence>, base::internal::CanScheduleSequenceObserver*) base/task/task_scheduler/task_tracker.cc:503:3 (content_browsertests+0x61f3fb3)
    #13 base::internal::SchedulerWorker::RunWorker() base/task/task_scheduler/scheduler_worker.cc:337:24 (content_browsertests+0x61eee14)
    #14 base::internal::SchedulerWorker::RunDedicatedWorker() base/task/task_scheduler/scheduler_worker.cc:253:3 (content_browsertests+0x61eead1)
    #15 base::internal::SchedulerWorker::ThreadMain() base/task/task_scheduler/scheduler_worker.cc:214:7 (content_browsertests+0x61ee8df)
    #16 base::(anonymous namespace)::ThreadFunc(void*) base/threading/platform_thread_posix.cc:81:13 (content_browsertests+0x625c4c4)

  Location is heap block of size 64 at 0x7b1000029e40 allocated by main thread:
    #0 operator new(unsigned long) /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/tsan/rtl/tsan_new_delete.cc:65 (content_browsertests+0x2467217)
    #1 content::ShellMainDelegate::BasicStartupComplete(int*) content/shell/app/shell_main_delegate.cc (content_browsertests+0x5c64e7d)
    #2 content::ContentMainRunnerImpl::Initialize(content::ContentMainParams const&) content/app/content_main_runner_impl.cc:665:18 (content_browsertests+0x4f84fad)
    #3 content::ContentServiceManagerMainDelegate::Initialize(service_manager::MainDelegate::InitializeParams const&) content/app/content_service_manager_main_delegate.cc:38:32 (content_browsertests+0x3f36317)
    #4 service_manager::Main(service_manager::MainParams const&) services/service_manager/embedder/main.cc:404:27 (content_browsertests+0x81a3dbc)
    #5 content::ContentMain(content::ContentMainParams const&) content/app/content_main.cc:19:10 (content_browsertests+0x3f36d2b)
    #6 content::BrowserTestBase::SetUp() content/public/test/browser_test_base.cc:349:3 (content_browsertests+0x5be5388)
    #7 content::ContentBrowserTest::SetUp() content/public/test/content_browser_test.cc:102:20 (content_browsertests+0x5bd2360)
    #8 HandleExceptionsInMethodIfSupported<testing::Test, void> third_party/googletest/src/googletest/src/gtest.cc (content_browsertests+0x3b6ace2)
    #9 testing::Test::Run() third_party/googletest/src/googletest/src/gtest.cc:2517 (content_browsertests+0x3b6ace2)
    #10 testing::TestInfo::Run() third_party/googletest/src/googletest/src/gtest.cc:2703:11 (content_browsertests+0x3b6c128)
    #11 testing::TestCase::Run() third_party/googletest/src/googletest/src/gtest.cc:2825:28 (content_browsertests+0x3b6ca56)
    #12 testing::internal::UnitTestImpl::RunAllTests() third_party/googletest/src/googletest/src/gtest.cc:5227:43 (content_browsertests+0x3b7d9f6)
    #13 HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> third_party/googletest/src/googletest/src/gtest.cc (content_browsertests+0x3b7d2d8)
    #14 testing::UnitTest::Run() third_party/googletest/src/googletest/src/gtest.cc:4835 (content_browsertests+0x3b7d2d8)
    #15 RUN_ALL_TESTS third_party/googletest/src/googletest/include/gtest/gtest.h:2369:46 (content_browsertests+0x5c391c5)
    #16 base::TestSuite::Run() base/test/test_suite.cc:294 (content_browsertests+0x5c391c5)
    #17 content::ContentTestLauncherDelegate::RunTestSuite(int, char**) content/test/content_test_launcher.cc:111:48 (content_browsertests+0x5bd8551)
    #18 content::LaunchTests(content::TestLauncherDelegate*, unsigned long, int, char**) content/public/test/test_launcher.cc:647:31 (content_browsertests+0x5c11a04)
    #19 main content/test/content_test_launcher.cc:141:10 (content_browsertests+0x5bd84dd)

  Thread T14 'TaskSchedulerSi' (tid=32613, running) created by thread T5 at:
    #0 pthread_create /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:980 (content_browsertests+0x23f3256)
    #1 base::(anonymous namespace)::CreateThread(unsigned long, bool, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) base/threading/platform_thread_posix.cc:120:13 (content_browsertests+0x625bf57)
    #2 base::PlatformThread::CreateWithPriority(unsigned long, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) base/threading/platform_thread_posix.cc:238:10 (content_browsertests+0x625be55)
    #3 base::internal::SchedulerWorker::Start(base::SchedulerWorkerObserver*) base/task/task_scheduler/scheduler_worker.cc:79:3 (content_browsertests+0x61ee43d)
    #4 CreateTaskRunnerWithTraitsImpl<base::internal::(anonymous namespace)::SchedulerWorkerDelegate> base/task/task_scheduler/scheduler_single_thread_task_runner_manager.cc:487:13 (content_browsertests+0x61f0531)
    #5 base::internal::SchedulerSingleThreadTaskRunnerManager::CreateSingleThreadTaskRunnerWithTraits(base::TaskTraits const&, base::SingleThreadTaskRunnerThreadMode) base/task/task_scheduler/scheduler_single_thread_task_runner_manager.cc:420 (content_browsertests+0x61f0531)
    #6 base::internal::TaskSchedulerImpl::CreateSingleThreadTaskRunnerWithTraits(base::TaskTraits const&, base::SingleThreadTaskRunnerThreadMode) base/task/task_scheduler/task_scheduler_impl.cc:245:8 (content_browsertests+0x61e06cd)
    #7 base::CreateSingleThreadTaskRunnerWithTraits(base::TaskTraits const&, base::SingleThreadTaskRunnerThreadMode) base/task/post_task.cc:116:9 (content_browsertests+0x61c0505)
    #8 Create base/task/lazy_task_runner.cc:54:10 (content_browsertests+0x61bf8b3)
    #9 base::internal::LazyTaskRunner<base::SingleThreadTaskRunner, false>::CreateRaw(void*) base/task/lazy_task_runner.cc:72 (content_browsertests+0x61bf8b3)
    #10 GetOrCreateLazyPointer<base::SingleThreadTaskRunner> base/lazy_instance_helpers.h:83:48 (content_browsertests+0x61bf81a)
    #11 base::internal::LazyTaskRunner<base::SingleThreadTaskRunner, false>::Get() base/task/lazy_task_runner.cc:92 (content_browsertests+0x61bf81a)
    #12 GetProcessLauncherTaskRunner content/browser/child_process_launcher_helper.cc:225:31 (content_browsertests+0x515a14e)
    #13 content::internal::ChildProcessLauncherHelper::StartLaunchOnClientThread() content/browser/child_process_launcher_helper.cc:99 (content_browsertests+0x515a14e)
    #14 content::ChildProcessLauncher::ChildProcessLauncher(std::__1::unique_ptr<content::SandboxedProcessLauncherDelegate, std::__1::default_delete<content::SandboxedProcessLauncherDelegate> >, std::__1::unique_ptr<base::CommandLine, std::__1::default_delete<base::CommandLine> >, int, content::ChildProcessLauncher::Client*, mojo::OutgoingInvitation, base::RepeatingCallback<void (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)> const&, bool) content/browser/child_process_launcher.cc:50:12 (content_browsertests+0x51595a3)
    #15 content::BrowserChildProcessHostImpl::LaunchWithoutExtraCommandLineSwitches(std::__1::unique_ptr<content::SandboxedProcessLauncherDelegate, std::__1::default_delete<content::SandboxedProcessLauncherDelegate> >, std::__1::unique_ptr<base::CommandLine, std::__1::default_delete<base::CommandLine> >, bool) content/browser/browser_child_process_host_impl.cc:338:28 (content_browsertests+0x50ec79a)
    #16 content::GpuProcessHost::LaunchGpuProcess() content/browser/gpu/gpu_process_host.cc:1118:13 (content_browsertests+0x53a3d20)
    #17 content::GpuProcessHost::Init() content/browser/gpu/gpu_process_host.cc:829:15 (content_browsertests+0x53a1cb8)
    #18 content::GpuProcessHost::Get(content::GpuProcessHost::GpuProcessKind, bool) content/browser/gpu/gpu_process_host.cc:549:13 (content_browsertests+0x53a1979)
    #19 content::BrowserGpuChannelHostFactory::EstablishRequest::EstablishOnIO() content/browser/gpu/browser_gpu_channel_host_factory.cc:137:26 (content_browsertests+0x539206b)
    #20 Invoke<void (content::BrowserGpuChannelHostFactory::EstablishRequest::*)(), scoped_refptr<content::BrowserGpuChannelHostFactory::EstablishRequest>> base/bind_internal.h:516:12 (content_browsertests+0x53935b9)
    #21 MakeItSo<void (content::BrowserGpuChannelHostFactory::EstablishRequest::*)(), scoped_refptr<content::BrowserGpuChannelHostFactory::EstablishRequest> > base/bind_internal.h:616 (content_browsertests+0x53935b9)
    #22 RunImpl<void (content::BrowserGpuChannelHostFactory::EstablishRequest::*)(), std::__1::tuple<scoped_refptr<content::BrowserGpuChannelHostFactory::EstablishRequest> >, 0> base/bind_internal.h:689 (content_browsertests+0x53935b9)
    #23 base::internal::Invoker<base::internal::BindState<void (content::BrowserGpuChannelHostFactory::EstablishRequest::*)(), scoped_refptr<content::BrowserGpuChannelHostFactory::EstablishRequest> >, void ()>::RunOnce(base::internal::BindStateBase*) base/bind_internal.h:658 (content_browsertests+0x53935b9)
    #24 Run base/callback.h:99:12 (content_browsertests+0x616d1cf)
    #25 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) base/debug/task_annotator.cc:99 (content_browsertests+0x616d1cf)
    #26 base::MessageLoopImpl::RunTask(base::PendingTask*) base/message_loop/message_loop_impl.cc:374:46 (content_browsertests+0x616bf50)
    #27 DeferOrRunPendingTask base/message_loop/message_loop_impl.cc:385:5 (content_browsertests+0x616c74b)
    #28 base::MessageLoopImpl::DoWork() base/message_loop/message_loop_impl.cc:473 (content_browsertests+0x616c74b)
    #29 non-virtual thunk to base::MessageLoopImpl::DoWork() base/message_loop/message_loop_impl.cc (content_browsertests+0x616c78d)
    #30 base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_libevent.cc:210:31 (content_browsertests+0x62618d4)
    #31 Run base/message_loop/message_loop_impl.cc:326:12 (content_browsertests+0x616bb2f)
    #32 non-virtual thunk to base::MessageLoopImpl::Run(bool) base/message_loop/message_loop_impl.cc (content_browsertests+0x616bb2f)
    #33 base::RunLoop::Run() base/run_loop.cc:102:14 (content_browsertests+0x619d4da)
    #34 base::Thread::Run(base::RunLoop*) base/threading/thread.cc:250:13 (content_browsertests+0x6207419)
    #35 content::BrowserProcessSubThread::IOThreadRun(base::RunLoop*) content/browser/browser_process_sub_thread.cc:174:11 (content_browsertests+0x5105f66)
    #36 content::BrowserProcessSubThread::Run(base::RunLoop*) content/browser/browser_process_sub_thread.cc:126:7 (content_browsertests+0x5105ec8)
    #37 base::Thread::ThreadMain() base/threading/thread.cc:332:3 (content_browsertests+0x62076c0)
    #38 base::(anonymous namespace)::ThreadFunc(void*) base/threading/platform_thread_posix.cc:81:13 (content_browsertests+0x625c4c4)

SUMMARY: ThreadSanitizer: data race content/public/common/content_client.cc:24:24 in SetBrowser



This looks similar to  issue 915213 .
 
Labels: Hotlist-KnownIssue
Status: Assigned (was: Unconfirmed)
Status: Started (was: Assigned)
Project Member

Comment 3 by bugdroid1@chromium.org, Dec 20

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

commit cdbd7298a10483d398790de26260e46796614d22
Author: Makoto Shimazu <shimazu@chromium.org>
Date: Thu Dec 20 06:55:33 2018

Set BrowserClient in SetupOnMainThread for DoNotTrackTest

This is a speculative fix for TSan data race failure which is similar to
 https://crbug.com/915213 .

Bug:  915254 
Change-Id: I26378c271b2b86bcf91bdfb0d9c8ac08d1605e0c
Reviewed-on: https://chromium-review.googlesource.com/c/1382669
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Makoto Shimazu <shimazu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#618129}
[modify] https://crrev.com/cdbd7298a10483d398790de26260e46796614d22/content/browser/do_not_track_browsertest.cc

Status: Fixed (was: Started)
I couldn't reproduce it, so let me mark this as fixed for now.

Sign in to add a comment