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
HBHE M2 = fix Memory Leak #17821
HBHE M2 = fix Memory Leak #17821
Conversation
A new Pull Request was created by @mariadalfonso for master. It involves the following packages: RecoLocalCalo/HcalRecAlgos @perrotta, @cmsbuild, @slava77, @davidlange6 can you please review it and eventually sign? Thanks. cms-bot commands are listed here #13028 |
|
||
// initialize for every different channel types (HPD vs SiPM) | ||
|
||
if (!(&ps == currentPulseShape_ && isHPD == isCurrentChannelHPD_)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both "currentPulseShape_" and "isCurrentChannelHPD_" are used uninitialized here
Maria, please initialize currentPulseShape_ in the constructor to nullptr. You also do need to fix the memory leak. Replace the line |
@igv4321 , fixed as you suggested, is ok now ? |
Pull request #17821 was updated. @perrotta, @cmsbuild, @slava77, @davidlange6 can you please check and sign again. |
This will work |
@cmsbuild please test |
The tests are being triggered in jenkins. |
spfunctor_ = new ROOT::Math::Functor(psfPtr_.get(),&FitterFuncs::PulseShapeFunctor::singlePulseShapeFunc, 3); | ||
dpfunctor_ = new ROOT::Math::Functor(psfPtr_.get(),&FitterFuncs::PulseShapeFunctor::doublePulseShapeFunc, 5); | ||
tpfunctor_ = new ROOT::Math::Functor(psfPtr_.get(),&FitterFuncs::PulseShapeFunctor::triplePulseShapeFunc, 7); | ||
delete spfunctor_; spfunctor_ = new ROOT::Math::Functor(psfPtr_.get(),&FitterFuncs::PulseShapeFunctor::singlePulseShapeFunc, 3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you changed *functor_
to be std::unique_ptr<ROOT::Math::Functor>
this would automatically handle deleting both here and in the destructor.
Comparison job queued. |
spfunctor_ = new ROOT::Math::Functor(psfPtr_.get(),&FitterFuncs::PulseShapeFunctor::singlePulseShapeFunc, 3); | ||
dpfunctor_ = new ROOT::Math::Functor(psfPtr_.get(),&FitterFuncs::PulseShapeFunctor::doublePulseShapeFunc, 5); | ||
tpfunctor_ = new ROOT::Math::Functor(psfPtr_.get(),&FitterFuncs::PulseShapeFunctor::triplePulseShapeFunc, 7); | ||
spfunctor_ = std::unique_ptr<ROOT::Math::Functor>( new ROOT::Math::Functor(psfPtr_.get(),&FitterFuncs::PulseShapeFunctor::singlePulseShapeFunc, 3) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you like, you could save yourself some typing by doing
spfunctor_ = std::make_unique<ROOT::Math::Functor>(psfPtr_.get(),&FitterFuncs::PulseShapeFunctor::singlePulseShapeFunc, 3);
The move to |
Comparison job queued. |
Still "isCurrentChannelHPD_" is used uninitialized at line (now) 280 of PulseShapeFitOOTPileupCorrection.cc |
It is initialized on line 285. Good enough because in the expression A && B, B is never executed if A is false, and on the first comparison &ps == currentPulseShape_ is false (ps is a reference, so &ps is not a null pointer). |
@mariadalfonso @igv4321 |
You are welcome to take a look at /uscms_data/d3/pedrok/hf/reco/CMSSW_8_4_0/src/10024.0_TTbar_13+TTbar_13TeV_TuneCUETP8M1_2017_GenSimFull+DigiFull_2017+RecoFull_2017+ALCAFull_2017+HARVESTFull_2017/log_valgrind1.log |
Thank you @igv4321 : could you please copy the valgrind report on afs, or somewhere else publicly accessible? |
@perrotta: /afs/cern.ch/user/p/pedrok/public/log_valgrind1.log |
The valgrind log pointed to this problem as well: #17861 |
On 3/9/17 9:20 AM, Chris Jones wrote:
The valgrind log pointed to this problem as well: #17861
<#17861>
Other than this BasicHepMC and the massive leak in M2 fixed here,
I haven't noticed anything that will grow with the number of events.
…
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#17821 (comment)>, or
mute the thread
<https://github.com/notifications/unsubscribe-auth/AEdcblV2yHQwiLmKc0bEyi48IrNPMtlsks5rkDTogaJpZM4MWhy8>.
|
+1 |
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 requires discussion in the ORP meeting before it's merged. @Muzaffar, @davidlange6, @smuzaffar |
+1 |
No changes are expected at relVal level
@igv4321 @kpedro88 : please check