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

Issue 791155 link

Starred by 1 user

Issue metadata

Status: Duplicate
Owner:
Email to this user bounced
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Memory leak in geolocation code when loading risk data

Project Member Reported by jsaul@google.com, Dec 1 2017

Issue description

There appears to be a memory leak when loading geolocation data for Risk fingerprinting, which we discovered when writing SaveCardBubbleViewsBrowserTests (https://chromium-review.googlesource.com/c/chromium/src/+/786641).  When LoadRiskData is called, the browsertest fails with the stack trace below.

It blames ChromeMetricsServiceClient, but only because it is the first class to touch the SystemURLRequestContextGetter.  Commenting out these geolocation-based lines prevents the error from happening, and allows the test to finish normally:
https://cs.chromium.org/chromium/src/components/autofill/content/browser/risk/fingerprint.cc?l=319-330&rcl=0f2b9d8ed426057c1072b24048421f0966f1ef64

Additional digging led to the discovery of changes to fingerprint_browsertest.cc for this purpose (https://chromium-review.googlesource.com/c/chromium/src/+/771380).  By implementing its FakeGeolocation class in CL 786641, we were able to avoid the leak error.

This bug exists to investigate where exactly this leak is coming from, removing the necessity for the FakeGeolocation implementations if possible.

~~~

Stack trace:

[47511:47542:1128/120050.107057:ERROR:leak_tracker.h(99)] Leaked 0x3da221e80e28 which was allocated by:
[47511:47542:1128/120050.107123:ERROR:leak_tracker.h(100)] #0 0x7fd98e041ecd base::debug::StackTrace::StackTrace()
#1 0x7fd98e0402fc base::debug::StackTrace::StackTrace()
#2 0x00000548287f base::debug::LeakTracker<>::LeakTracker()
#3 0x000005475f60 SystemURLRequestContextGetter::SystemURLRequestContextGetter()
#4 0x00000547a53c IOThread::system_url_request_context_getter()
#5 0x000005357bed BrowserProcessImpl::component_updater()
#6 0x000005505197 ChromeMetricsServiceClient::RegisterMetricsServiceProviders()
#7 0x0000055019b7 ChromeMetricsServiceClient::Initialize()
#8 0x000005501774 ChromeMetricsServiceClient::Create()
#9 0x00000550bbc9 ChromeMetricsServicesManagerClient::CreateMetricsServiceClient()
#10 0x000009c434e5 metrics_services_manager::MetricsServicesManager::GetMetricsServiceClient()
#11 0x000009c43346 metrics_services_manager::MetricsServicesManager::GetMetricsService()
#12 0x00000534ded8 BrowserProcessImpl::metrics_service()
#13 0x00000533dbec ChromeBrowserMainParts::SetupMetrics()
#14 0x000005341b8a ChromeBrowserMainParts::PreCreateThreadsImpl()
#15 0x00000533f7a5 ChromeBrowserMainParts::PreCreateThreads()
#16 0x7fd98697fee6 content::BrowserMainLoop::PreCreateThreads()
#17 0x7fd985894cfd _ZN4base8internal13FunctorTraitsIMN7content14NetworkContext11DiskCheckerEFvvEvE6InvokeIPS4_JEEEvS6_OT_DpOT0_
#18 0x7fd985894c74 _ZN4base8internal12InvokeHelperILb0EvE8MakeItSoIMN7content14NetworkContextEFvvEJPS5_EEEvOT_DpOT0_
#19 0x7fd985894c25 _ZN4base8internal7InvokerINS0_9BindStateIMN7content14NetworkContext11DiskCheckerEFvvEJNS0_17UnretainedWrapperIS5_EEEEEFvvEE7RunImplIRKS7_RKNSt3__15tupleIJS9_EEEJLm0EEEEvOT_OT0_NSG_16integer_sequenceImJXspT1_EEEE
#20 0x7fd98589a9dc _ZN4base8internal7InvokerINS0_9BindStateIMN7content14NetworkContext11DiskCheckerEFvvEJNS0_17UnretainedWrapperIS5_EEEEEFvvEE3RunEPNS0_13BindStateBaseE
#21 0x7fd98585550d _ZNKR4base17RepeatingCallbackIFvvEE3RunEv
#22 0x7fd9875edf9d content::StartupTaskRunner::RunAllTasksNow()
#23 0x7fd986981497 content::BrowserMainLoop::CreateStartupTasks()
#24 0x7fd98699003d content::BrowserMainRunnerImpl::Initialize()
#25 0x7fd98697a074 content::BrowserMain()
#26 0x7fd988542a58 content::RunNamedProcessTypeMain()
#27 0x7fd98854564a content::ContentMainRunnerImpl::Run()
#28 0x7fd98853bb0d content::ContentServiceManagerMainDelegate::RunEmbedderProcess()
#29 0x7fd981b6589d service_manager::Main()
#30 0x7fd98854189f content::ContentMain()
#31 0x0000061e18d8 content::BrowserTestBase::SetUp()
#32 0x00000520ef74 InProcessBrowserTest::SetUp()
#33 0x0000024962ae _ZN7testing8internal12InvokeHelperIvNSt3__15tupleIJEEEE12InvokeMethodI14ServiceProcessMS7_FvvEEEvPT_T0_RKS4_
#34 0x00000387def2 testing::internal::HandleExceptionsInMethodIfSupported<>()
#35 0x000003868594 testing::Test::Run()
#36 0x00000386913d testing::TestInfo::Run()
#37 0x000003869b9c testing::TestCase::Run()
#38 0x0000038758dc testing::internal::UnitTestImpl::RunAllTests()
#39 0x00000388725e testing::internal::HandleSehExceptionsInMethodIfSupported<>()
#40 0x00000387f3a2 testing::internal::HandleExceptionsInMethodIfSupported<>()
#41 0x00000387551e testing::UnitTest::Run()
#42 0x000005246471 RUN_ALL_TESTS()
#43 0x000005243492 base::TestSuite::Run()
#44 0x0000051eb290 ChromeTestSuiteRunner::RunTestSuite()
#45 0x0000051eb399 ChromeTestLauncherDelegate::RunTestSuite()
#46 0x0000062703eb content::LaunchTests()
#47 0x0000051ec06f LaunchChromeTests()
#48 0x0000051eb17b main
#49 0x7fd974a6ff45 __libc_start_main
#50 0x000001b8b02a _start

[47511:47542:1128/120050.567044:FATAL:leak_tracker.h(104)] Check failed: 0u == count (0 vs. 1)
#0 0x7fd98e041ecd base::debug::StackTrace::StackTrace()
#1 0x7fd98e0402fc base::debug::StackTrace::StackTrace()
#2 0x7fd98e0c7dba logging::LogMessage::~LogMessage()
#3 0x000005483b6e base::debug::LeakTracker<>::CheckForLeaks()
#4 0x00000547f776 IOThread::CleanUp()
#5 0x7fd9869a4e11 content::BrowserThreadImpl::CleanUp()
#6 0x7fd9869a2302 content::BrowserProcessSubThread::CleanUp()
#7 0x7fd98e2603ec base::Thread::ThreadMain()
#8 0x7fd98e245cd1 base::(anonymous namespace)::ThreadFunc()
#9 0x7fd98e3eb184 start_thread
#10 0x7fd974b4bffd clone
 

Comment 1 by ke...@intel.com, Dec 5 2017

Cc: -ke...@intel.com
Owner: ke...@intel.com
Status: Started (was: Untriaged)
Thanks reporting this, I'm fixing the issue 791445 which will together fix this too.

Comment 2 by ke...@intel.com, Dec 5 2017

Mergedinto: 791445
Status: Duplicate (was: Started)
Project Member

Comment 3 by bugdroid1@chromium.org, Jan 10 2018

Sign in to add a comment