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 memory leak in SimpleDAFHitCollector #9043
Fix memory leak in SimpleDAFHitCollector #9043
Conversation
The new TrackingRecHit created from the call to rightdimension() was never deleted since SiTrackerMultiRecHitUpdator does not take ownership of the hits passed to it. Corrected the problem by using std::unique_ptr.
A new Pull Request was created by @Dr15Jones (Chris Jones) for CMSSW_7_5_X. Fix memory leak in SimpleDAFHitCollector It involves the following packages: RecoTracker/SiTrackerMRHTools @cmsbuild, @cvuosalo, @nclopezo, @slava77 can you please review it and eventually sign? Thanks. |
please test |
The tests are being triggered in jenkins. |
+1 The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic: |
+1 Bug fix in SimpleDAFHitCollector. Should not change monitored quantities. The code changes are satisfactory, and Jenkins tests against baseline CMSSW_7_5_X_2015-05-10-2300 show no significant differences, as expected. The extra PRs included by Jenkins (see Jenkins result message above) have added some extraneous DQM differences unrelated to this PR. |
This pull request is fully signed and it will be integrated in one of the next CMSSW_7_5_X IBs unless changes (tests are also fine). This pull request requires discussion in the ORP meeting before it's merged. @davidlange6, @nclopezo, @smuzaffar |
+1 |
…llector Fix memory leak in SimpleDAFHitCollector
While tracing down a false postive thread-safety problem 'identified' by the static analyzer [const function returning a non-const pointer] I discovered a memory leak.
The newly created hit returned from
SimpleDAFHitCollector::rightdimension()
were stored in astd::vector
of const pointers. That vector was passed toSiTrackerMultiRecHitUpdator
which passes each individual entry toTransientTrackingRecHitBuilder::build()
which then clones the hit. The original hit was never deleted.Both the false positive and the memory leak were fixed by using
std::unique_ptr<>