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

NONLTO: Fix use after delete warning for bqueue #43540

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

smuzaffar
Copy link
Contributor

@smuzaffar smuzaffar commented Dec 10, 2023

This should fix the warnings [a] for NONLTO based cmssw IBs. @dan131riley hint here helped to identify the issue. We are passing tail by value and on 2nd iteration copy of tail gets deleted (as its ref count reaches 0).

Locally building this changes for nonlto IB does not trigger this warning

Fixes #42404

[a]

  cmssw/src/TrackingTools/PatternTools/interface/bqueue.h:57:14: warning: pointer used after 'void operator delete(void*, std::size_t)' [-Wuse-after-free]
    57 |       if ((--refCount) == 0)
      |              ^~~~~~~~
In member function 'void cmsutils::_bqueue_item<T>::delRef() [with T = std::unique_ptr<int>]',
    inlined from 'void cmsutils::_bqueue_item<T>::delRef() [with T = std::unique_ptr<int>]' at cmssw/src/TrackingTools/PatternTools/interface/bqueue.h:56:10,
    inlined from 'void cmsutils::intrusive_ptr_release(_bqueue_item<T>*) [with T = std::unique_ptr<int>]' at cmssw/src/TrackingTools/PatternTools/interface/bqueue.h:82:15,
    inlined from 'boost::intrusive_ptr<T>::~intrusive_ptr() [with T = cmsutils::_bqueue_item<std::unique_ptr<int> >]' at boost/smart_ptr/intrusive_ptr.hpp:98:44,
    inlined from 'boost::intrusive_ptr<T>& boost::intrusive_ptr<T>::operator=(boost::intrusive_ptr<T>&&) [with T = cmsutils::_bqueue_item<std::unique_ptr<int> >]' at boost/smart_ptr/intrusive_ptr.hpp:122:9,
    inlined from 'void cmsutils::bqueue<T>::push_back(T&&) [with T = std::unique_ptr<int>]' at cmssw/src/TrackingTools/PatternTools/interface/bqueue.h:169:14:
cmssw/src/TrackingTools/PatternTools/interface/bqueue.h:58:9: note: call to 'void operator delete(void*, std::size_t)' here
   58 |         delete this;

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43540/38118

  • This PR adds an extra 20KB to repository

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

  • RecoTracker/CkfPattern (reconstruction)
  • TrackingTools/PatternTools (reconstruction)

@mandrenguyen, @jfernan2, @cmsbuild can you please review it and eventually sign? Thanks.
@jhgoh, @HuguesBrun, @felicepantaleo, @abbiendi, @rovere, @missirol, @mtosi, @VourMa, @cericeci, @bellan, @JanFSchulte, @trocino, @dgulhan, @GiacomoSguazzoni, @CeliaFernandez, @ebrondol, @mmusich, @gpetruc, @Fedespring, @VinInn, @andrea21z this is something you requested to watch as well.
@rappoccio, @sextonkennedy, @antoniovilela you are the release manager for this.

cms-bot commands are listed here

@smuzaffar
Copy link
Contributor Author

please test

@smuzaffar
Copy link
Contributor Author

please test for CMSSW_14_0_NONLTO_X

@dan131riley
Copy link

@smuzaffar Nice catch!

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-bea475/36398/summary.html
COMMIT: b9474e1
CMSSW: CMSSW_14_0_X_2023-12-10-0000/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/43540/36398/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-bea475/36399/summary.html
COMMIT: b9474e1
CMSSW: CMSSW_14_0_NONLTO_X_2023-12-10-0000/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/43540/36399/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

@jfernan2
Copy link
Contributor

closes #42404

@jfernan2
Copy link
Contributor

+1

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

@rappoccio
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.

[PPC64] Use-after-free in TrackingTools/PatternTools (false-positive?)
5 participants