cms-sw / cmssw

CMS Offline Software
http://cms-sw.github.io/
Apache License 2.0
1.08k stars 4.3k forks source link

[UBSAN][CSCTriggerPrimitives] shift exponent 4294967295 is too large #46406

Open smuzaffar opened 1 hour ago

smuzaffar commented 1 hour ago

UBSAN IBs show that we have runtime error [a] coming from return (data_[layer][channel] >> bx) & 1; at https://github.com/cms-sw/cmssw/blob/master/L1Trigger/CSCTriggerPrimitives/src/PulseArray.cc#L34 . [b] shows that it was generated from https://github.com/cms-sw/cmssw/blob/master/L1Trigger/CSCTriggerPrimitives/src/CSCAnodeLCTProcessor.cc#L688-L694 when first_bx_layer become 0.

@cms-sw/l1-l2 , can you please review this code and provide a fix ( may be loop should terminate at first_bx_layer==0)?

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

1001.2/step2:L1Trigger/CSCTriggerPrimitives/src/PulseArray.cc:34:33: runtime error: shift exponent 4294967295 is too large for 32-bit type 'unsigned int'
1001.3/step2:L1Trigger/CSCTriggerPrimitives/src/PulseArray.cc:34:33: runtime error: shift exponent 4294967295 is too large for 32-bit type 'unsigned int'
1001.4/step2:L1Trigger/CSCTriggerPrimitives/src/PulseArray.cc:34:33: runtime error: shift exponent 4294967295 is too large for 32-bit type 'unsigned int'
1002.4/step2:L1Trigger/CSCTriggerPrimitives/src/PulseArray.cc:34:33: runtime error: shift exponent 4294967295 is too large for 32-bit type 'unsigned int'

[b]

    #0 0x1473828e011b in PulseArray::oneShotAtBX(unsigned int, unsigned int, unsigned int) const src/L1Trigger/CSCTriggerPrimitives/src/PulseArray.cc:34
    #1 0x1473829462c5 in CSCAnodeLCTProcessor::patternDetection(int, std::map<int, std::map<int, std::vector<std::vector<unsigned short, std::allocator<unsigned short> >, std::allocator<std::vector<unsigned short, std::allocator<unsigned short> > > >, std::less<int>, std::allocator<std::pair<int const, std::vector<std::vector<unsigned short, std::allocator<unsigned short> >, std::allocator<std::vector<unsigned short, std::allocator<unsigned short> > > > > > >, std::less<int>, std::allocator<std::pair<int const, std::map<int, std::vector<std::vector<unsigned short, std::allocator<unsigned short> >, std::allocator<std::vector<unsigned short, std::allocator<unsigned short> > > >, std::less<int>, std::allocator<std::pair<int const, std::vector<std::vector<unsigned short, std::allocator<unsigned short> >, std::allocator<std::vector<unsigned short, std::allocator<unsigned short> > > > > > > > > >&) src/L1Trigger/CSCTriggerPrimitives/src/CSCAnodeLCTProcessor.cc:690
    #2 0x14738294d352 in CSCAnodeLCTProcessor::run(std::vector<int, std::allocator<int> > const (*) [119]) src/L1Trigger/CSCTriggerPrimitives/src/CSCAnodeLCTProcessor.cc:306
    #3 0x147382958c1c in CSCAnodeLCTProcessor::run(MuonDigiCollection<CSCDetId, CSCWireDigi> const*, CSCChamber const*) src/L1Trigger/CSCTriggerPrimitives/src/CSCAnodeLCTProcessor.cc:266
smuzaffar commented 1 hour ago

assign L1Trigger/CSCTriggerPrimitives

cmsbuild commented 1 hour ago

New categories assigned: l1

@aloeliger,@epalencia you have been requested to review this Pull request/Issue and eventually sign? Thanks

cmsbuild commented 1 hour ago

cms-bot internal usage

cmsbuild commented 1 hour ago

A new Issue was created by @smuzaffar.

@Dr15Jones, @antoniovilela, @makortel, @mandrenguyen, @rappoccio, @sextonkennedy, @smuzaffar can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here