TSan reports the following races in SitePerProcessMouseWheelHitTestBrowserTest
(see https://uberchromegw.corp.google.com/i/chromium.memory/builders/Linux%20TSan%20Tests/builds/19209):
RUN ] SitePerProcessMouseWheelHitTestBrowserTest.SubframeWheelEventsOnMainThread/0
Xlib: extension "RANDR" missing on display ":99".
DevTools listening on ws://127.0.0.1:34758/devtools/browser/019fa132-486d-4943-8afd-b954e944f5a2
==================
WARNING: ThreadSanitizer: data race (pid=14504)
Write of size 8 at 0x00000a3bb358 by main thread:
#0 base::FeatureList::ClearInstanceForTesting() base/feature_list.cc:284:27 (content_browsertests+0x4a68553)
#1 base::test::ScopedFeatureList::InitWithFeatureList(std::__1::unique_ptr<base::FeatureList, std::__1::default_delete<base::FeatureList> >) base/test/scoped_feature_list.cc:107:28 (content_browsertests+0x46378d6)
#2 InitFromCommandLine base/test/scoped_feature_list.cc:116:3 (content_browsertests+0x4638187)
#3 base::test::ScopedFeatureList::InitWithFeaturesAndFieldTrials(std::__1::vector<base::Feature, std::__1::allocator<base::Feature> > const&, std::__1::vector<base::FieldTrial*, std::__1::allocator<base::FieldTrial*> > const&, std::__1::vector<base::Feature, std::__1::allocator<base::Feature> > const&) base/test/scoped_feature_list.cc:186 (content_browsertests+0x4638187)
#4 base::test::ScopedFeatureList::InitWithFeatures(std::__1::vector<base::Feature, std::__1::allocator<base::Feature> > const&, std::__1::vector<base::Feature, std::__1::allocator<base::Feature> > const&) base/test/scoped_feature_list.cc:122:3 (content_browsertests+0x4637a74)
#5 content::SitePerProcessMouseWheelHitTestBrowserTest_SubframeWheelEventsOnMainThread_Test::RunTestOnMainThread() content/browser/site_per_process_hit_test_browsertest.cc:1891:17 (content_browsertests+0x1d76591)
#6 non-virtual thunk to content::SitePerProcessMouseWheelHitTestBrowserTest_SubframeWheelEventsOnMainThread_Test::RunTestOnMainThread() content/browser/site_per_process_hit_test_browsertest.cc (content_browsertests+0x1d786fd)
#7 content::BrowserTestBase::ProxyRunTestOnMainThreadLoop() content/public/test/browser_test_base.cc:379:5 (content_browsertests+0x45f3a5f)
#8 Invoke<content::BrowserTestBase *> base/bind_internal.h:447:12 (content_browsertests+0x45f4cc8)
#9 MakeItSo<void (content::BrowserTestBase::*const &)(), content::BrowserTestBase *> base/bind_internal.h:530 (content_browsertests+0x45f4cc8)
#10 RunImpl<void (content::BrowserTestBase::*const &)(), const std::__1::tuple<base::internal::UnretainedWrapper<content::BrowserTestBase> > &, 0> base/bind_internal.h:604 (content_browsertests+0x45f4cc8)
#11 base::internal::Invoker<base::internal::BindState<void (content::BrowserTestBase::*)(), base::internal::UnretainedWrapper<content::BrowserTestBase> >, void ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:586 (content_browsertests+0x45f4cc8)
#12 Run base/callback.h:124:12 (content_browsertests+0x46c0d0e)
#13 content::ShellBrowserMainParts::PreMainMessageLoopRun() content/shell/browser/shell_browser_main_parts.cc:208 (content_browsertests+0x46c0d0e)
#14 content::BrowserMainLoop::PreMainMessageLoopRun() content/browser/browser_main_loop.cc:1035:13 (content_browsertests+0x3c7e8e0)
#15 Invoke<content::BrowserMainLoop *> base/bind_internal.h:447:12 (content_browsertests+0x3c81de8)
#16 MakeItSo<int (content::BrowserMainLoop::*const &)(), content::BrowserMainLoop *> base/bind_internal.h:530 (content_browsertests+0x3c81de8)
#17 RunImpl<int (content::BrowserMainLoop::*const &)(), const std::__1::tuple<base::internal::UnretainedWrapper<content::BrowserMainLoop> > &, 0> base/bind_internal.h:604 (content_browsertests+0x3c81de8)
#18 base::internal::Invoker<base::internal::BindState<int (content::BrowserMainLoop::*)(), base::internal::UnretainedWrapper<content::BrowserMainLoop> >, int ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:586 (content_browsertests+0x3c81de8)
#19 Run base/callback.h:124:12 (content_browsertests+0x420eb1e)
#20 content::StartupTaskRunner::RunAllTasksNow() content/browser/startup_task_runner.cc:45 (content_browsertests+0x420eb1e)
#21 content::BrowserMainLoop::CreateStartupTasks() content/browser/browser_main_loop.cc:950:25 (content_browsertests+0x3c7cd10)
#22 content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&) content/browser/browser_main_runner.cc:140:17 (content_browsertests+0x3c8239a)
#23 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+0x46c0287)
#24 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:322:16 (content_browsertests+0x4665ff3)
#25 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:410:35 (content_browsertests+0x3b36631)
#26 content::ContentMainRunnerImpl::Run() content/app/content_main_runner.cc:703:12 (content_browsertests+0x3b3727e)
#27 content::ContentServiceManagerMainDelegate::RunEmbedderProcess() content/app/content_service_manager_main_delegate.cc:51:32 (content_browsertests+0x2c7ac9f)
#28 service_manager::Main(service_manager::MainParams const&) services/service_manager/embedder/main.cc:453:29 (content_browsertests+0x6627fc0)
#29 content::ContentMain(content::ContentMainParams const&) content/app/content_main.cc:19:10 (content_browsertests+0x2c7b41e)
#30 content::BrowserTestBase::SetUp() content/public/test/browser_test_base.cc:320:3 (content_browsertests+0x45f352e)
#31 content::ContentBrowserTest::SetUp() content/public/test/content_browser_test.cc:89:20 (content_browsertests+0x45e2e56)
#32 testing::Test::Run() third_party/googletest/src/googletest/src/gtest.cc (content_browsertests+0x2861636)
#33 testing::TestInfo::Run() third_party/googletest/src/googletest/src/gtest.cc:2661:11 (content_browsertests+0x28627cd)
#34 testing::TestCase::Run() third_party/googletest/src/googletest/src/gtest.cc:2779:28 (content_browsertests+0x2863016)
#35 testing::internal::UnitTestImpl::RunAllTests() third_party/googletest/src/googletest/src/gtest.cc:5036:43 (content_browsertests+0x28735e6)
#36 testing::UnitTest::Run() third_party/googletest/src/googletest/src/gtest.cc (content_browsertests+0x2872eeb)
#37 RUN_ALL_TESTS third_party/googletest/src/googletest/include/gtest/gtest.h:2314:46 (content_browsertests+0x463b976)
#38 base::TestSuite::Run() base/test/test_suite.cc:275 (content_browsertests+0x463b976)
#39 content::ContentTestLauncherDelegate::RunTestSuite(int, char**) content/test/content_test_launcher.cc:108:48 (content_browsertests+0x45e8c2b)
#40 content::LaunchTests(content::TestLauncherDelegate*, unsigned long, int, char**) content/public/test/test_launcher.cc:625:31 (content_browsertests+0x461798c)
#41 main content/test/content_test_launcher.cc:138:10 (content_browsertests+0x45e8bbd)
Previous read of size 8 at 0x00000a3bb358 by thread T2:
#0 base::FeatureList::IsEnabled(base::Feature const&) base/feature_list.cc:200:8 (content_browsertests+0x4a67f7d)
#1 IsRendererSideResourceSchedulerEnabled services/network/resource_scheduler.cc:1322:10 (content_browsertests+0x659481e)
#2 network::ResourceScheduler::Client::Client(net::NetworkQualityEstimator const*, network::ResourceScheduler*) services/network/resource_scheduler.cc:417 (content_browsertests+0x659481e)
#3 make_unique<network::ResourceScheduler::Client, const net::NetworkQualityEstimator *const &, network::ResourceScheduler *> buildtools/third_party/libc++/trunk/include/memory:3079:32 (content_browsertests+0x65907e9)
#4 network::ResourceScheduler::OnClientCreated(int, int, net::NetworkQualityEstimator const*) services/network/resource_scheduler.cc:1084 (content_browsertests+0x65907e9)
#5 content::ResourceDispatcherHostImpl::OnRenderViewHostCreated(int, int, net::URLRequestContextGetter*) content/browser/loader/resource_dispatcher_host_impl.cc:1540:15 (content_browsertests+0x3f7fc78)
#6 Invoke<content::ResourceDispatcherHostImpl *, int, int, net::URLRequestContextGetter *> base/bind_internal.h:447:12 (content_browsertests+0x40d6ca3)
#7 MakeItSo<void (content::ResourceDispatcherHostImpl::*)(int, int, net::URLRequestContextGetter *), content::ResourceDispatcherHostImpl *, int, int, net::URLRequestContextGetter *> base/bind_internal.h:530 (content_browsertests+0x40d6ca3)
#8 RunImpl<void (content::ResourceDispatcherHostImpl::*)(int, int, net::URLRequestContextGetter *), std::__1::tuple<base::internal::UnretainedWrapper<content::ResourceDispatcherHostImpl>, int, int, base::internal::RetainedRefWrapper<net::URLRequestContextGetter> >, 0, 1, 2, 3> base/bind_internal.h:604 (content_browsertests+0x40d6ca3)
#9 base::internal::Invoker<base::internal::BindState<void (content::ResourceDispatcherHostImpl::*)(int, int, net::URLRequestContextGetter*), base::internal::UnretainedWrapper<content::ResourceDispatcherHostImpl>, int, int, base::internal::RetainedRefWrapper<net::URLRequestContextGetter> >, void ()>::RunOnce(base::internal::BindStateBase*) base/bind_internal.h:572 (content_browsertests+0x40d6ca3)
#10 Run base/callback.h:95:12 (content_browsertests+0x4a64033)
#11 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) base/debug/task_annotator.cc:61 (content_browsertests+0x4a64033)
#12 base::internal::IncomingTaskQueue::RunTask(base::PendingTask*) base/message_loop/incoming_task_queue.cc:124:19 (content_browsertests+0x4a92cdb)
#13 base::MessageLoop::RunTask(base::PendingTask*) base/message_loop/message_loop.cc:391:25 (content_browsertests+0x4a90fed)
#14 DeferOrRunPendingTask base/message_loop/message_loop.cc:403:5 (content_browsertests+0x4a916c0)
#15 base::MessageLoop::DoWork() base/message_loop/message_loop.cc:447 (content_browsertests+0x4a916c0)
#16 base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_libevent.cc:220:31 (content_browsertests+0x4a966f4)
#17 Run base/message_loop/message_loop.cc:342:12 (content_browsertests+0x4a90a00)
#18 non-virtual thunk to base::MessageLoop::Run(bool) base/message_loop/message_loop.cc (content_browsertests+0x4a90a00)
#19 base::RunLoop::Run() base/run_loop.cc:130:14 (content_browsertests+0x4ac729a)
#20 base::Thread::Run(base::RunLoop*) base/threading/thread.cc:255:13 (content_browsertests+0x4b0c829)
#21 content::BrowserThreadImpl::IOThreadRun(base::RunLoop*) content/browser/browser_thread_impl.cc:218:11 (content_browsertests+0x3c8d72f)
#22 content::BrowserThreadImpl::Run(base::RunLoop*) content/browser/browser_thread_impl.cc:243:14 (content_browsertests+0x3c8d8fb)
#23 base::Thread::ThreadMain() base/threading/thread.cc:338:3 (content_browsertests+0x4b0caf1)
#24 base::(anonymous namespace)::ThreadFunc(void*) base/threading/platform_thread_posix.cc:76:13 (content_browsertests+0x4b0972d)
Location is global 'base::(anonymous namespace)::g_feature_list_instance' of size 8 at 0x00000a3bb358 (content_browsertests+0x00000a3bb358)
Thread T2 'Chrome_IOThread' (tid=14572, 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 (content_browsertests+0x168a2e5)
#1 base::(anonymous namespace)::CreateThread(unsigned long, bool, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) base/threading/platform_thread_posix.cc:115:13 (content_browsertests+0x4b092b7)
#2 base::PlatformThread::CreateWithPriority(unsigned long, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) base/threading/platform_thread_posix.cc:200:10 (content_browsertests+0x4b091b5)
#3 base::Thread::StartWithOptions(base::Thread::Options const&) base/threading/thread.cc:112:15 (content_browsertests+0x4b0c34e)
#4 content::BrowserThreadImpl::StartWithOptions(base::Thread::Options const&) content/browser/browser_thread_impl.cc:343:25 (content_browsertests+0x3c8e57b)
#5 content::BrowserMainLoop::InitializeIOThread() content/browser/browser_main_loop.cc:1573:20 (content_browsertests+0x3c7c34f)
#6 content::BrowserMainLoop::PostMainMessageLoopStart() content/browser/browser_main_loop.cc:731:5 (content_browsertests+0x3c7b4bf)
#7 content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&) content/browser/browser_main_runner.cc:129:19 (content_browsertests+0x3c82736)
#8 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+0x46c0287)
#9 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:322:16 (content_browsertests+0x4665ff3)
#10 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:410:35 (content_browsertests+0x3b36631)
#11 content::ContentMainRunnerImpl::Run() content/app/content_main_runner.cc:703:12 (content_browsertests+0x3b3727e)
#12 content::ContentServiceManagerMainDelegate::RunEmbedderProcess() content/app/content_service_manager_main_delegate.cc:51:32 (content_browsertests+0x2c7ac9f)
#13 service_manager::Main(service_manager::MainParams const&) services/service_manager/embedder/main.cc:453:29 (content_browsertests+0x6627fc0)
#14 content::ContentMain(content::ContentMainParams const&) content/app/content_main.cc:19:10 (content_browsertests+0x2c7b41e)
#15 content::BrowserTestBase::SetUp() content/public/test/browser_test_base.cc:320:3 (content_browsertests+0x45f352e)
#16 content::ContentBrowserTest::SetUp() content/public/test/content_browser_test.cc:89:20 (content_browsertests+0x45e2e56)
#17 testing::Test::Run() third_party/googletest/src/googletest/src/gtest.cc (content_browsertests+0x2861636)
#18 testing::TestInfo::Run() third_party/googletest/src/googletest/src/gtest.cc:2661:11 (content_browsertests+0x28627cd)
#19 testing::TestCase::Run() third_party/googletest/src/googletest/src/gtest.cc:2779:28 (content_browsertests+0x2863016)
#20 testing::internal::UnitTestImpl::RunAllTests() third_party/googletest/src/googletest/src/gtest.cc:5036:43 (content_browsertests+0x28735e6)
#21 testing::UnitTest::Run() third_party/googletest/src/googletest/src/gtest.cc (content_browsertests+0x2872eeb)
#22 RUN_ALL_TESTS third_party/googletest/src/googletest/include/gtest/gtest.h:2314:46 (content_browsertests+0x463b976)
#23 base::TestSuite::Run() base/test/test_suite.cc:275 (content_browsertests+0x463b976)
#24 content::ContentTestLauncherDelegate::RunTestSuite(int, char**) content/test/content_test_launcher.cc:108:48 (content_browsertests+0x45e8c2b)
#25 content::LaunchTests(content::TestLauncherDelegate*, unsigned long, int, char**) content/public/test/test_launcher.cc:625:31 (content_browsertests+0x461798c)
#26 main content/test/content_test_launcher.cc:138:10 (content_browsertests+0x45e8bbd)
SUMMARY: ThreadSanitizer: data race base/feature_list.cc:284:27 in base::FeatureList::ClearInstanceForTesting()
==================
According to issue 782037, these are being caused by the incorrect use of FeatureList.
I couldn't figure out whether it's enough to revert aba7e429ab0894d55f03467b8ec57bf5b9e7682a which caused the problem, so I'm going to disable the offending tests instead.
Comment 1 by bugdroid1@chromium.org
, Mar 20 2018