cmssw icon indicating copy to clipboard operation
cmssw copied to clipboard

[UBSAN][TrackFindingTracklet] shift exponent -1 is negative

Open smuzaffar opened this issue 4 months ago • 9 comments

UBSAN IBs show that we have runtime error [a] coming from if (newalpha >= (1 << (nalphabits - 1))) https://github.com/cms-sw/cmssw/blob/master/L1Trigger/TrackFindingTracklet/src/Stub.cc#L60 . This happens when https://github.com/cms-sw/cmssw/blob/master/L1Trigger/TrackFindingTracklet/src/Stub.cc#L32-L35 condition is false and nalphabits remain 0. @cms-sw/l1-l2 can you please review this code and provide a fix?

[a] https://cmssdt.cern.ch/SDT/jenkins-artifacts/ubsan_logs/CMSSW_14_2_X_2024-10-14-2300/logs/c8/c8317d776207b840ed29d1bc0b023c15/log

23634.0/step2:L1Trigger/TrackFindingTracklet/src/Stub.cc:60:22: runtime error: shift exponent -1 is negative
24034.0/step2:L1Trigger/TrackFindingTracklet/src/Stub.cc:60:22: runtime error: shift exponent -1 is negative
24834.911/step2:L1Trigger/TrackFindingTracklet/src/Stub.cc:60:22: runtime error: shift exponent -1 is negative
25234.0/step2:L1Trigger/TrackFindingTracklet/src/Stub.cc:60:22: runtime error: shift exponent -1 is negative
25634.0/step2:L1Trigger/TrackFindingTracklet/src/Stub.cc:60:22: runtime error: shift exponent -1 is negative

smuzaffar avatar Oct 16 '24 11:10 smuzaffar