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

Fix undefined behavior in TSGFromL2 from empty pointer #35452

Conversation

CeliaFernandez
Copy link
Contributor

PR description:

Fix undefined behavior in TSGFromL2Muon, reported in issue 35036. The issue is caused by the region pointer, which is only initialized if there is a valid theRegionBuilder in the event. The region pointer is then accessed empty in lines 102/104 and 106/108 when given as an input to trackerSeeds() and clean() functions.

To solve this issue, I added a default constructor without parameters for RectangularEtaPhiTrackingRegion and TrackingRegion classes. This makes possible to have a minimal initialization for the region pointer. The default initialization of region is done if theRegionBuilder states to false by adding an else statement in line 93. Then, when the code tries to access it in lines 102/104 and 106/108 region is not an empty pointer anymore.

PR validation:

I verified that the undefined behavior error disappears by running the workflow 11650.0 in CMSSW_12_1_UBSAN_X_2021-09-13-1100 release.

The code have a clean build without errors and pass the basic tests (runTheMatrix.py -l limited -i all --ibeos) when running with CMSSW_12_1_X_2021-09-23-2300. I have also checked out the dependencies and the code format.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-35452/25609

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @CeliaFernandez (Celia Fernández Madrazo) for master.

It involves the following packages:

  • RecoMuon/TrackerSeedGenerator (reconstruction)
  • RecoTracker/TkTrackingRegions (reconstruction)

@jpata, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks.
@sscruz, @jhgoh, @trocino, @calderona, @felicepantaleo, @abbiendi, @GiacomoSguazzoni, @JanFSchulte, @rovere, @VinInn, @bellan, @HuguesBrun, @ebrondol, @Fedespring, @gpetruc, @mmusich, @mtosi, @dgulhan, @cericeci, @rociovilar 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

@slava77
Copy link
Contributor

slava77 commented Sep 28, 2021

@cmsbuild please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-4d0d74/19206/summary.html
COMMIT: 157c420
CMSSW: CMSSW_12_1_X_2021-09-28-1100/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/35452/19206/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: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 40
  • DQMHistoTests: Total histograms compared: 3211080
  • DQMHistoTests: Total failures: 5
  • DQMHistoTests: Total nulls: 1
  • DQMHistoTests: Total successes: 3211052
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: -0.004 KiB( 39 files compared)
  • DQMHistoSizes: changed ( 312.0 ): -0.004 KiB MessageLogger/Warnings
  • Checked 169 log files, 37 edm output root files, 40 DQM output files
  • TriggerResults: no differences found

@slava77
Copy link
Contributor

slava77 commented Oct 5, 2021

+reconstruction

for #35452 157c420

  • code changes are somewhat technical in line with the PR description
    • it looks like the reference to nullptr here is never actually used (otherwise we'd see crashes). The case reported by UBSAN seems related to the line theTkSeedGenerator->trackerSeeds(staCand, *region, tTopo, tkSeeds); where the actual function call TSGFromL2Muon::trackerSeeds execution does not depend on *region.
  • jenkins tests pass and comparisons with the baseline show no (relevant) differences

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 5, 2021

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 Oct 7, 2021

+1

@cmsbuild cmsbuild merged commit 15f50df into cms-sw:master Oct 7, 2021
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