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

ASAN: protection against accessing invalid memory when ieta==0 #31595

Merged
merged 1 commit into from Sep 29, 2020
Merged

ASAN: protection against accessing invalid memory when ieta==0 #31595

merged 1 commit into from Sep 29, 2020

Conversation

smuzaffar
Copy link
Contributor

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-31595/18650

  • This PR adds an extra 12KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @smuzaffar (Malik Shahzad Muzaffar) for master.

It involves the following packages:

RecoHI/HiJetAlgos

@perrotta, @jpata, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks.
@yslai, @jazzitup, @yenjie, @kurtejung, @mandrenguyen, @dgulhan, @yetkinyilmaz this is something you requested to watch as well.
@silviodonato, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@smuzaffar
Copy link
Contributor Author

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 27, 2020

The tests are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

+1
Tested at: 9b9b963
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-f397e3/9600/summary.html
CMSSW: CMSSW_11_2_X_2020-09-26-1100
SCRAM_ARCH: slc7_amd64_gcc820

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-f397e3/9600/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 35
  • DQMHistoTests: Total histograms compared: 2539438
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2539415
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 34 files compared)
  • Checked 149 log files, 22 edm output root files, 35 DQM output files

@perrotta
Copy link
Contributor

ieta=0 can only happen if a tower is filled [1] by one single particle wich has exactly eta=0., whose ieta=0 value is then returned by the function eta2ieta(0.).

It would be interesting to investigate with the debug where such a particle with eta=0. comes out... In any case, it looks to me closer to the spirit of this code assigning to eta the value of the middle pseudorapidity of the innermost tower (i.e. the one with ieta=1) in that case.

This could be achieved by reverting the change proposed here for the ieta2eta function, and rather modify the eta2ieta function above by initializing ieta at line 129 as:

  int ieta = 1;

What do you think @smuzaffar and @mandrenguyen ?

[1]

@smuzaffar
Copy link
Contributor Author

@perrotta , setting ieta=1 will change the behaviour but I let you and @mandrenguyen decide

@mandrenguyen
Copy link
Contributor

Thanks for the fix. I agree with @perrotta

@perrotta
Copy link
Contributor

@perrotta , setting ieta=1 will change the behaviour but I let you and @mandrenguyen decide

Not really. If we start by ieta=0 (as it is now) in

while (xeta > hi::etaedge[ieta] && ieta < ietaMax - 1) {
one checks if xeta > hi::etaedge[0] (i.e. xeta > 0.), which is always true except the pathological case xeta==0. which we want to cure with this PR. Then the flow passes to ieta=1 and continues as I suggest.

Therefore, the different behaviour with respect to the present code is only there when xeta==0.:

  • with the present code in that case there is the crash you are reporting
  • with wath you propose in that case ieta2eta returns 0.
  • with what I propose ieta2eta returns the middle pseudorapidity of the innermost tower, as for every other point wich has 0 < xeta < hi::etaedge[1]

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@smuzaffar
Copy link
Contributor Author

ok, I have update the PR as suggested here #31595 (comment)

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-31595/18668

  • This PR adds an extra 12KB to repository

@cmsbuild
Copy link
Contributor

Pull request #31595 was updated. @perrotta, @jpata, @cmsbuild, @slava77 can you please check and sign again.

@perrotta
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 29, 2020

The tests are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

+1
Tested at: d979bcd
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-f397e3/9635/summary.html
CMSSW: CMSSW_11_2_X_2020-09-28-2300
SCRAM_ARCH: slc7_amd64_gcc820

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-f397e3/9635/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 35
  • DQMHistoTests: Total histograms compared: 2539438
  • DQMHistoTests: Total failures: 7
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2539409
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 34 files compared)
  • Checked 149 log files, 22 edm output root files, 35 DQM output files

@perrotta
Copy link
Contributor

+1

  • Fixed the pathological case in which there are towers made by particles at eta=0
  • Jenkins tests pass

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

@silviodonato
Copy link
Contributor

+1

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

5 participants