New issue
Advanced search Search tips

Issue 595953 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2016
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Memory leak in SparseHistogramTest

Project Member Reported by osh...@chromium.org, Mar 18 2016

Issue description

Started on
https://build.chromium.org/p/chromium.memory.fyi/builders/Linux%20Tests%20%28valgrind%29%285%29/builds/40662

bcwhite@, I'm guessing this is due to your CL ( https://codereview.chromium.org/1719363002), but that's probably expected.

I know it's not in blame list, but blamelist is not always correct, and I couldn't find anything else that looks suspicious. 

Let me know if you're going to revert this soon, and I'll leave it for now. Otherwise I'll suppress it, so please revert the suppression as well when you revert your change.

And if you're going to land it again, I'd appreciate if you can include the suppression as well.

### BEGIN MEMORY TOOL REPORT (error hash=#FAE3364782E8A797#)
Command: /mnt/data/b/build/slave/chromium-rel-linux-valgrind-tests-5/build/src/out/Release/base_unittests --gtest_print_time --single-process-tests --gtest_filter=-base::ObserverListThreadSafeTest.FLAKY_CrossThreadObserver:SecurityTest.FLAKY_NewOverflow:base::ObserverListThreadSafeTest.CrossThreadObserver:TimerTest.RepeatingTimer_Cancel:SecurityTest.NewOverflow:WatchdogTest.FLAKY_AlarmTest:TimerTest.FAILS_RepeatingTimer:PlatformFile.FAILS_TouchGetInfoPlatformFile:PlatformFile.TouchGetInfoPlatformFile:ConditionVariableTest.FLAKY_LargeFastTaskTest:WatchdogTest.FAILS_AlarmTest:base::ObserverListThreadSafeTest.CrossThreadNotifications:ConditionVariableTest.FAILS_LargeFastTaskTest:OutOfMemoryHandledTest.Unchecked*:WatchdogTest.AlarmTest:ClipboardTest.*:TCMallocTest.*:TimerTest.FLAKY_RepeatingTimer:OutOfMemoryDeathTest.*:TimerTest.RepeatingTimer:ConditionVariableTest.LargeFastTaskTest:TCMallocFreeTest.*:PlatformFile.FLAKY_TouchGetInfoPlatformFile:base::ObserverListThreadSafeTest.FLAKY_CrossThreadNotifications:OutOfMemoryHandledTest.FAILS_Unchecked*:TimerTest.FLAKY_RepeatingTimer_Cancel:base::ObserverListThreadSafeTest.FAILS_CrossThreadObserver:TimerTest.FAILS_RepeatingTimer_Cancel:base::ObserverListThreadSafeTest.FAILS_CrossThreadNotifications:SecurityTest.FAILS_NewOverflow:OutOfMemoryHandledTest.FLAKY_Unchecked* --test-tiny-timeout=1000
Leak_DefinitelyLost
6,248 (48 direct, 6,200 indirect) bytes in 1 blocks are definitely lost in loss record 2,736 of 2,769
  operator new(unsigned long) (m_replacemalloc/vg_replace_malloc.c:1140)
  __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<int const, int*> > >::allocate(unsigned long, void const*) (build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/ext/new_allocator.h:92)
  std::_Rb_tree<int, std::pair<int const, int*>, std::_Select1st<std::pair<int const, int*> >, std::less<int>, std::allocator<std::pair<int const, int*> > >::_M_get_node() (/mnt/data/b/build/slave/chromium-rel-linux-valgrind-tests-5/build/src/out/Release/base_unittests)
  _ZNSt8_Rb_treeIiSt4pairIKiPiESt10_Select1stIS3_ESt4lessIiESaIS3_EE14_M_create_nodeIJS3_EEEPSt13_Rb_tree_nodeIS3_EDpOT_ (build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_tree.h:402)
  std::_Rb_tree_iterator<std::pair<int const, int*> > std::_Rb_tree<int, std::pair<int const, int*>, std::_Select1st<std::pair<int const, int*> >, std::less<int>, std::allocator<std::pair<int const, int*> > >::_M_insert_<std::pair<int const, int*> >(std::_Rb_tree_node_base const*, std::_Rb_tree_node_base const*, std::pair<int const, int*>&&) (build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_tree.h:971)
  std::pair<std::_Rb_tree_iterator<std::pair<int const, int*> >, bool> std::_Rb_tree<int, std::pair<int const, int*>, std::_Select1st<std::pair<int const, int*> >, std::less<int>, std::allocator<std::pair<int const, int*> > >::_M_insert_unique<std::pair<int const, int*> >(std::pair<int const, int*>&&) (build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_tree.h:1285)
  std::_Rb_tree_iterator<std::pair<int const, int*> > std::_Rb_tree<int, std::pair<int const, int*>, std::_Select1st<std::pair<int const, int*> >, std::less<int>, std::allocator<std::pair<int const, int*> > >::_M_insert_unique_<std::pair<int const, int*> >(std::_Rb_tree_const_iterator<std::pair<int const, int*> >, std::pair<int const, int*>&&) (build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_tree.h:1340)
  std::_Rb_tree_iterator<std::pair<int const, int*> > std::map<int, int*, std::less<int>, std::allocator<std::pair<int const, int*> > >::insert<std::pair<int const, int*>, void>(std::_Rb_tree_const_iterator<std::pair<int const, int*> >, std::pair<int const, int*>&&) (/mnt/data/b/build/slave/chromium-rel-linux-valgrind-tests-5/build/src/out/Release/base_unittests)
  std::map<int, int*, std::less<int>, std::allocator<std::pair<int const, int*> > >::operator[](int const&) (build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_map.h:453)
  base::PersistentSampleMap::ImportSamples(int) (base/metrics/persistent_sample_map.cc:250)
  base::PersistentSampleMap::GetOrCreateSampleCountStorage(int) (base/metrics/persistent_sample_map.cc:209)
  base::PersistentSampleMap::Accumulate(int, int) (base/metrics/persistent_sample_map.cc:113)
  base::SparseHistogram::AddCount(int, int) (base/metrics/sparse_histogram.cc:120)
  base::SparseHistogram::Add(int) (base/metrics/sparse_histogram.cc:110)
  base::SparseHistogramTest_FactoryTime_Test::TestBody() (base/metrics/sparse_histogram_unittest.cc:272)
