Memory Leak in Relations Code
I've been cleaning up the sanitizer builds a bit. I am seeing a number of memory leaks in a number of the Brunel and Moore tests, that all have basically the same form.
Direct leak of 440 byte(s) in 5 object(s) allocated from:
#0 0x7f49cd936333 in operator new(unsigned long) /build/gcc/build/contrib/gcc-9.2.0/src/gcc/9.2.0/libsanitizer/lsan/lsan_interceptors.cc:222
#1 0x7f4994173bad in std::_MakeUniq<LHCb::Relation1D<LHCb::Event::v1::Track, float> >::__single_object std::make_unique<LHCb::Relation1D<LHCb::Event::v1::Track, float>, LHCb::Relation1D<LHCb::Event::v1::Track, float> >(LHCb::Relation1D<LHCb::Event::v1::Track, float>&&) /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/9.2.0-afc57/x86_64-centos7/include/c++/9.2.0/bits/unique_ptr.h:849
#2 0x7f4994173bad in LHCb::Relation1D<LHCb::Event::v1::Track, float>* Gaudi::Functional::details::put<LHCb::Relation1D<LHCb::Event::v1::Track, float>, LHCb::Relation1D<LHCb::Event::v1::Track, float>, void>(DataObjectHandle<LHCb::Relation1D<LHCb::Event::v1::Track, float> > const&, LHCb::Relation1D<LHCb::Event::v1::Track, float>&&) /usera/jonesc/LHCbCMake/Feature/Gaudi/InstallArea/x86_64-centos7-gcc9-dbg+lsan/include/GaudiAlg/FunctionalDetails.h:148
#3 0x7f49941a2de3 in Gaudi::Functional::details::Transformer<LHCb::Relation1D<LHCb::Event::v1::Track, float> (LHCb::Relation1D<LHCb::Event::v1::Track, float> const&), Gaudi::Functional::Traits::use_<>, true>::execute() (/usera/jonesc/LHCbCMake/Feature/Rec/InstallArea/x86_64-centos7-gcc9-dbg+lsan/lib/libCaloFuturePIDs.so+0x31ede3)
#4 0x7f49ae26684e in Gaudi::details::LegacyAlgorithmAdapter::execute(EventContext const&) const /usera/jonesc/LHCbCMake/Feature/Gaudi/InstallArea/x86_64-centos7-gcc9-dbg+lsan/include/GaudiKernel/Algorithm.h:48
#5 0x7f49aded8278 in Gaudi::Algorithm::sysExecute(EventContext const&) ../GaudiKernel/src/Lib/Algorithm.cpp:363
#6 0x7f49acbcb4df in GaudiAlgorithm::sysExecute(EventContext const&) ../GaudiAlg/src/lib/GaudiAlgorithm.cpp:117
See
https://www.hep.phy.cam.ac.uk/~jonesc/lhcb/QMTests/Saved/FunctionalCaloRelationLeaks/Brunel
https://www.hep.phy.cam.ac.uk/~jonesc/lhcb/QMTests/Saved/FunctionalCaloRelationLeaks/Moore
for the full list.
Unfortunately the traceback is not quite good enough to point to the exact line of code, but it appears to be something related to either the Calo, Relations or the Functional framework. Or some combination of these. Because of this I'm starting out assigning this to @graven and @sponce, please could you take a look and see what you think. Maybe valgrind or some other check will give more details ?