cmssw icon indicating copy to clipboard operation
cmssw copied to clipboard

Fix memory leaks in L1 tracking found with Valgrind

Open tomalin opened this issue 3 weeks ago • 11 comments

PR description:

The branch used for this PR was derived from CMSSW_16_0_X_2025-12-02-1100 .

The fixes here are memory leaks and undefined variables in the L1 tracking code discovered using valgrind. The hope is that this PR may prevent the crash reported in https://github.com/cms-sw/cmssw/issues/49535 , although this is not proven. The valgrind command used was the following. This was done for the HYBRID, HYBRID_DISPLACED & HYBRID_NEWKF L1 tracking algorithms.

valgrind --track-origins=yes --leak-check=full --show-leak-kinds=definite --suppressions=${ROOTSYS}/etc/valgrind-root.supp --suppressions=$CMSSW_RELEASE_BASE/src/Utilities/ReleaseScripts/data/cms-valgrind-memcheck.supp cmsRun L1TrackNtupleMaker_cfg.py >&! valgrind.out

A LogError message has also been added to the site of the crash reported in the issue, so that if it happens again, more diagnostic info will be available.

The L1 tracking performance is unchanged according to the L1 track summary performance printout.

tomalin avatar Dec 04 '25 16:12 tomalin

cms-bot internal usage

cmsbuild avatar Dec 04 '25 17:12 cmsbuild

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-49550/47064

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

  • code-format: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-49550/47064/code-format.patch e.g. curl -k https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-49550/47064/code-format.patch | patch -p1 You can also run scram build code-format to apply code format directly

cmsbuild avatar Dec 04 '25 17:12 cmsbuild

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-49550/47066

cmsbuild avatar Dec 04 '25 19:12 cmsbuild

Pull request #49550 was updated.

cmsbuild avatar Dec 04 '25 19:12 cmsbuild

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-49550/47072

cmsbuild avatar Dec 05 '25 00:12 cmsbuild

Pull request #49550 was updated.

cmsbuild avatar Dec 05 '25 00:12 cmsbuild

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-49550/47080

cmsbuild avatar Dec 05 '25 14:12 cmsbuild

Pull request #49550 was updated.

cmsbuild avatar Dec 05 '25 14:12 cmsbuild

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

It involves the following packages:

  • L1Trigger/TrackFindingTMTT (l1)
  • L1Trigger/TrackFindingTracklet (l1)
  • L1Trigger/TrackTrigger (l1)

@BenjaminRS, @cmsbuild, @quinnanm can you please review it and eventually sign? Thanks. @Martin-Grunewald, @erikbutz, @missirol, @mmusich, @skinnari, @sviret this is something you requested to watch as well. @ftenchini, @mandrenguyen, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

cmsbuild avatar Dec 05 '25 14:12 cmsbuild

please test

quinnanm avatar Dec 06 '25 16:12 quinnanm

+1

Size: This PR adds an extra 16KB to repository Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-ff2cc5/49829/summary.html COMMIT: b9bd3a8a17b8d5bf6dd0a55e2452dfabc6038b43 CMSSW: CMSSW_16_0_X_2025-12-06-1100/el8_amd64_gcc13 User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/49550/49829/install.sh to create a dev area with all the needed externals and cmssw changes.

DAS Queries: The DAS query tests failed, see the summary page for details.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • ROOTFileChecks: Some differences in event products or their sizes found
  • Reco comparison results: 4 differences found in the comparisons
  • Reco comparison had 4 failed jobs
  • DQMHistoTests: Total files compared: 53
  • DQMHistoTests: Total histograms compared: 4273241
  • DQMHistoTests: Total failures: 88
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 4273133
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 52 files compared)
  • Checked 227 log files, 198 edm output root files, 53 DQM output files
  • TriggerResults: no differences found

cmsbuild avatar Dec 06 '25 18:12 cmsbuild

Milestone for this pull request has been moved to CMSSW_16_1_X. Please open a backport if it should also go in to CMSSW_16_0_X.

cmsbuild avatar Dec 18 '25 13:12 cmsbuild

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-49550/47254

  • There are other open Pull requests which might conflict with changes you have proposed:
    • File L1Trigger/TrackFindingTracklet/plugins/L1FPGATrackProducer.cc modified in PR(s): #49565
    • File L1Trigger/TrackFindingTracklet/src/TripletEngineUnit.cc modified in PR(s): #49628
    • File L1Trigger/TrackFindingTracklet/test/L1TrackNtupleMaker.cc modified in PR(s): #49565

cmsbuild avatar Dec 22 '25 16:12 cmsbuild

Pull request #49550 was updated. @BenjaminRS, @cmsbuild, @quinnanm can you please check and sign again.

cmsbuild avatar Dec 22 '25 16:12 cmsbuild