Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UBSAN] Fix shift exponent 64 is too large for 32-bit #44803

Merged

Conversation

smuzaffar
Copy link
Contributor

In UBSAN IBs, we have runtime errors like [a]. This PR proposes the following changes

  • No need to have std::vector<int> EcalFenixTcpFgvbEE::indexLut_ to keep track on temp indexLut
  • No need to do any processing if EcalFenixTcpFgvbEE::fgee_lut_==0
  • For nStr>0, (nStr<<5) will be >=32 causing 1<<indexLut to have undefined dehaviour (shifting more than the size of the integer is undefined behavior)
  • Cleanup unnecessary constructor/destructor

[a] https://cmssdt.cern.ch/SDT/cgi-bin/buildlogs/raw/el8_amd64_gcc12/CMSSW_14_1_UBSAN_X_2024-04-19-2300/pyRelValMatrixLogs/run/5.1_TTbarFS/step1_TTbarFS.log

src/SimCalorimetry/EcalTrigPrimAlgos/src/EcalFenixTcpFgvbEE.cc:31:18: runtime error: shift exponent 64 is too large for 32-bit type 'int'
    #0 0x154723ca8350 in EcalFenixTcpFgvbEE::process(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, int, int, std::vector<int, std::allocator<int> >&) src/SimCalorimetry/EcalTrigPrimAlgos/src/EcalFenixTcpFgvbEE.cc:31
    #1 0x154723d57ec9 in EcalFenixTcp::process_part2_endcap(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, int, int, int, EcalTPGLutGroup const*, EcalTPGLutIdMap const*, EcalTPGFineGrainTowerEE const*, EcalTPGTowerStatus const*, std::vector<EcalTriggerPrimitiveSample, std::allocator<EcalTriggerPrimitiveSample> >&, std::vector<EcalTriggerPrimitiveSample, std::allocator<EcalTriggerPrimitiveSample> >&, bool, EcalTrigTowerDetId) src/SimCalorimetry/EcalTrigPrimAlgos/src/EcalFenixTcp.cc:229
    #2 0x154723d5d16d in EcalFenixTcp::process(std::vector<EEDataFrame, std::allocator<EEDataFrame> >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, int, std::vector<EcalTriggerPrimitiveSample, std::allocator<EcalTriggerPrimitiveSample> >&, std::vector<EcalTriggerPrimitiveSample, std::allocator<EcalTriggerPrimitiveSample> >&, bool, EcalTrigTowerDetId) src/SimCalorimetry/EcalTrigPrimAlgos/src/EcalFenixTcp.cc:96

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 22, 2024

cms-bot internal usage

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-44803/40049

  • This PR adds an extra 16KB to repository

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-44803/40050

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @smuzaffar for master.

It involves the following packages:

  • SimCalorimetry/EcalTrigPrimAlgos (l1)

@epalencia, @cmsbuild, @aloeliger can you please review it and eventually sign? Thanks.
@wang0jin, @rchatter, @thomreis, @argiro, @sameasy, @ReyerBand, @missirol, @valsdav, @rovere this is something you requested to watch as well.
@antoniovilela, @sextonkennedy, @rappoccio you are the release manager for this.

cms-bot commands are listed here

@smuzaffar
Copy link
Contributor Author

please test

@smuzaffar
Copy link
Contributor Author

please test for CMSSW_14_1_UBSAN_X

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-a68b95/39007/summary.html
COMMIT: f63d9ea
CMSSW: CMSSW_14_1_X_2024-04-22-1100/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/44803/39007/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 6 lines to the logs
  • Reco comparison results: 42 differences found in the comparisons
  • DQMHistoTests: Total files compared: 48
  • DQMHistoTests: Total histograms compared: 3319852
  • DQMHistoTests: Total failures: 3
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3319829
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 47 files compared)
  • Checked 202 log files, 165 edm output root files, 48 DQM output files
  • TriggerResults: no differences found

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-a68b95/39008/summary.html
COMMIT: f63d9ea
CMSSW: CMSSW_14_1_UBSAN_X_2024-04-19-2300/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/44803/39008/install.sh to create a dev area with all the needed externals and cmssw changes.

@aloeliger
Copy link
Contributor

+l1

  • technical change

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @rappoccio, @sextonkennedy, @antoniovilela (and backports should be raised in the release meeting by the corresponding L2)

@antoniovilela
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 3900d5f into cms-sw:master Apr 24, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants