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

[GCC13][AlCa] Avoid storing reference to a temporary object #45728

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

iarspider
Copy link
Contributor

PR description:

In GCC13 IBs, compiler warns about "possibly dangling reference to a temporary":

src/Alignment/OfflineValidation/plugins/PixelBaryCentreAnalyzer.cc: In member function 'virtual void PixelBaryCentreAnalyzer::analyze(const edm::Event&, const edm::EventSetup&)':
  src/Alignment/OfflineValidation/plugins/PixelBaryCentreAnalyzer.cc:262:27: warning: possibly dangling reference to a temporary [-Wdangling-reference]
   262 |     const AlignTransform& glbCoord = align::DetectorGlobalPosition(iSetup.getData(gprToken_), DetId(DetId::Tracker));
      |                           ^~~~~~~~
src/Alignment/OfflineValidation/plugins/PixelBaryCentreAnalyzer.cc:262:67: note: the temporary was destroyed at the end of the full expression 'align::DetectorGlobalPosition((* &(& iSetup)->edm::EventSetup::getData<Alignments, GlobalPositionRcd>(((PixelBaryCentreAnalyzer*)this)->PixelBaryCentreAnalyzer::gprToken_)), DetId(((uint32_t)DetId::Tracker)))'
  262 |     const AlignTransform& glbCoord = align::DetectorGlobalPosition(iSetup.getData(gprToken_), DetId(DetId::Tracker));
      |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

A similar warning was fixed by getting rid of rerference, and since AlignTransform looks cheap to copy I followed the same approach.

PR validation:

Bot tests.

@iarspider
Copy link
Contributor Author

please test for el9_amd64_gcc13

@cmsbuild
Copy link
Contributor

cmsbuild commented Aug 17, 2024

cms-bot internal usage

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

  • Alignment/OfflineValidation (alca)

@consuegs, @perrotta, @saumyaphor4252 can you please review it and eventually sign? Thanks.
@adewit, @mmusich, @rsreds, @tlampen, @tocheng, @yuanchao this is something you requested to watch as well.
@antoniovilela, @mandrenguyen, @rappoccio, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

@iarspider
Copy link
Contributor Author

please test
test for production arch as well

@cmsbuild
Copy link
Contributor

+1

Size: This PR adds an extra 20KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b65045/40981/summary.html
COMMIT: e1b4925
CMSSW: CMSSW_14_1_X_2024-08-16-2300/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/45728/40981/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b65045/40979/summary.html
COMMIT: e1b4925
CMSSW: CMSSW_14_1_X_2024-08-16-2300/el9_amd64_gcc13
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/45728/40979/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 270 lines to the logs
  • ROOTFileChecks: Some differences in event products or their sizes found
  • Reco comparison results: 61767 differences found in the comparisons
  • DQMHistoTests: Total files compared: 45
  • DQMHistoTests: Total histograms compared: 3422510
  • DQMHistoTests: Total failures: 364286
  • DQMHistoTests: Total nulls: 373
  • DQMHistoTests: Total successes: 3057831
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 5.620999999999999 KiB( 44 files compared)
  • DQMHistoSizes: changed ( 10224.0 ): -0.544 KiB SiStrip/MechanicalView
  • DQMHistoSizes: changed ( 13034.0 ): 2.776 KiB SiStrip/MechanicalView
  • DQMHistoSizes: changed ( 140.043 ): -0.004 KiB JetMET/SUSYDQM
  • DQMHistoSizes: changed ( 250202.181 ): 0.234 KiB SiStrip/MechanicalView
  • DQMHistoSizes: changed ( 25202.0 ): 0.719 KiB SiStrip/MechanicalView
  • DQMHistoSizes: changed ( 7.3 ): 2.702 KiB SiStrip/MechanicalView
  • DQMHistoSizes: changed ( 8.0 ): -0.262 KiB SiStrip/MechanicalView
  • Checked 196 log files, 165 edm output root files, 45 DQM output files

@perrotta
Copy link
Contributor

+1

  • AlignTransform is just a few doubles overall: ok for the copy (even though it is not cleat to me, by looking at the code, which is the reference that remains dangling...)

@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, @mandrenguyen, @sextonkennedy, @antoniovilela (and backports should be raised in the release meeting by the corresponding L2)

@mandrenguyen
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit f529d2a into cms-sw:master Aug 19, 2024
17 checks passed
@Dr15Jones
Copy link
Contributor

I'm pretty certain this is a false positive.

@iarspider iarspider deleted the iarspider-patch-20240817-1 branch August 19, 2024 14:16
@iarspider
Copy link
Contributor Author

@Dr15Jones most likely.

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