Skip to content

Relations from/to underlying event particles results in segfault

Since releases after DaVinci v64r13, relations that are made to, for example, child particles to other particles result in a segfault. It works fine when relations are made directly from the particles that are in 'main' particle containers (e.g. /Event/Hlt2/Hlt2Whatever/Particles).

This breaks functionality related to TIS/TOS on persist reco particles and the determination of the tracking efficiencies on data.

#5  0x00007fed860362c0 in DataObject::registry (this=<optimized out>) at /cvmfs/lhcb.cern.ch/lib/lhcb/GAUDI/GAUDI_v39r4/InstallArea/x86_64_v3-el9-gcc13+detdesc-opt+g/include/GaudiKernel/DataObject.h:78
#6  Relations::KeyedObjectTypeTraits<LHCb::Particle>::Less::operator() (this=<optimized out>, rhs=..., lhs=...) at ../Kernel/LHCbKernel/include/Kernel/RelationObjectTypeTraits.h:51
#7  Relations::KeyedObjectTypeTraits<LHCb::Particle>::Less::operator() (rhs=<optimized out>, lhs=0x7fed6cc5bcb0, this=<optimized out>) at ../Kernel/LHCbKernel/include/Kernel/RelationObjectTypeTraits.h:57
#8  Relations::TraitsHelpers::LessByFrom<Relations::KeyedObjectTypeTraits<LHCb::Particle>::Less>::operator()<Relations::WEntry_<LHCb::Particle, LHCb::Particle, float> > (this=<synthetic pointer>, rhs=..., lhs=...) at ../Kernel/Relations/include/Relations/TraitsHelpers.h:54
#9  __gnu_cxx::__ops::_Iter_comp_val<Relations::TraitsHelpers::LessByFrom<Relations::KeyedObjectTypeTraits<LHCb::Particle>::Less> >::operator()<__gnu_cxx::__normal_iterator<Relations::WEntry_<LHCb::Particle, LHCb::Particle, float> const*, std::vector<Relations::WEntry_<LHCb::Particle, LHCb::Particle, float>, std::allocator<Relations::WEntry_<LHCb::Particle, LHCb::Particle, float> > > >, Relations::WEntry_<LHCb::Particle, LHCb::Particle, float> const> (__val=..., __it=..., this=<synthetic pointer>) at /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/13.1.0-b3d18/x86_64-el9/include/c++/13.1.0/bits/predefined_ops.h:196
#10 std::__equal_range<__gnu_cxx::__normal_iterator<Relations::WEntry_<LHCb::Particle, LHCb::Particle, float> const*, std::vector<Relations::WEntry_<LHCb::Particle, LHCb::Particle, float>, std::allocator<Relations::WEntry_<LHCb::Particle, LHCb::Particle, float> > > >, Relations::WEntry_<LHCb::Particle, LHCb::Particle, float>, __gnu_cxx::__ops::_Iter_comp_val<Relations::TraitsHelpers::LessByFrom<Relations::KeyedObjectTypeTraits<LHCb::Particle>::Less> >, __gnu_cxx::__ops::_Val_comp_iter<Relations::TraitsHelpers::LessByFrom<Relations::KeyedObjectTypeTraits<LHCb::Particle>::Less> > > (__comp_val_it=..., __comp_it_val=..., __val=..., __last=..., __first=...) at /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/13.1.0-b3d18/x86_64-el9/include/c++/13.1.0/bits/stl_algo.h:2124
#11 std::equal_range<__gnu_cxx::__normal_iterator<Relations::WEntry_<LHCb::Particle, LHCb::Particle, float> const*, std::vector<Relations::WEntry_<LHCb::Particle, LHCb::Particle, float>, std::allocator<Relations::WEntry_<LHCb::Particle, LHCb::Particle, float> > > >, Relations::WEntry_<LHCb::Particle, LHCb::Particle, float>, Relations::TraitsHelpers::LessByFrom<Relations::KeyedObjectTypeTraits<LHCb::Particle>::Less> > (__comp=..., __val=..., __last=..., __first=...) at /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/13.1.0-b3d18/x86_64-el9/include/c++/13.1.0/bits/stl_algo.h:2216
#12 Relations::RelationWeightedBase<LHCb::Particle, LHCb::Particle, float>::i_relations (this=<optimized out>, object=<optimized out>) at ../Kernel/Relations/include/Relations/RelationWeightedBase.h:119
#13 0x00007fed860368ad in Relations::RelationWeighted<LHCb::Particle, LHCb::Particle, float>::i_relations (object=<optimized out>, this=<optimized out>) at ../Kernel/Relations/include/Relations/RelationWeighted.h:83
#14 LHCb::RelationWeighted1D<LHCb::Particle, LHCb::Particle, float>::i_relations (object=<optimized out>, this=<optimized out>) at ../Kernel/Relations/include/Relations/RelationWeighted1D.h:98
#15 LHCb::RelationWeighted1D<LHCb::Particle, LHCb::Particle, float>::relations (this=<optimized out>, object=<optimized out>) at ../Kernel/Relations/include/Relations/RelationWeighted1D.h:170

With a debug build, one is told:

python: ../Kernel/LHCbKernel/include/Kernel/RelationObjectTypeTraits.h:47: bool Relations::KeyedObjectTypeTraits<Type_>::Less::operator()(const Relations::KeyedObjectTypeTraits<Type_>::Type&, const Relations::KeyedObjectTypeTraits<Type_>::Type&) const [with Type_ = LHCb::Particle; Relations::KeyedObjectTypeTraits<Type_>::Type = LHCb::Particle]: Assertion `rhs.parent() != nullptr' failed.

(and to remind you, these are just the particles from Persist Reco)

Options files are available at https://gitlab.cern.ch/-/snippets/3533

Edited by Laurent Dufour