New issue
Advanced search Search tips

Issue 594130 link

Starred by 2 users

Issue metadata

Status: Archived
Owner: ----
Closed: Jan 10
Cc:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Memory leaks in CreateRequestContext

Project Member Reported by vasi...@chromium.org, Mar 11 2016

Issue description

This is reproduced constantly by Linux ASan LSan Tests (1).
Example : https://build.chromium.org/p/chromium.memory/builders/Linux%20ASan%20LSan%20Tests%20%281%29/builds/24132

SafeBrowsingUIManagerTest.Whitelist

Direct leak of 72 byte(s) in 1 object(s) allocated from:
    #0 0x73f5bb in operator new(unsigned long) (/tmp/runICzlMU/out/Release/unit_tests+0x73f5bb)
    #1 0x536197a in TestingProfile::CreateRequestContext(std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, linked_ptr<net::URLRequestJobFactory::ProtocolHandler>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, linked_ptr<net::URLRequestJobFactory::ProtocolHandler> > > >*, ScopedVector<net::URLRequestInterceptor>) chrome/test/base/testing_profile.cc:816:10
    #2 0x3c907c8 in ChromeContentBrowserClient::CreateRequestContext(content::BrowserContext*, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, linked_ptr<net::URLRequestJobFactory::ProtocolHandler>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, linked_ptr<net::URLRequestJobFactory::ProtocolHandler> > > >*, ScopedVector<net::URLRequestInterceptor>) chrome/browser/chrome_content_browser_client.cc:1096:10
    #3 0xdbbb221 in content::StoragePartitionImplMap::Get(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&, bool) content/browser/storage_partition_impl_map.cc:465:9
    #4 0xd79a5c6 in content::BrowserContext::GetStoragePartitionForSite(content::BrowserContext*, GURL const&) content/browser/browser_context.cc:208:10
    #5 0xd9efdbb in content::RenderProcessHostImpl::IsSuitableHost(content::RenderProcessHost*, content::BrowserContext*, GURL const&) content/browser/renderer_host/render_process_host_impl.cc:2212:7
    #6 0xdb8942d in content::SiteInstanceImpl::HasWrongProcessForURL(GURL const&) content/browser/site_instance_impl.cc:210:11
    #7 0xd894700 in content::RenderFrameHostManager::DetermineSiteInstanceForURL(GURL const&, content::SiteInstance*, content::SiteInstance*, content::SiteInstance*, ui::PageTransition, bool, bool, bool) content/browser/frame_host/render_frame_host_manager.cc:1298:9
    #8 0xd891935 in content::RenderFrameHostManager::GetSiteInstanceForNavigation(GURL const&, content::SiteInstance*, content::SiteInstance*, content::SiteInstance*, ui::PageTransition, bool, bool) content/browser/frame_host/render_frame_host_manager.cc:1206:31
    #9 0xd888a46 in content::RenderFrameHostManager::UpdateStateForNavigate(GURL const&, content::SiteInstance*, content::SiteInstance*, ui::PageTransition, bool, bool, content::GlobalRequestID const&, int) content/browser/frame_host/render_frame_host_manager.cc:2149:46
    #10 0xd887749 in content::RenderFrameHostManager::Navigate(GURL const&, content::FrameNavigationEntry const&, content::NavigationEntryImpl const&) content/browser/frame_host/render_frame_host_manager.cc:208:49
    #11 0xdf42594 in content::NavigatorImpl::NavigateToEntry(content::FrameTreeNode*, content::FrameNavigationEntry const&, content::NavigationEntryImpl const&, content::NavigationController::ReloadType, bool, bool) content/browser/frame_host/navigator_impl.cc:345:9
    #12 0xdf4446c in content::NavigatorImpl::NavigateToPendingEntry(content::FrameTreeNode*, content::FrameNavigationEntry const&, content::NavigationController::ReloadType, bool) content/browser/frame_host/navigator_impl.cc:431:10
    #13 0xd8401e5 in content::NavigationControllerImpl::NavigateToPendingEntryInternal(content::NavigationController::ReloadType) content/browser/frame_host/navigation_controller_impl.cc:1833:12
    #14 0xd833997 in content::NavigationControllerImpl::NavigateToPendingEntry(content::NavigationController::ReloadType) content/browser/frame_host/navigation_controller_impl.cc:1810:18
    #15 0xd836b74 in LoadEntry content/browser/frame_host/navigation_controller_impl.cc:462:3
    #16 0xd836b74 in content::NavigationControllerImpl::LoadURLWithParams(content::NavigationController::LoadURLParams const&) content/browser/frame_host/navigation_controller_impl.cc:830
    #17 0xd835e7f in content::NavigationControllerImpl::LoadURL(GURL const&, content::Referrer const&, ui::PageTransition, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) content/browser/frame_host/navigation_controller_impl.cc:697:3
    #18 0x4b242e4 in content::TestWebContents::StartNavigation(GURL const&) content/test/test_web_contents.cc:66:3
    #19 0x337e5da in MakeUnsafeResourceAndStartNavigation chrome/browser/safe_browsing/ui_manager_unittest.cc:104:5
    #20 0x337e5da in safe_browsing::SafeBrowsingUIManagerTest_Whitelist_Test::TestBody() chrome/browser/safe_browsing/ui_manager_unittest.cc:120
    #21 0x52d0a4b in HandleExceptionsInMethodIfSupported<testing::Test, void> testing/gtest/src/gtest.cc:2458:12
    #22 0x52d0a4b in testing::Test::Run() testing/gtest/src/gtest.cc:2474
    #23 0x52d24a4 in testing::TestInfo::Run() testing/gtest/src/gtest.cc:2656:5
    #24 0x52d3724 in testing::TestCase::Run() testing/gtest/src/gtest.cc:2774:5
    #25 0x52e5ea8 in testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4647:11
    #26 0x52e5499 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> testing/gtest/src/gtest.cc:2458:12
    #27 0x52e5499 in testing::UnitTest::Run() testing/gtest/src/gtest.cc:4255
    #28 0x110a6464 in RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2237:10
    #29 0x110a6464 in base::TestSuite::Run() base/test/test_suite.cc:231
    #30 0x1109e9e2 in Run base/callback.h:397:12
    #31 0x1109e9e2 in base::(anonymous namespace)::LaunchUnitTestsInternal(base::Callback<int (), (base::internal::CopyMode)1> const&, int, int, bool, base::Callback<void (), (base::internal::CopyMode)1> const&) base/test/launcher/unit_test_launcher.cc:206
    #32 0x1109e659 in base::LaunchUnitTests(int, char**, base::Callback<int (), (base::internal::CopyMode)1> const&) base/test/launcher/unit_test_launcher.cc:445:10
    #33 0x538219d in main chrome/test/base/run_all_unittests.cc:16:10
    #34 0x7f9da0f8b76c in __libc_start_main /build/eglibc-rrybNj/eglibc-2.15/csu/libc-start.c:226
 
