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

L1T: address issue 36647 with int overrun #37487

Merged
merged 1 commit into from
Apr 26, 2022

Conversation

cecilecaillol
Copy link
Contributor

PR description:

Fixes undefined behavior from int overruns. Addressing issue #36647

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 7, 2022

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-37487/29190

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 7, 2022

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

It involves the following packages:

  • L1Trigger/GlobalCaloTrigger (l1)

@epalencia, @cmsbuild, @cecilecaillol, @rekovic can you please review it and eventually sign? Thanks.
@Martin-Grunewald, @missirol this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@cecilecaillol
Copy link
Contributor Author

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 7, 2022

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-a56297/23727/summary.html
COMMIT: bcca82f
CMSSW: CMSSW_12_4_X_2022-04-07-1100/slc7_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/37487/23727/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 48
  • DQMHistoTests: Total histograms compared: 3593039
  • DQMHistoTests: Total failures: 2
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3593015
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 47 files compared)
  • Checked 200 log files, 45 edm output root files, 48 DQM output files
  • TriggerResults: no differences found

@cecilecaillol
Copy link
Contributor Author

+l1

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 8, 2022

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. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2)

@perrotta
Copy link
Contributor

perrotta commented Apr 8, 2022

@cecilecaillol did you check that this PR actually fixes the issue?
At a first sight, it just moves it to etComponentSum...

@cecilecaillol
Copy link
Contributor Author

@perrotta How can I check if the PR fixes the issue?

@perrotta
Copy link
Contributor

perrotta commented Apr 8, 2022

@perrotta How can I check if the PR fixes the issue?

@Dr15Jones opened #36647, perhaps he can provide some suggestion

@perrotta
Copy link
Contributor

hold
(while waiting for the confirmation that the fix as implemented is effective)

@cmsbuild
Copy link
Contributor

Pull request has been put on hold by @perrotta
They need to issue an unhold command to remove the hold state or L1 can unhold it for all

@perrotta
Copy link
Contributor

perrotta commented Apr 22, 2022

@cecilecaillol any suggestion about how to proceed here?

@cecilecaillol
Copy link
Contributor Author

@perrotta I can make etComponentSum a long int too, but I still dont know how to check if this will actually solve the problem.

@perrotta
Copy link
Contributor

@Dr15Jones @smuzaffar @makortel : can any of you suggest us how to run UBSAN on the proposed fix, so that it can be verified its effectiveness (or further adjust, if needed) before merging it?

@smuzaffar
Copy link
Contributor

please test for CMSSW_12_4_UBSAN_X
this is run relval for UBSAN and then one can check workflow 1000.0/step2 if this has fixed the ubsan issues

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-a56297/24219/summary.html
COMMIT: bcca82f
CMSSW: CMSSW_12_4_UBSAN_X_2022-04-25-1100/slc7_amd64_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/37487/24219/install.sh to create a dev area with all the needed externals and cmssw changes.

@smuzaffar
Copy link
Contributor

so looks like it does fix the L1Trigger/GlobalCaloTrigger/src/L1GctJetFinderBase.cc:580:19: runtime error: signed integer overflow: 268432611 * 157 cannot be represented in type 'int' issue. Though there are only issues e.g. DQM/L1TMonitor/src/L1TGMT.cc:205:40: runtime error: signed integer overflow: 15991514 * 3564 cannot be represented in type 'int' but workfow 1000.0/step2 is now clean of #36647

@Dr15Jones
Copy link
Contributor

@perrotta as Shahzad has shown, if you create a build area from one of the UBSAN IBs

scram project CMSSW_12_4_UBSAN_X_2022-04-25-1100

then build and run the RelVal workflow

runTheMatrix -l 1000.0

you should get the full UBSAN report.

@perrotta
Copy link
Contributor

Thank you @smuzaffar and @Dr15Jones!

So, this fixes the issue. My concern about etComponentSum also extending above the int size was then wrong, at least for this particular example.

What I overlooked is that at line

etComponentSum = ((rotatedValue0 + rotatedValue1) + halfInputLsb) >> bitsToShift;
there is a right shift of bitsToShift bits, which is evidently enough to reenter in the int size

@perrotta
Copy link
Contributor

+1

@perrotta
Copy link
Contributor

unhold

@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 be automatically merged.

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.

5 participants