Note: Google Test filter = PolicyManagersRace.* [==========] Running 1 test from 1 test suite. [----------] Global test environment set-up. [ RUN ] PolicyManagersRace.ReadVsResetDeviceManagementManager ================================================================= ==2766==ERROR: AddressSanitizer: heap-use-after-free on address 0x7c190f7efc98 at pc 0x55a3161d9070 bp 0x7bf90c1fd510 sp 0x7bf90c1fd508 WRITE of size 4 at 0x7c190f7efc98 thread T2 #0 0x55a3161d906f in scoped_refptr* std::__Cr::construct_at, scoped_refptr&, scoped_refptr*>(scoped_refptr*, scoped_refptr&) gen/third_party/libc++/src/include/__atomic/support/c11.h:181:10 #1 0x55a3161d8d4a in void std::__Cr::vector, std::__Cr::allocator>>::__init_with_size*, scoped_refptr*>(scoped_refptr*, scoped_refptr*, unsigned long) gen/third_party/libc++/src/include/__memory/construct_at.h:45:10 #2 0x55a316530fc3 in void* std::__Cr::__thread_proxy>, updater::PolicyManagersRace_ReadVsResetDeviceManagementManager_Test::TestBody()::$_0>>(void*) gen/third_party/libc++/src/include/__vector/vector.h:263:5 #3 0x55a3160a5e46 in asan_thread_start(void*) asan_interceptors.cpp 0x7c190f7efc98 is located 8 bytes inside of 16-byte region [0x7c190f7efc90,0x7c190f7efca0) freed by thread T0 here: #0 0x55a3160e2202 in operator delete(void*, unsigned long) (/chromium/chromium/src/out/asan/updater_tests+0x1d5c202) (BuildId: ff31fb24b0aa1fb0) #1 0x55a3161c2f86 in updater::PolicyService::PolicyManagers::InitializeManagersVector() base/memory/ref_counted.h:438:5 #2 0x55a3161c4fe0 in updater::PolicyService::PolicyManagers::ResetDeviceManagementManager(scoped_refptr) chrome/updater/policy/service.cc:135:3 #3 0x55a3164efe00 in updater::PolicyManagersRace_ReadVsResetDeviceManagementManager_Test::TestBody() chrome/updater/policy/service_unittest.cc:366:8 #4 0x55a31727a6db in testing::Test::Run() third_party/googletest/src/googletest/src/gtest.cc #5 0x55a31727d897 in testing::TestInfo::Run() third_party/googletest/src/googletest/src/gtest.cc:2892:11 #6 0x55a31727f9a3 in testing::TestSuite::Run() third_party/googletest/src/googletest/src/gtest.cc:3070:30 #7 0x55a3172af8aa in testing::internal::UnitTestImpl::RunAllTests() third_party/googletest/src/googletest/src/gtest.cc:6062:44 #8 0x55a3172ae30e in testing::UnitTest::Run() third_party/googletest/src/googletest/src/gtest.cc #9 0x55a3174f328c in base::TestSuite::Run() base/test/test_suite.cc:440:16 #10 0x55a3160e44c1 in base::internal::Invoker, base::internal::BindState>, int ()>::RunOnce(base::internal::BindStateBase*) base/functional/bind_internal.h:740:12 #11 0x55a3174ffd3b in base::(anonymous namespace)::LaunchUnitTestsInternal(base::OnceCallback, unsigned long, int, unsigned long, bool, base::RepeatingCallback, base::OnceCallback) base/functional/callback.h:155:12 #12 0x55a3175005e8 in base::LaunchUnitTestsWithOptions(int, char**, unsigned long, int, bool, base::RepeatingCallback, base::OnceCallback) base/test/launcher/unit_test_launcher.cc:360:10 #13 0x55a3160e2db2 in main chrome/updater/test/run_all_unittests.cc:243:10 #14 0x7ff9117de249 (/lib/x86_64-linux-gnu/libc.so.6+0x27249) (BuildId: 6196744a316dbd57c0fd8968df1680aac482cec4) previously allocated by thread T0 here: #0 0x55a3160e15fd in operator new(unsigned long) (/chromium/chromium/src/out/asan/updater_tests+0x1d5b5fd) (BuildId: ff31fb24b0aa1fb0) #1 0x55a3161aff5c in scoped_refptr base::MakeRefCounted() base/memory/scoped_refptr.h:151:12 #2 0x55a3161afd07 in updater::GetDefaultValuesPolicyManager() chrome/updater/policy/manager.cc:189:10 #3 0x55a3164efdf3 in updater::PolicyManagersRace_ReadVsResetDeviceManagementManager_Test::TestBody() chrome/updater/policy/service_unittest.cc:366:37 #4 0x55a31727a6db in testing::Test::Run() third_party/googletest/src/googletest/src/gtest.cc #5 0x55a31727d897 in testing::TestInfo::Run() third_party/googletest/src/googletest/src/gtest.cc:2892:11 #6 0x55a31727f9a3 in testing::TestSuite::Run() third_party/googletest/src/googletest/src/gtest.cc:3070:30 #7 0x55a3172af8aa in testing::internal::UnitTestImpl::RunAllTests() third_party/googletest/src/googletest/src/gtest.cc:6062:44 #8 0x55a3172ae30e in testing::UnitTest::Run() third_party/googletest/src/googletest/src/gtest.cc #9 0x55a3174f328c in base::TestSuite::Run() base/test/test_suite.cc:440:16 #10 0x55a3160e44c1 in base::internal::Invoker, base::internal::BindState>, int ()>::RunOnce(base::internal::BindStateBase*) base/functional/bind_internal.h:740:12 #11 0x55a3174ffd3b in base::(anonymous namespace)::LaunchUnitTestsInternal(base::OnceCallback, unsigned long, int, unsigned long, bool, base::RepeatingCallback, base::OnceCallback) base/functional/callback.h:155:12 #12 0x55a3175005e8 in base::LaunchUnitTestsWithOptions(int, char**, unsigned long, int, bool, base::RepeatingCallback, base::OnceCallback) base/test/launcher/unit_test_launcher.cc:360:10 #13 0x55a3160e2db2 in main chrome/updater/test/run_all_unittests.cc:243:10 #14 0x7ff9117de249 (/lib/x86_64-linux-gnu/libc.so.6+0x27249) (BuildId: 6196744a316dbd57c0fd8968df1680aac482cec4) Thread T2 created by T0 here: #0 0x55a31608bc71 in pthread_create (/chromium/chromium/src/out/asan/updater_tests+0x1d05c71) (BuildId: ff31fb24b0aa1fb0) #1 0x55a3164efd1e in updater::PolicyManagersRace_ReadVsResetDeviceManagementManager_Test::TestBody() gen/third_party/libc++/src/include/__thread/support/pthread.h:182:10 #2 0x55a31727a6db in testing::Test::Run() third_party/googletest/src/googletest/src/gtest.cc #3 0x55a31727d897 in testing::TestInfo::Run() third_party/googletest/src/googletest/src/gtest.cc:2892:11 #4 0x55a31727f9a3 in testing::TestSuite::Run() third_party/googletest/src/googletest/src/gtest.cc:3070:30 #5 0x55a3172af8aa in testing::internal::UnitTestImpl::RunAllTests() third_party/googletest/src/googletest/src/gtest.cc:6062:44 #6 0x55a3172ae30e in testing::UnitTest::Run() third_party/googletest/src/googletest/src/gtest.cc #7 0x55a3174f328c in base::TestSuite::Run() base/test/test_suite.cc:440:16 #8 0x55a3160e44c1 in base::internal::Invoker, base::internal::BindState>, int ()>::RunOnce(base::internal::BindStateBase*) base/functional/bind_internal.h:740:12 #9 0x55a3174ffd3b in base::(anonymous namespace)::LaunchUnitTestsInternal(base::OnceCallback, unsigned long, int, unsigned long, bool, base::RepeatingCallback, base::OnceCallback) base/functional/callback.h:155:12 #10 0x55a3175005e8 in base::LaunchUnitTestsWithOptions(int, char**, unsigned long, int, bool, base::RepeatingCallback, base::OnceCallback) base/test/launcher/unit_test_launcher.cc:360:10 #11 0x55a3160e2db2 in main chrome/updater/test/run_all_unittests.cc:243:10 #12 0x7ff9117de249 (/lib/x86_64-linux-gnu/libc.so.6+0x27249) (BuildId: 6196744a316dbd57c0fd8968df1680aac482cec4) SUMMARY: AddressSanitizer: heap-use-after-free gen/third_party/libc++/src/include/__atomic/support/c11.h:181:10 in scoped_refptr* std::__Cr::construct_at, scoped_refptr&, scoped_refptr*>(scoped_refptr*, scoped_refptr&) Shadow bytes around the buggy address: 0x7c190f7efa00: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd 0x7c190f7efa80: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd 0x7c190f7efb00: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd 0x7c190f7efb80: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd 0x7c190f7efc00: fa fa fd fd fa fa fd fd fa fa 00 00 fa fa fd fd =>0x7c190f7efc80: fa fa fd[fd]fa fa fd fd fa fa fd fd fa fa fd fd 0x7c190f7efd00: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd 0x7c190f7efd80: fa fa 00 00 fa fa fa fa fa fa fa fa fa fa fa fa 0x7c190f7efe00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x7c190f7efe80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x7c190f7eff00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==2766==ADDITIONAL INFO ==2766==Note: Please include this section with the ASan report. Task trace: ==2766==END OF ADDITIONAL INFO ==2766==ABORTING