Components: Internals>Network
Owner: ----
Status: Untriaged (was: Assigned)
Reassigning to the networking team to take a look. I think the culprit here is some thread bouncing in content::PlatformNotificationContextImpl's destructor.
Project Member

Comment 2 by bugdroid1@chromium.org, Mar 12 2016

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

commit 4c58f9e1fc9ebfb0fa3b59017ebc56aa8d11f5fb
Author: reillyg <reillyg@chromium.org>
Date: Sat Mar 12 04:52:36 2016

Let LSan know we know that URLRequestContextGetters sometimes leak.

This annotation will silence warnings from LSan.

BUG= 594130 
TBR=cbentzel@chromium.org

Review URL: https://codereview.chromium.org/1792563003

Cr-Commit-Position: refs/heads/master@{#380856}

[modify] https://crrev.com/4c58f9e1fc9ebfb0fa3b59017ebc56aa8d11f5fb/net/url_request/url_request_context_getter.cc

Cc: peter@chromium.org mvanouwe...@chromium.org
Components: -Internals>Network
Moving out of //net - this is an issue with a consumer of //net, not //net itself

Agreed that it looks like it's Push/Notification related.

Comment 4 by peter@chromium.org, Mar 16 2016

How exactly did you reach that suspicion? The test has nothing to do with either, and I see no mentions to any of our classes in the logs.

Push only creates a fetcher when checking the manifest after subscribing. Notifications only fetches data when a notification is being shown; the fetchers are created on demand.

I do see a bunch of references to appcache in the logs.
https://build.chromium.org/p/chromium.memory/builders/Linux%20ASan%20LSan%20Tests%20%281%29/builds/24132/steps/unit_tests%20on%20Ubuntu-12.04/logs/stdio

Direct leak of 72 byte(s) in 1 object(s) allocated from:
    #0 0x73f5bb in operator new(unsigned long) (/tmp/runICzlMU/out/Release/unit_tests+0x73f5bb)
    #1 0x536197a in TestingProfile::CreateRequestContext(std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, linked_ptr<net::URLRequestJobFactory::ProtocolHandler>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, linked_ptr<net::URLRequestJobFactory::ProtocolHandler> > > >*, ScopedVector<net::URLRequestInterceptor>) chrome/test/base/testing_profile.cc:816:10
    #2 0x3c907c8 in ChromeContentBrowserClient::CreateRequestContext(content::BrowserContext*, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, linked_ptr<net::URLRequestJobFactory::ProtocolHandler>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, linked_ptr<net::URLRequestJobFactory::ProtocolHandler> > > >*, ScopedVector<net::URLRequestInterceptor>) chrome/browser/chrome_content_browser_client.cc:1096:10
    #3 0xdbbb221 in content::StoragePartitionImplMap::Get(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&, bool) content/browser/storage_partition_impl_map.cc:465:9
    #4 0xd79a7b6 in GetStoragePartition content/browser/browser_context.cc:193:10
    #5 0xd79a7b6 in content::BrowserContext::GetDefaultStoragePartition(content::BrowserContext*) content/browser/browser_context.cc:226
    #6 0x5361898 in TestingProfile::GetRequestContext() chrome/test/base/testing_profile.cc:810:10
    #7 0x3f66fbd in gcm::GCMProfileServiceFactory::BuildServiceInstanceFor(content::BrowserContext*) const chrome/browser/services/gcm/gcm_profile_service_factory.cc:72:48
    #8 0xee106c7 in BrowserContextKeyedServiceFactory::BuildServiceInstanceFor(base::SupportsUserData*) const components/keyed_service/content/browser_context_keyed_service_factory.cc:94:7
    #9 0x70c2858 in KeyedServiceFactory::GetServiceForContext(base::SupportsUserData*, bool) components/keyed_service/core/keyed_service_factory.cc:91:15
    #10 0x3f66ca1 in gcm::GCMProfileServiceFactory::GetForProfile(content::BrowserContext*) chrome/browser/services/gcm/gcm_profile_service_factory.cc:35:7

Cc: -mvanouwe...@chromium.org
Status: Archived (was: Untriaged)
Archiving issues older than 2 years with no owner or component.

Sign in to add a comment