Skip to content

EventPacker: Add protection in LHCb::Packer::subrange for corrupt first/last indices

See #376

Currently the track cluster unpacking has no protection for corrupt data, leading seg. faults seen in the 2024 sprucing productions.

This MR adds sanity checks, and if corruption is detected an exception is thrown, which allows the application to skip that event, and if configured to do so carry on to the next event. E.g. with the sprucing (which allows a number of single event errors to be skipped) gives

EventSelector                       SUCCESS Reading Event record 15341. Record number within stream 1: 15341
Unpack_Hlt2__Event_HLT2_Rec_Trac...   FATAL  Standard std::exception is caught 
Unpack_Hlt2__Event_HLT2_Rec_Trac...   ERROR LHCb::Packer::subrange: Container='std::vector<LHCb::PackedFTLiteCluster,std::allocator<LHCb::PackedFTLiteCluster> >' ( size 12589 ) Bad Indices: first=0 last=35244813
HLTControlFlowMgr                     FATAL Event failed in Node TrackUnpacker/Unpack_Hlt2__Event_HLT2_Rec_Track_Ttrack
HLTControlFlowMgr                     FATAL Event 42 on slot 0 failed!
EventSelector                       SUCCESS Reading Event record 15351. Record number within stream 1: 15351

instead of the previous seg. fault.

Protection is added to LHCb::Packer::subrange so anywhere using that is covered.

Edited by Christopher Rob Jones

Merge request reports

Loading