Suppression (error hash=#FAE3364782E8A797#):
  For more info on using suppressions see http://dev.chromium.org/developers/tree-sheriffs/sheriff-details-chromium/memory-sheriff#TOC-Suppressing-memory-reports
{
   <insert_a_suppression_name_here>
   Memcheck:Leak
   fun:_Znw*
   fun:_ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKiPiEEE8allocateEmPKv
   fun:_ZNSt8_Rb_treeIiSt4pairIKiPiESt10_Select1stIS3_ESt4lessIiESaIS3_EE11_M_get_nodeEv
   fun:_ZNSt8_Rb_treeIiSt4pairIKiPiESt10_Select1stIS3_ESt4lessIiESaIS3_EE14_M_create_nodeIJS3_EEEPSt13_Rb_tree_nodeIS3_EDpOT_
   fun:_ZNSt8_Rb_treeIiSt4pairIKiPiESt10_Select1stIS3_ESt4lessIiESaIS3_EE10_M_insert_IS3_EESt17_Rb_tree_iteratorIS3_EPKSt18_Rb_tree_node_baseSF_OT_
   fun:_ZNSt8_Rb_treeIiSt4pairIKiPiESt10_Select1stIS3_ESt4lessIiESaIS3_EE16_M_insert_uniqueIS3_EES0_ISt17_Rb_tree_iteratorIS3_EbEOT_
   fun:_ZNSt8_Rb_treeIiSt4pairIKiPiESt10_Select1stIS3_ESt4lessIiESaIS3_EE17_M_insert_unique_IS3_EESt17_Rb_tree_iteratorIS3_ESt23_Rb_tree_const_iteratorIS3_EOT_
   fun:_ZNSt3mapIiPiSt4lessIiESaISt4pairIKiS0_EEE6insertIS5_vEESt17_Rb_tree_iteratorIS5_ESt23_Rb_tree_const_iteratorIS5_EOT_
   fun:_ZNSt3mapIiPiSt4lessIiESaISt4pairIKiS0_EEEixERS4_
   fun:_ZN4base19PersistentSampleMap13ImportSamplesEi
   fun:_ZN4base19PersistentSampleMap29GetOrCreateSampleCountStorageEi
   fun:_ZN4base19PersistentSampleMap10AccumulateEii
   fun:_ZN4base15SparseHistogram8AddCountEii
   fun:_ZN4base15SparseHistogram3AddEi
   fun:_ZN4base36SparseHistogramTest_FactoryTime_Test8TestBodyEv
}
 
Status: Started (was: Assigned)
Wouldn't be that CL but likely this one:
https://codereview.chromium.org/1734033003/

I'll take a look.
There exists:

{
   Intentional leak for SampleMap (stores SparseHistogram counts).
   Memcheck:Leak
   ...
   fun:_ZN4base9SampleMap10AccumulateEii
   ...
   fun:_ZN4base15SparseHistogram*
}


There needs to be an equivalent one for PersistentSampleMap.

Status: Fixed (was: Started)
Problem not happening right now so CL submission has been put on-hold.  Submit if it occurs again (which I think it should).

Project Member

Comment 5 by bugdroid1@chromium.org, Mar 21 2016

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

commit 57597255afebdd27c91fed38acd385d3a9dd73e3
Author: bcwhite <bcwhite@chromium.org>
Date: Mon Mar 21 20:04:16 2016

Supress memory-leak warning on PersistentSampleMap.

BUG= 595953 

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

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

[modify] https://crrev.com/57597255afebdd27c91fed38acd385d3a9dd73e3/tools/valgrind/memcheck/suppressions.txt

Sign in to add a comment