Memory leaks from using EventLocal and Arena
Running 10k events from UpgradeHLT1FilteredMinbias
using Moore's hlt2_pp_thor
option on x86_64_v2-centos7-gcc10-dbg+alubsan
detects the following memory leaks
@jonrob @graven @chasse @rmatev @sponce
==20436==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 64 byte(s) in 2 object(s) allocated from:
#0 0x7f0d67ca73d7 in operator new(unsigned long) /build/dkonst/gcc-clang/build/contrib/gcc-10.3.0/src/gcc/10.3.0/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f0d086e9119 in std::any::_Manager_external<LHCb::EventContextExtension>::_S_manage(std::any::_Op, std::any const*, std::any::_Arg*) /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/10.3.0-f5826/x86_64-centos7/include/c++/10.3.0/any:604
#2 0x7f0d39f67396 in std::any::any(std::any const&) /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/10.3.0-f5826/x86_64-centos7/include/c++/10.3.0/any:161
#3 0x7f0d39f6746d in std::any::operator=(std::any const&) /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/10.3.0-f5826/x86_64-centos7/include/c++/10.3.0/any:226
#4 0x7f0d39f67d9a in EventContext::operator=(EventContext const&) ../GaudiKernel/include/GaudiKernel/EventContext.h:34
#5 0x7f0d3adeb64b in Gaudi::Hive::setCurrentContext(EventContext const&) ../GaudiKernel/src/Lib/ThreadLocalContext.cpp:43
#6 0x7f0d0871eba4 in operator() ../Hlt/HLTScheduler/src/HLTControlFlowMgr.cpp:628
#7 0x7f0d0875c3ee in operator() ../Hlt/HLTScheduler/src/HLTControlFlowMgr.cpp:309
#8 0x7f0d0875c119 in execute /cvmfs/lhcb.cern.ch/lib/lcg/releases/tbb/2020_U2-daa7e/x86_64-centos7-gcc10-dbg/include/tbb/task.h:1059
#9 0x7f0d5bc01914 in tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::process_bypass_loop(tbb::internal::context_guard_helper<false>&, tbb::task*, long) ../../src/tbb/custom_scheduler.h:474
Indirect leak of 10485760 byte(s) in 1 object(s) allocated from:
#0 0x7f0d67ca73d7 in operator new(unsigned long) /build/dkonst/gcc-clang/build/contrib/gcc-10.3.0/src/gcc/10.3.0/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f0d24eca262 in __gnu_cxx::new_allocator<std::byte>::allocate(unsigned long, void const*) /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/10.3.0-f5826/x86_64-centos7/include/c++/10.3.0/ext/new_allocator.h:115
#2 0x7f0d0889dc0e in std::byte* LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> >::allocate<1ul>(unsigned long) ../Kernel/LHCbKernel/include/Kernel/MonotonicArena.h:120
#3 0x7f0d088494fb in LHCb::Allocators::EventLocal<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState>::allocate(unsigned long) ../Kernel/LHCbKernel/include/Kernel/EventLocalAllocator.h:69
#4 0x7f0d088494fb in std::allocator_traits<LHCb::Allocators::EventLocal<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState> >::allocate(LHCb::Allocators::EventLocal<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState>&, unsigned long) /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/10.3.0-f5826/x86_64-centos7/include/c++/10.3.0/bits/alloc_traits.h:314
#5 0x7f0d0881cbfb in std::_Vector_base<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState, LHCb::Allocators::EventLocal<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState> >::_M_allocate(unsigned long) /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/10.3.0-f5826/x86_64-centos7/include/c++/10.3.0/bits/stl_vector.h:346
#6 0x7f0d087e2963 in void std::vector<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState, LHCb::Allocators::EventLocal<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState> >::_M_range_initialize<__gnu_cxx::__normal_iterator<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState*, std::vector<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState, std::allocator<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState> > > >(__gnu_cxx::__normal_iterator<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState*, std::vector<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState, std::allocator<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState> > >, __gnu_cxx::__normal_iterator<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState*, std::vector<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState, std::allocator<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState> > >, std::forward_iterator_tag) /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/10.3.0-f5826/x86_64-centos7/include/c++/10.3.0/bits/stl_vector.h:1582
#7 0x7f0d087ac4bf in std::vector<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState, LHCb::Allocators::EventLocal<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState> >::vector<__gnu_cxx::__normal_iterator<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState*, std::vector<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState, std::allocator<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState> > >, void>(__gnu_cxx::__normal_iterator<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState*, std::vector<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState, std::allocator<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState> > >, __gnu_cxx::__normal_iterator<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState*, std::vector<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState, std::allocator<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState> > >, LHCb::Allocators::EventLocal<LHCb::Interfaces::ISchedulerConfiguration::State::AlgState> const&) /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/10.3.0-f5826/x86_64-centos7/include/c++/10.3.0/bits/stl_vector.h:657
#8 0x7f0d0871ef92 in operator() ../Hlt/HLTScheduler/src/HLTControlFlowMgr.cpp:637
#9 0x7f0d0875c3ee in operator() ../Hlt/HLTScheduler/src/HLTControlFlowMgr.cpp:309
#10 0x7f0d0875c119 in execute /cvmfs/lhcb.cern.ch/lib/lcg/releases/tbb/2020_U2-daa7e/x86_64-centos7-gcc10-dbg/include/tbb/task.h:1059
#11 0x7f0d5bc01914 in tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::process_bypass_loop(tbb::internal::context_guard_helper<false>&, tbb::task*, long) ../../src/tbb/custom_scheduler.h:474
Indirect leak of 88 byte(s) in 1 object(s) allocated from:
#0 0x7f0d67ca73d7 in operator new(unsigned long) /build/dkonst/gcc-clang/build/contrib/gcc-10.3.0/src/gcc/10.3.0/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x7f0d088e641e in __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> >, std::allocator<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> > >, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/10.3.0-f5826/x86_64-centos7/include/c++/10.3.0/ext/new_allocator.h:115
#2 0x7f0d088d2006 in std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> >, std::allocator<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> > >, (__gnu_cxx::_Lock_policy)2> > >::allocate(std::allocator<std::_Sp_counted_ptr_inplace<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> >, std::allocator<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> > >, (__gnu_cxx::_Lock_policy)2> >&, unsigned long) /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/10.3.0-f5826/x86_64-centos7/include/c++/10.3.0/bits/alloc_traits.h:460
#3 0x7f0d088be5c9 in std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> >, std::allocator<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> > >, (__gnu_cxx::_Lock_policy)2> > > std::__allocate_guarded<std::allocator<std::_Sp_counted_ptr_inplace<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> >, std::allocator<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> > >, (__gnu_cxx::_Lock_policy)2> > >(std::allocator<std::_Sp_counted_ptr_inplace<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> >, std::allocator<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> > >, (__gnu_cxx::_Lock_policy)2> >&) /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/10.3.0-f5826/x86_64-centos7/include/c++/10.3.0/bits/allocated_ptr.h:97
#4 0x7f0d0889b6ad in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> >, std::allocator<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> > >, Gaudi::Property<unsigned long, Gaudi::Details::Property::NullVerifier, Gaudi::Details::Property::UpdateHandler>&>(LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> >*&, std::_Sp_alloc_shared_tag<std::allocator<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> > > >, Gaudi::Property<unsigned long, Gaudi::Details::Property::NullVerifier, Gaudi::Details::Property::UpdateHandler>&) /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/10.3.0-f5826/x86_64-centos7/include/c++/10.3.0/bits/shared_ptr_base.h:680
#5 0x7f0d0886bd43 in std::__shared_ptr<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> >, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> > >, Gaudi::Property<unsigned long, Gaudi::Details::Property::NullVerifier, Gaudi::Details::Property::UpdateHandler>&>(std::_Sp_alloc_shared_tag<std::allocator<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> > > >, Gaudi::Property<unsigned long, Gaudi::Details::Property::NullVerifier, Gaudi::Details::Property::UpdateHandler>&) /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/10.3.0-f5826/x86_64-centos7/include/c++/10.3.0/bits/shared_ptr_base.h:1371
#6 0x7f0d0884830e in std::shared_ptr<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> > >::shared_ptr<std::allocator<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> > >, Gaudi::Property<unsigned long, Gaudi::Details::Property::NullVerifier, Gaudi::Details::Property::UpdateHandler>&>(std::_Sp_alloc_shared_tag<std::allocator<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> > > >, Gaudi::Property<unsigned long, Gaudi::Details::Property::NullVerifier, Gaudi::Details::Property::UpdateHandler>&) /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/10.3.0-f5826/x86_64-centos7/include/c++/10.3.0/bits/shared_ptr.h:408
#7 0x7f0d0881bd91 in std::shared_ptr<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> > > std::allocate_shared<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> >, std::allocator<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> > >, Gaudi::Property<unsigned long, Gaudi::Details::Property::NullVerifier, Gaudi::Details::Property::UpdateHandler>&>(std::allocator<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> > > const&, Gaudi::Property<unsigned long, Gaudi::Details::Property::NullVerifier, Gaudi::Details::Property::UpdateHandler>&) /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/10.3.0-f5826/x86_64-centos7/include/c++/10.3.0/bits/shared_ptr.h:860
#8 0x7f0d087e0a97 in std::shared_ptr<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> > > std::make_shared<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> >, Gaudi::Property<unsigned long, Gaudi::Details::Property::NullVerifier, Gaudi::Details::Property::UpdateHandler>&>(Gaudi::Property<unsigned long, Gaudi::Details::Property::NullVerifier, Gaudi::Details::Property::UpdateHandler>&) /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/10.3.0-f5826/x86_64-centos7/include/c++/10.3.0/bits/shared_ptr.h:876
#9 0x7f0d087ab677 in LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> >* LHCb::EventContextExtension::emplaceMemResource<LHCb::Arena::Monotonic<64ul, std::allocator<std::byte> >, Gaudi::Property<unsigned long, Gaudi::Details::Property::NullVerifier, Gaudi::Details::Property::UpdateHandler>&>(Gaudi::Property<unsigned long, Gaudi::Details::Property::NullVerifier, Gaudi::Details::Property::UpdateHandler>&) ../Kernel/LHCbKernel/include/Kernel/EventContextExt.h:54
#10 0x7f0d0871eb43 in operator() ../Hlt/HLTScheduler/src/HLTControlFlowMgr.cpp:619
#11 0x7f0d0875c3ee in operator() ../Hlt/HLTScheduler/src/HLTControlFlowMgr.cpp:309
#12 0x7f0d0875c119 in execute /cvmfs/lhcb.cern.ch/lib/lcg/releases/tbb/2020_U2-daa7e/x86_64-centos7-gcc10-dbg/include/tbb/task.h:1059
#13 0x7f0d5bc01914 in tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::process_bypass_loop(tbb::internal::context_guard_helper<false>&, tbb::task*, long) ../../src/tbb/custom_scheduler.h:474
SUMMARY: AddressSanitizer: 10485912 byte(s) leaked in 4 allocation(s).