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

Potential memory leak in FastSim TrackerSimHitProducer #23795

Closed
kpedro88 opened this issue Jul 14, 2018 · 5 comments
Closed

Potential memory leak in FastSim TrackerSimHitProducer #23795

kpedro88 opened this issue Jul 14, 2018 · 5 comments

Comments

@kpedro88
Copy link
Contributor

Reported by valgrind:

new PSimHit(entry, exit, localMomentum.mag(), tof, eLoss, pdgId,

The PSimHit returned by fastsim::TrackerSimHitProducer::createHitOnDetector() is allocated with new. It gets stored in a map here:

std::pair<double, PSimHit*> hitPair = createHitOnDetector(particleState, pdgId, layer.getThickness(particle.position()), energyDeposit, simTrackId, detector, positionOutside);

And then copied by value into the container:

This implies the original new'd object is never deleted. It would be better to move around the PSimHit using smart pointers.

@kpedro88
Copy link
Contributor Author

assign fastsim

@cmsbuild
Copy link
Contributor

New categories assigned: fastsim

@mdhildreth,@ssekmen,@lveldere,@civanch you have been requested to review this Pull request/Issue and eventually sign? Thanks

@cmsbuild
Copy link
Contributor

A new Issue was created by @kpedro88 Kevin Pedro.

@davidlange6, @Dr15Jones, @smuzaffar, @fabiocos, @kpedro88 can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

@kpedro88
Copy link
Contributor Author

kpedro88 commented Aug 2, 2018

@ssekmen @skurz this should be addressed before the 2017 fastsim workflow is put into production

@kpedro88
Copy link
Contributor Author

kpedro88 commented Sep 1, 2018

addressed by #24210

@kpedro88 kpedro88 closed this as completed Sep 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants