Multithreaded analysis doesn't seem to recognize null initialization of TH1D objects

I am concerned by a warning that I get when trying to run a multithreaded analysis.

The warning is:

Warning in <TOutputListSelectorDataMap::SetDataMembers()>: potential memory leak: replacing data member `h_ar1_bar_dts' != 0. Please initialize h_ar1_bar_dts to 0 in constructor PDune_MuLifeV20::PDune_MuLifeV20()

I am doing an analysis with a TSelector and TPROOF.

The obvious answer is to do what it says in the warning and initalize the histogram pointer with null, which I do.

   class PDune_MuLifeV20 : public TSelector {
       public :
           TTreeReader     fReader;  //!the tree reader
           TTree          *fChain = 0;   //!pointer to the analyzed TTree or TChain
   
           // Readers to access the data (delete the ones you do not need).
           TTreeReaderArray<ana::smtrec> tracks = {fReader, "tracks"};
   
           TH1D* h_dts;
           TH1D* h_bar_dts;
           TH1D* h_ar1_bar_dts;
           TH1D* h_ar2_bar_dts;
           TH1D* h_ham_bar_dts;
           TH1D* h_sens_bar_dts;
           TH1D* h_firstHitJitter;
           TH1D* h_dts_differentBars;
           TH1D* h_dts_differentBarsPESpectrum;
           TH1D* h_dts_failed;
           TH1D* h_dts_failedSpectrum;
           TH1D* h_dts_spectrum;
           //std::map<int, TH1D*> map_bar_hists;
           /* TList* map_bar_hists; */
           TObjArray* map_bar_hists;
   
     
           //TH1D* h_dts=0;
           //TH1D* h_bar_dts=0;
           //TH1D* h_ar1_bar_dts=0;
           //TH1D* h_ar2_bar_dts=0;
           //TH1D* h_ham_bar_dts=0;
           //TH1D* h_sens_bar_dts=0;
           //TH1D* h_firstHitJitter=0;
           //TH1D* h_dts_differentBars=0;
           //TH1D* h_dts_differentBarsPESpectrum=0;
           //TH1D* h_dts_failed=0;
           //TH1D* h_dts_failedSpectrum=0;
           //TH1D* h_dts_spectrum=0;
           ////std::map<int, TH1D*> map_bar_hists;
           ///* TList* map_bar_hists=0; */
           //TObjArray* map_bar_hists=0;
   
   
   
           PDune_MuLifeV20(TTree * /*tree*/ =0):
               h_dts(0), h_bar_dts(0), h_ar1_bar_dts(0),
               h_ar2_bar_dts(0), h_ham_bar_dts(0),
               h_sens_bar_dts(0), h_firstHitJitter(0),
               h_dts_differentBars(0), h_dts_differentBarsPESpectrum(0),
               h_dts_failed(0), h_dts_failedSpectrum(0),
               h_dts_spectrum(0), map_bar_hists(0)
       {  }

The histogram definitions occure in SlaveBegin(). am very unsure how this could show up as non-null to the nodes, and any advice from someone with more experience with TPROOF than me would be very welcome.


Please read tips for efficient and successful posting and posting code

ROOT Version: 6.18/04
Platform: Fedora
Compiler: Not Provided


@ganis can you help?

Hi,

Is there only one warning for that member or for the others as well?
The constructor has an unused argument: I wonder if that has any effect.
Can you try with a real default constructor, i.e. removing the unused argument?

G Ganis

There is only one warning, but if I remove that object from the module, then the warning moves onto another TH1D, so it is consistent, and appears to always be the first initialized that complains.

I will try modifying the constructor later this evening and will get back to you with the result.

Hi Ganis,

Sorry for the late response, but I have tested the unit without the unused argument.

Edit: I am revising my previous response, as I mistakenly tested without PROOF at first. The error, as stated earlier, only happens when using PROOF.

I have tested without the unused argument, but the issue persists.

-Warning in <TOutputListSelectorDataMap::SetDataMembers()>: potential memory leak: replacing data member `h_dts' != 0. Please initialize h_dts to 0 in constructor PDune_MuLifeV28::PDune_MuLifeV28()
Have Reached Terminate
Lite-0: all output objects have been merged                                                         

This topic is going stale, but I have no resolution to the issue posted. What are the prescribed next steps in diagnosing this problem?