Issue description
Linux TSan Tests because of this race https://build.chromium.org/p/chromium.memory.full/builders/Linux%20TSan%20Tests
ReloadCacheControlBrowserTest.BypassingReload
ReloadCacheControlBrowserTest.NormalReload
ReloadCacheControlWithAnExperimentBrowserTest.ReloadMainResource
WARNING: ThreadSanitizer: data race (pid=19090)
Write of size 8 at 0x000009117b28 by main thread:
#0 base::FeatureList::ClearInstanceForTesting() base/feature_list.cc:203:14 (content_browsertests+0x0000028f5893)
#1 base::test::ScopedFeatureList::InitWithFeatureList(std::__1::unique_ptr<base::FeatureList, std::__1::default_delete<base::FeatureList> >) base/test/scoped_feature_list.cc:53:28 (content_browsertests+0x0000024af756)
#2 base::test::ScopedFeatureList::InitFromCommandLine(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) base/test/scoped_feature_list.cc:62:3 (content_browsertests+0x0000024af873)
#3 base::test::ScopedFeatureList::InitAndDisableFeature(base::Feature const&) base/test/scoped_feature_list.cc:70:3 (content_browsertests+0x0000024af9c2)
#4 content::(anonymous namespace)::ReloadCacheControlBrowserTest::SetUpOnMainThread() content/browser/loader/reload_cache_control_browsertest.cc:48:26 (content_browsertests+0x00000072ecf1)
#5 content::ContentBrowserTest::RunTestOnMainThreadLoop() content/public/test/content_browser_test.cc:135:3 (content_browsertests+0x00000247d3d6)
#6 content::BrowserTestBase::ProxyRunTestOnMainThreadLoop() content/public/test/browser_test_base.cc:336:3 (content_browsertests+0x0000024839e5)
#7 Invoke<content::BrowserTestBase *> base/bind_internal.h:214:12 (content_browsertests+0x000002484535)
#8 MakeItSo<void (content::BrowserTestBase::*const &)(), content::BrowserTestBase *> base/bind_internal.h:285 (content_browsertests+0x000002484535)
#9 RunImpl<void (content::BrowserTestBase::*const &)(), const std::__1::tuple<base::internal::UnretainedWrapper<content::BrowserTestBase> > &, 0> base/bind_internal.h:361 (content_browsertests+0x000002484535)
#10 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+0x000002484535)
#11 Run base/callback.h:64:12 (content_browsertests+0x000002505a6f)
#12 content::ShellBrowserMainParts::PreMainMessageLoopRun() content/shell/browser/shell_browser_main_parts.cc:191 (content_browsertests+0x000002505a6f)
#13 content::BrowserMainLoop::PreMainMessageLoopRun() content/browser/browser_main_loop.cc:967:13 (content_browsertests+0x000001e13659)
#14 Invoke<content::BrowserMainLoop *> base/bind_internal.h:214:12 (content_browsertests+0x000001e16a75)
#15 MakeItSo<int (content::BrowserMainLoop::*const &)(), content::BrowserMainLoop *> base/bind_internal.h:285 (content_browsertests+0x000001e16a75)
#16 RunImpl<int (content::BrowserMainLoop::*const &)(), const std::__1::tuple<base::internal::UnretainedWrapper<content::BrowserMainLoop> > &, 0> base/bind_internal.h:361 (content_browsertests+0x000001e16a75)
#17 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+0x000001e16a75)
#18 Run base/callback.h:64:12 (content_browsertests+0x00000229b98a)
#19 content::StartupTaskRunner::RunAllTasksNow() content/browser/startup_task_runner.cc:45 (content_browsertests+0x00000229b98a)
#20 content::BrowserMainLoop::CreateStartupTasks() content/browser/browser_main_loop.cc:852:25 (content_browsertests+0x000001e115a8)
#21 content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&) content/browser/browser_main_runner.cc:126:17 (content_browsertests+0x000001e17402)
#22 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+0x0000024e0b67)
#23 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:293:16 (content_browsertests+0x0000024d3e63)
#24 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:395:35 (content_browsertests+0x000001d33f5b)
#25 content::ContentMainRunnerImpl::Run() content/app/content_main_runner.cc:774:12 (content_browsertests+0x000001d34c37)
#26 content::ContentMain(content::ContentMainParams const&) content/app/content_main.cc:20:28 (content_browsertests+0x000001d2bf2e)
#27 content::BrowserTestBase::SetUp() content/public/test/browser_test_base.cc:308:3 (content_browsertests+0x00000248367b)
#28 content::ContentBrowserTest::SetUp() content/public/test/content_browser_test.cc:94:20 (content_browsertests+0x00000247d266)
#29 HandleExceptionsInMethodIfSupported<testing::Test, void> testing/gtest/src/gtest.cc:2458:12 (content_browsertests+0x00000269085d)
#30 testing::Test::Run() testing/gtest/src/gtest.cc:2470 (content_browsertests+0x00000269085d)
#31 testing::TestInfo::Run() testing/gtest/src/gtest.cc:2656:11 (content_browsertests+0x0000026919ed)
#32 testing::TestCase::Run() testing/gtest/src/gtest.cc:2774:28 (content_browsertests+0x0000026922c6)
#33 testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4647:43 (content_browsertests+0x00000269b7a6)
#34 HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> testing/gtest/src/gtest.cc:2458:12 (content_browsertests+0x00000269b149)
#35 testing::UnitTest::Run() testing/gtest/src/gtest.cc:4255 (content_browsertests+0x00000269b149)
#36 RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2237:46 (content_browsertests+0x0000024aff89)
#37 base::TestSuite::Run() base/test/test_suite.cc:246 (content_browsertests+0x0000024aff89)
#38 content::ContentTestLauncherDelegate::RunTestSuite(int, char**) content/test/content_test_launcher.cc:105:48 (content_browsertests+0x00000248293b)
#39 content::LaunchTests(content::TestLauncherDelegate*, int, int, char**) content/public/test/test_launcher.cc:520:31 (content_browsertests+0x00000249d354)
#40 main content/test/content_test_launcher.cc:131:10 (content_browsertests+0x0000024828c2)
Previous read of size 8 at 0x000009117b28 by thread T12:
#0 base::FeatureList::IsEnabled(base::Feature const&) base/feature_list.cc:137:8 (content_browsertests+0x0000028f53ed)
#1 net::CertVerifyProc::CertVerifyProc() net/cert/cert_verify_proc.cc:394:32 (content_browsertests+0x000003525cd3)
#2 net::CertVerifyProcNSS::CertVerifyProcNSS() net/cert/cert_verify_proc_nss.cc:783:20 (content_browsertests+0x00000352755d)
#3 net::CertVerifyProc::CreateDefault() net/cert/cert_verify_proc.cc:377:14 (content_browsertests+0x000003525c73)
#4 net::CertVerifier::CreateDefault() net/cert/cert_verifier.cc:86:11 (content_browsertests+0x0000034dd50a)
#5 content::ShellURLRequestContextGetter::GetURLRequestContext() content/shell/browser/shell_url_request_context_getter.cc:142:33 (content_browsertests+0x000002507888)
#6 content::ChromeAppCacheService::InitializeOnIOThread(base::FilePath const&, content::ResourceContext*, net::URLRequestContextGetter*, scoped_refptr<storage::SpecialStoragePolicy>) content/browser/appcache/chrome_appcache_service.cc:44:49 (content_browsertests+0x000001dd381c)
#7 Invoke<const scoped_refptr<content::ChromeAppCacheService> &, const base::FilePath &, content::ResourceContext *const &, net::URLRequestContextGetter *, storage::SpecialStoragePolicy *> base/bind_internal.h:214:12 (content_browsertests+0x0000022a44cc)
#8 MakeItSo<void (content::ChromeAppCacheService::*const &)(const base::FilePath &, content::ResourceContext *, net::URLRequestContextGetter *, scoped_refptr<storage::SpecialStoragePolicy>), const scoped_refptr<content::ChromeAppCacheService> &, const base::FilePath &, content::ResourceContext *const &, net::URLRequestContextGetter *, storage::SpecialStoragePolicy *> base/bind_internal.h:285 (content_browsertests+0x0000022a44cc)
#9 RunImpl<void (content::ChromeAppCacheService::*const &)(const base::FilePath &, content::ResourceContext *, net::URLRequestContextGetter *, scoped_refptr<storage::SpecialStoragePolicy>), const std::__1::tuple<scoped_refptr<content::ChromeAppCacheService>, base::FilePath, content::ResourceContext *, base::internal::RetainedRefWrapper<net::URLRequestContextGetter>, base::internal::RetainedRefWrapper<storage::SpecialStoragePolicy> > &, 0, 1, 2, 3, 4> base/bind_internal.h:361 (content_browsertests+0x0000022a44cc)
#10 base::internal::Invoker<base::internal::BindState<void (content::ChromeAppCacheService::*)(base::FilePath const&, content::ResourceContext*, net::URLRequestContextGetter*, scoped_refptr<storage::SpecialStoragePolicy>), scoped_refptr<content::ChromeAppCacheService>, base::FilePath, content::ResourceContext*, base::internal::RetainedRefWrapper<net::URLRequestContextGetter>, base::internal::RetainedRefWrapper<storage::SpecialStoragePolicy> >, void ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:339 (content_browsertests+0x0000022a44cc)
#11 Run base/callback.h:47:12 (content_browsertests+0x0000029ae1c5)
#12 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) base/debug/task_annotator.cc:52 (content_browsertests+0x0000029ae1c5)
#13 base::MessageLoop::RunTask(base::PendingTask*) base/message_loop/message_loop.cc:413:19 (content_browsertests+0x000002913a19)
#14 base::MessageLoop::DeferOrRunPendingTask(base::PendingTask) base/message_loop/message_loop.cc:422:5 (content_browsertests+0x000002913f1d)
#15 base::MessageLoop::DoWork() base/message_loop/message_loop.cc:515:13 (content_browsertests+0x000002914634)
#16 base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_libevent.cc:218:31 (content_browsertests+0x000002919980)
#17 base::MessageLoop::RunHandler() base/message_loop/message_loop.cc:378:10 (content_browsertests+0x0000029135fb)
#18 base::RunLoop::Run() base/run_loop.cc:35:10 (content_browsertests+0x00000293e909)
#19 base::Thread::Run(base::RunLoop*) base/threading/thread.cc:245:13 (content_browsertests+0x00000296b979)
#20 content::BrowserThreadImpl::IOThreadRun(base::RunLoop*) content/browser/browser_thread_impl.cc:253:11 (content_browsertests+0x000001e23ddf)
#21 content::BrowserThreadImpl::Run(base::RunLoop*) content/browser/browser_thread_impl.cc:288:14 (content_browsertests+0x000001e24002)
#22 base::Thread::ThreadMain() base/threading/thread.cc:333:3 (content_browsertests+0x00000296bbd4)
#23 base::(anonymous namespace)::ThreadFunc(void*) base/threading/platform_thread_posix.cc:71:13 (content_browsertests+0x000002964fbd)
Location is global 'base::(anonymous namespace)::g_instance' of size 8 at 0x000009117b28 (content_browsertests+0x000009117b28)
Thread T12 'Chrome_IOThread' (tid=19152, running) created by main thread at:
#0 pthread_create <null> (content_browsertests+0x0000004b3875)
#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+0x000002964c87)
#2 base::PlatformThread::CreateWithPriority(unsigned long, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) base/threading/platform_thread_posix.cc:191:10 (content_browsertests+0x000002964b85)
#3 base::Thread::StartWithOptions(base::Thread::Options const&) base/threading/thread.cc:112:15 (content_browsertests+0x00000296b4d7)
#4 content::BrowserThreadImpl::StartWithOptions(base::Thread::Options const&) content/browser/browser_thread_impl.cc:359:25 (content_browsertests+0x000001e24524)
#5 content::BrowserMainLoop::CreateThreads() content/browser/browser_main_loop.cc:944:32 (content_browsertests+0x000001e1209a)
#6 Invoke<content::BrowserMainLoop *> base/bind_internal.h:214:12 (content_browsertests+0x000001e16a75)
#7 MakeItSo<int (content::BrowserMainLoop::*const &)(), content::BrowserMainLoop *> base/bind_internal.h:285 (content_browsertests+0x000001e16a75)
#8 RunImpl<int (content::BrowserMainLoop::*const &)(), const std::__1::tuple<base::internal::UnretainedWrapper<content::BrowserMainLoop> > &, 0> base/bind_internal.h:361 (content_browsertests+0x000001e16a75)
#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+0x000001e16a75)
#10 Run base/callback.h:64:12 (content_browsertests+0x00000229b98a)
#11 content::StartupTaskRunner::RunAllTasksNow() content/browser/startup_task_runner.cc:45 (content_browsertests+0x00000229b98a)
#12 content::BrowserMainLoop::CreateStartupTasks() content/browser/browser_main_loop.cc:852:25 (content_browsertests+0x000001e115a8)
#13 content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&) content/browser/browser_main_runner.cc:126:17 (content_browsertests+0x000001e17402)
#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+0x0000024e0b67)
#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:293:16 (content_browsertests+0x0000024d3e63)
#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:395:35 (content_browsertests+0x000001d33f5b)
#17 content::ContentMainRunnerImpl::Run() content/app/content_main_runner.cc:774:12 (content_browsertests+0x000001d34c37)
#18 content::ContentMain(content::ContentMainParams const&) content/app/content_main.cc:20:28 (content_browsertests+0x000001d2bf2e)
#19 content::BrowserTestBase::SetUp() content/public/test/browser_test_base.cc:308:3 (content_browsertests+0x00000248367b)
#20 content::ContentBrowserTest::SetUp() content/public/test/content_browser_test.cc:94:20 (content_browsertests+0x00000247d266)
#21 HandleExceptionsInMethodIfSupported<testing::Test, void> testing/gtest/src/gtest.cc:2458:12 (content_browsertests+0x00000269085d)
#22 testing::Test::Run() testing/gtest/src/gtest.cc:2470 (content_browsertests+0x00000269085d)
#23 testing::TestInfo::Run() testing/gtest/src/gtest.cc:2656:11 (content_browsertests+0x0000026919ed)
#24 testing::TestCase::Run() testing/gtest/src/gtest.cc:2774:28 (content_browsertests+0x0000026922c6)
#25 testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4647:43 (content_browsertests+0x00000269b7a6)
#26 HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> testing/gtest/src/gtest.cc:2458:12 (content_browsertests+0x00000269b149)
#27 testing::UnitTest::Run() testing/gtest/src/gtest.cc:4255 (content_browsertests+0x00000269b149)
#28 RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2237:46 (content_browsertests+0x0000024aff89)
#29 base::TestSuite::Run() base/test/test_suite.cc:246 (content_browsertests+0x0000024aff89)
#30 content::ContentTestLauncherDelegate::RunTestSuite(int, char**) content/test/content_test_launcher.cc:105:48 (content_browsertests+0x00000248293b)
#31 content::LaunchTests(content::TestLauncherDelegate*, int, int, char**) content/public/test/test_launcher.cc:520:31 (content_browsertests+0x00000249d354)
#32 main content/test/content_test_launcher.cc:131:10 (content_browsertests+0x0000024828c2)
With the current code, the IO thread may access a null or partially written |g_instance|. Maybe |g_instance| should be an atomic variable?
Linux TSan Tests are broken because of this race https://build.chromium.org/p/chromium.memory.full/builders/Linux%20TSan%20Tests
ReloadCacheControlBrowserTest.BypassingReload
ReloadCacheControlBrowserTest.NormalReload
ReloadCacheControlWithAnExperimentBrowserTest.ReloadMainResource
WARNING: ThreadSanitizer: data race (pid=19090)
Write of size 8 at 0x000009117b28 by main thread:
#0 base::FeatureList::ClearInstanceForTesting() base/feature_list.cc:203:14 (content_browsertests+0x0000028f5893)
#1 base::test::ScopedFeatureList::InitWithFeatureList(std::__1::unique_ptr<base::FeatureList, std::__1::default_delete<base::FeatureList> >) base/test/scoped_feature_list.cc:53:28 (content_browsertests+0x0000024af756)
#2 base::test::ScopedFeatureList::InitFromCommandLine(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) base/test/scoped_feature_list.cc:62:3 (content_browsertests+0x0000024af873)
#3 base::test::ScopedFeatureList::InitAndDisableFeature(base::Feature const&) base/test/scoped_feature_list.cc:70:3 (content_browsertests+0x0000024af9c2)
#4 content::(anonymous namespace)::ReloadCacheControlBrowserTest::SetUpOnMainThread() content/browser/loader/reload_cache_control_browsertest.cc:48:26 (content_browsertests+0x00000072ecf1)
#5 content::ContentBrowserTest::RunTestOnMainThreadLoop() content/public/test/content_browser_test.cc:135:3 (content_browsertests+0x00000247d3d6)
#6 content::BrowserTestBase::ProxyRunTestOnMainThreadLoop() content/public/test/browser_test_base.cc:336:3 (content_browsertests+0x0000024839e5)
#7 Invoke<content::BrowserTestBase *> base/bind_internal.h:214:12 (content_browsertests+0x000002484535)
#8 MakeItSo<void (content::BrowserTestBase::*const &)(), content::BrowserTestBase *> base/bind_internal.h:285 (content_browsertests+0x000002484535)
#9 RunImpl<void (content::BrowserTestBase::*const &)(), const std::__1::tuple<base::internal::UnretainedWrapper<content::BrowserTestBase> > &, 0> base/bind_internal.h:361 (content_browsertests+0x000002484535)
#10 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+0x000002484535)
#11 Run base/callback.h:64:12 (content_browsertests+0x000002505a6f)
#12 content::ShellBrowserMainParts::PreMainMessageLoopRun() content/shell/browser/shell_browser_main_parts.cc:191 (content_browsertests+0x000002505a6f)
#13 content::BrowserMainLoop::PreMainMessageLoopRun() content/browser/browser_main_loop.cc:967:13 (content_browsertests+0x000001e13659)
#14 Invoke<content::BrowserMainLoop *> base/bind_internal.h:214:12 (content_browsertests+0x000001e16a75)
#15 MakeItSo<int (content::BrowserMainLoop::*const &)(), content::BrowserMainLoop *> base/bind_internal.h:285 (content_browsertests+0x000001e16a75)
#16 RunImpl<int (content::BrowserMainLoop::*const &)(), const std::__1::tuple<base::internal::UnretainedWrapper<content::BrowserMainLoop> > &, 0> base/bind_internal.h:361 (content_browsertests+0x000001e16a75)
#17 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+0x000001e16a75)
#18 Run base/callback.h:64:12 (content_browsertests+0x00000229b98a)
#19 content::StartupTaskRunner::RunAllTasksNow() content/browser/startup_task_runner.cc:45 (content_browsertests+0x00000229b98a)
#20 content::BrowserMainLoop::CreateStartupTasks() content/browser/browser_main_loop.cc:852:25 (content_browsertests+0x000001e115a8)
#21 content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&) content/browser/browser_main_runner.cc:126:17 (content_browsertests+0x000001e17402)
#22 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+0x0000024e0b67)
#23 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:293:16 (content_browsertests+0x0000024d3e63)
#24 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:395:35 (content_browsertests+0x000001d33f5b)
#25 content::ContentMainRunnerImpl::Run() content/app/content_main_runner.cc:774:12 (content_browsertests+0x000001d34c37)
#26 content::ContentMain(content::ContentMainParams const&) content/app/content_main.cc:20:28 (content_browsertests+0x000001d2bf2e)
#27 content::BrowserTestBase::SetUp() content/public/test/browser_test_base.cc:308:3 (content_browsertests+0x00000248367b)
#28 content::ContentBrowserTest::SetUp() content/public/test/content_browser_test.cc:94:20 (content_browsertests+0x00000247d266)
#29 HandleExceptionsInMethodIfSupported<testing::Test, void> testing/gtest/src/gtest.cc:2458:12 (content_browsertests+0x00000269085d)
#30 testing::Test::Run() testing/gtest/src/gtest.cc:2470 (content_browsertests+0x00000269085d)
#31 testing::TestInfo::Run() testing/gtest/src/gtest.cc:2656:11 (content_browsertests+0x0000026919ed)
#32 testing::TestCase::Run() testing/gtest/src/gtest.cc:2774:28 (content_browsertests+0x0000026922c6)
#33 testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4647:43 (content_browsertests+0x00000269b7a6)
#34 HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> testing/gtest/src/gtest.cc:2458:12 (content_browsertests+0x00000269b149)
#35 testing::UnitTest::Run() testing/gtest/src/gtest.cc:4255 (content_browsertests+0x00000269b149)
#36 RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2237:46 (content_browsertests+0x0000024aff89)
#37 base::TestSuite::Run() base/test/test_suite.cc:246 (content_browsertests+0x0000024aff89)
#38 content::ContentTestLauncherDelegate::RunTestSuite(int, char**) content/test/content_test_launcher.cc:105:48 (content_browsertests+0x00000248293b)
#39 content::LaunchTests(content::TestLauncherDelegate*, int, int, char**) content/public/test/test_launcher.cc:520:31 (content_browsertests+0x00000249d354)
#40 main content/test/content_test_launcher.cc:131:10 (content_browsertests+0x0000024828c2)
Previous read of size 8 at 0x000009117b28 by thread T12:
#0 base::FeatureList::IsEnabled(base::Feature const&) base/feature_list.cc:137:8 (content_browsertests+0x0000028f53ed)
#1 net::CertVerifyProc::CertVerifyProc() net/cert/cert_verify_proc.cc:394:32 (content_browsertests+0x000003525cd3)
#2 net::CertVerifyProcNSS::CertVerifyProcNSS() net/cert/cert_verify_proc_nss.cc:783:20 (content_browsertests+0x00000352755d)
#3 net::CertVerifyProc::CreateDefault() net/cert/cert_verify_proc.cc:377:14 (content_browsertests+0x000003525c73)
#4 net::CertVerifier::CreateDefault() net/cert/cert_verifier.cc:86:11 (content_browsertests+0x0000034dd50a)
#5 content::ShellURLRequestContextGetter::GetURLRequestContext() content/shell/browser/shell_url_request_context_getter.cc:142:33 (content_browsertests+0x000002507888)
#6 content::ChromeAppCacheService::InitializeOnIOThread(base::FilePath const&, content::ResourceContext*, net::URLRequestContextGetter*, scoped_refptr<storage::SpecialStoragePolicy>) content/browser/appcache/chrome_appcache_service.cc:44:49 (content_browsertests+0x000001dd381c)
#7 Invoke<const scoped_refptr<content::ChromeAppCacheService> &, const base::FilePath &, content::ResourceContext *const &, net::URLRequestContextGetter *, storage::SpecialStoragePolicy *> base/bind_internal.h:214:12 (content_browsertests+0x0000022a44cc)
#8 MakeItSo<void (content::ChromeAppCacheService::*const &)(const base::FilePath &, content::ResourceContext *, net::URLRequestContextGetter *, scoped_refptr<storage::SpecialStoragePolicy>), const scoped_refptr<content::ChromeAppCacheService> &, const base::FilePath &, content::ResourceContext *const &, net::URLRequestContextGetter *, storage::SpecialStoragePolicy *> base/bind_internal.h:285 (content_browsertests+0x0000022a44cc)
#9 RunImpl<void (content::ChromeAppCacheService::*const &)(const base::FilePath &, content::ResourceContext *, net::URLRequestContextGetter *, scoped_refptr<storage::SpecialStoragePolicy>), const std::__1::tuple<scoped_refptr<content::ChromeAppCacheService>, base::FilePath, content::ResourceContext *, base::internal::RetainedRefWrapper<net::URLRequestContextGetter>, base::internal::RetainedRefWrapper<storage::SpecialStoragePolicy> > &, 0, 1, 2, 3, 4> base/bind_internal.h:361 (content_browsertests+0x0000022a44cc)
#10 base::internal::Invoker<base::internal::BindState<void (content::ChromeAppCacheService::*)(base::FilePath const&, content::ResourceContext*, net::URLRequestContextGetter*, scoped_refptr<storage::SpecialStoragePolicy>), scoped_refptr<content::ChromeAppCacheService>, base::FilePath, content::ResourceContext*, base::internal::RetainedRefWrapper<net::URLRequestContextGetter>, base::internal::RetainedRefWrapper<storage::SpecialStoragePolicy> >, void ()>::Run(base::internal::BindStateBase*) base/bind_internal.h:339 (content_browsertests+0x0000022a44cc)
#11 Run base/callback.h:47:12 (content_browsertests+0x0000029ae1c5)
#12 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) base/debug/task_annotator.cc:52 (content_browsertests+0x0000029ae1c5)
#13 base::MessageLoop::RunTask(base::PendingTask*) base/message_loop/message_loop.cc:413:19 (content_browsertests+0x000002913a19)
#14 base::MessageLoop::DeferOrRunPendingTask(base::PendingTask) base/message_loop/message_loop.cc:422:5 (content_browsertests+0x000002913f1d)
#15 base::MessageLoop::DoWork() base/message_loop/message_loop.cc:515:13 (content_browsertests+0x000002914634)
#16 base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_libevent.cc:218:31 (content_browsertests+0x000002919980)
#17 base::MessageLoop::RunHandler() base/message_loop/message_loop.cc:378:10 (content_browsertests+0x0000029135fb)
#18 base::RunLoop::Run() base/run_loop.cc:35:10 (content_browsertests+0x00000293e909)
#19 base::Thread::Run(base::RunLoop*) base/threading/thread.cc:245:13 (content_browsertests+0x00000296b979)
#20 content::BrowserThreadImpl::IOThreadRun(base::RunLoop*) content/browser/browser_thread_impl.cc:253:11 (content_browsertests+0x000001e23ddf)
#21 content::BrowserThreadImpl::Run(base::RunLoop*) content/browser/browser_thread_impl.cc:288:14 (content_browsertests+0x000001e24002)
#22 base::Thread::ThreadMain() base/threading/thread.cc:333:3 (content_browsertests+0x00000296bbd4)
#23 base::(anonymous namespace)::ThreadFunc(void*) base/threading/platform_thread_posix.cc:71:13 (content_browsertests+0x000002964fbd)
Location is global 'base::(anonymous namespace)::g_instance' of size 8 at 0x000009117b28 (content_browsertests+0x000009117b28)
Thread T12 'Chrome_IOThread' (tid=19152, running) created by main thread at:
#0 pthread_create <null> (content_browsertests+0x0000004b3875)
#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+0x000002964c87)
#2 base::PlatformThread::CreateWithPriority(unsigned long, base::PlatformThread::Delegate*, base::PlatformThreadHandle*, base::ThreadPriority) base/threading/platform_thread_posix.cc:191:10 (content_browsertests+0x000002964b85)
#3 base::Thread::StartWithOptions(base::Thread::Options const&) base/threading/thread.cc:112:15 (content_browsertests+0x00000296b4d7)
#4 content::BrowserThreadImpl::StartWithOptions(base::Thread::Options const&) content/browser/browser_thread_impl.cc:359:25 (content_browsertests+0x000001e24524)
#5 content::BrowserMainLoop::CreateThreads() content/browser/browser_main_loop.cc:944:32 (content_browsertests+0x000001e1209a)
#6 Invoke<content::BrowserMainLoop *> base/bind_internal.h:214:12 (content_browsertests+0x000001e16a75)
#7 MakeItSo<int (content::BrowserMainLoop::*const &)(), content::BrowserMainLoop *> base/bind_internal.h:285 (content_browsertests+0x000001e16a75)
#8 RunImpl<int (content::BrowserMainLoop::*const &)(), const std::__1::tuple<base::internal::UnretainedWrapper<content::BrowserMainLoop> > &, 0> base/bind_internal.h:361 (content_browsertests+0x000001e16a75)
#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+0x000001e16a75)
#10 Run base/callback.h:64:12 (content_browsertests+0x00000229b98a)
#11 content::StartupTaskRunner::RunAllTasksNow() content/browser/startup_task_runner.cc:45 (content_browsertests+0x00000229b98a)
#12 content::BrowserMainLoop::CreateStartupTasks() content/browser/browser_main_loop.cc:852:25 (content_browsertests+0x000001e115a8)
#13 content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&) content/browser/browser_main_runner.cc:126:17 (content_browsertests+0x000001e17402)
#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+0x0000024e0b67)
#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:293:16 (content_browsertests+0x0000024d3e63)
#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:395:35 (content_browsertests+0x000001d33f5b)
#17 content::ContentMainRunnerImpl::Run() content/app/content_main_runner.cc:774:12 (content_browsertests+0x000001d34c37)
#18 content::ContentMain(content::ContentMainParams const&) content/app/content_main.cc:20:28 (content_browsertests+0x000001d2bf2e)
#19 content::BrowserTestBase::SetUp() content/public/test/browser_test_base.cc:308:3 (content_browsertests+0x00000248367b)
#20 content::ContentBrowserTest::SetUp() content/public/test/content_browser_test.cc:94:20 (content_browsertests+0x00000247d266)
#21 HandleExceptionsInMethodIfSupported<testing::Test, void> testing/gtest/src/gtest.cc:2458:12 (content_browsertests+0x00000269085d)
#22 testing::Test::Run() testing/gtest/src/gtest.cc:2470 (content_browsertests+0x00000269085d)
#23 testing::TestInfo::Run() testing/gtest/src/gtest.cc:2656:11 (content_browsertests+0x0000026919ed)
#24 testing::TestCase::Run() testing/gtest/src/gtest.cc:2774:28 (content_browsertests+0x0000026922c6)
#25 testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4647:43 (content_browsertests+0x00000269b7a6)
#26 HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> testing/gtest/src/gtest.cc:2458:12 (content_browsertests+0x00000269b149)
#27 testing::UnitTest::Run() testing/gtest/src/gtest.cc:4255 (content_browsertests+0x00000269b149)
#28 RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2237:46 (content_browsertests+0x0000024aff89)
#29 base::TestSuite::Run() base/test/test_suite.cc:246 (content_browsertests+0x0000024aff89)
#30 content::ContentTestLauncherDelegate::RunTestSuite(int, char**) content/test/content_test_launcher.cc:105:48 (content_browsertests+0x00000248293b)
#31 content::LaunchTests(content::TestLauncherDelegate*, int, int, char**) content/public/test/test_launcher.cc:520:31 (content_browsertests+0x00000249d354)
#32 main content/test/content_test_launcher.cc:131:10 (content_browsertests+0x0000024828c2)
With the current code, the IO thread may access a null or partially written |g_instance|. Maybe |g_instance| should be an atomic variable?
|
Comment 1 by fdoray@chromium.org
, Nov 17 2016