Hi Philippe,
Thanks for the advice. I tried that, but I have issues interpreting the output from valgrind. When I get stack traces looking like this, is my code to be blamed or valgrind is finding memory leaks in the ROOT code?
==31403== Invalid read of size 8
==31403== at 0xA9B47C4: __strspn_sse42 (smmintrin.h:628)
==31403== by 0xADD09E8: TROOT::GetType(char const*, bool) const (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xAE42F12: TClass::GetClass(char const*, bool, bool) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xAE44C26: TClass::AddRule(char const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xAE44E04: (anonymous namespace)::ReadRulesContent(_IO_FILE*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xAE44FCD: TClass::ReadRules() (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xADD648C: TROOT::TROOT(char const*, char const*, void (**)()) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xADD68A3: ROOT::GetROOT() (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xADD692F: global constructors keyed to TROOT.cxx (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xB1C3535: ??? (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xAD7198A: ??? (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0x7FF00026C: ???
==31403== by 0x666E6F632E656D: ???
==31403== by 0x3D485441504E414C: ???
==31403== by 0x7265632F7366612E: ???
==31403== by 0x2F77732F68632E6D: ???
==31403== by 0x2F7070612F67636B: ???
==31403== by 0x73657361656C6571: ???
==31403== by 0x2E352F544F4F522E: ???
==31403== by 0x782F6330302E3831: ???
==31403== Address 0xee03da8 is 40 bytes inside a block of size 45 alloc'd
==31403== at 0x4C27A6C: calloc (vg_replace_malloc.c:467)
==31403== by 0x4E32030: operator new(unsigned long) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libNew.so)
==31403== by 0x4E324B8: operator new[](unsigned long) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libNew.so)
==31403== by 0xADD83B3: TStringRef::GetRep(int, int) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xADDA2F6: TString::TString(std::string const&) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xAE5AAE0: ROOT::TSchemaRule::SetFromRule(char const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xAE44BD5: TClass::AddRule(char const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xAE44E04: (anonymous namespace)::ReadRulesContent(_IO_FILE*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xAE44FCD: TClass::ReadRules() (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xADD648C: TROOT::TROOT(char const*, char const*, void (**)()) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xADD68A3: ROOT::GetROOT() (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xADD692F: global constructors keyed to TROOT.cxx (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xB1C3535: ??? (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xAD7198A: ??? (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0x7FF00026C: ???
==31403== by 0x666E6F632E656D: ???
==31403== by 0x3D485441504E414C: ???
==31403== by 0x7265632F7366612E: ???
==31403== by 0x2F77732F68632E6D: ???
==31403== by 0x2F7070612F67636B: ???
==31403==
.... execution of my code.....
==31403== Invalid read of size 8
==31403== at 0xA9B47C4: __strspn_sse42 (smmintrin.h:628)
==31403== by 0xADD09E8: TROOT::GetType(char const*, bool) const (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xAE42F12: TClass::GetClass(char const*, bool, bool) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xADCFEE8: TROOT::IgnoreInclude(char const*, char const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0x5129FC8: G__loadfile (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCint.so)
==31403== by 0x51745E9: G__process_cmd (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCint.so)
==31403== by 0xAE2E250: TCint::ProcessLine(char const*, TInterpreter::EErrorCode*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xAE2BDD2: TCint::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xAD8ADD8: TApplication::ExecuteFile(char const*, int*, bool) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xAE2C972: TCint::ExecuteMacro(char const*, TInterpreter::EErrorCode*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xADD361E: TROOT::Macro(char const*, int*, bool) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xADBA6DA: TPluginManager::LoadHandlerMacros(char const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xADBAAA4: TPluginManager::LoadHandlersFromPluginDirs(char const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xADBB599: TPluginManager::FindHandler(char const*, char const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xAE06A38: TVirtualFFT::FFT(int, int*, char const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0x623DBAB: TH1::FFT(TH1*, char const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libHist.so)
==31403== by 0x47C39C: hilber_analysis(GLI::RTDR&, RIS::RTDR const&, std::pair<int, int>&) (in /home/arobic/FSI_code/fsianalysis/trunk/FSIAnalysis/fsi)
==31403== by 0x47E501: analyzeFourier(RIS::RTDR&, GLI::Collection<std::vector, std::allocator>&, int) (in /home/arobic/FSI_code/fsianalysis/trunk/FSIAnalysis/fsi)
==31403== by 0x40634D: main (in /home/arobic/FSI_code/fsianalysis/trunk/FSIAnalysis/fsi)
==31403== Address 0x1ca1fe18 is 40 bytes inside a block of size 47 alloc'd
==31403== at 0x4C27A6C: calloc (vg_replace_malloc.c:467)
==31403== by 0x4E32030: operator new(unsigned long) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libNew.so)
==31403== by 0x4E324B8: operator new[](unsigned long) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libNew.so)
==31403== by 0xADD83B3: TStringRef::GetRep(int, int) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xADDA3BF: TString::TString(char const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xADCFED7: TROOT::IgnoreInclude(char const*, char const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0x5129FC8: G__loadfile (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCint.so)
==31403== by 0x51745E9: G__process_cmd (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCint.so)
==31403== by 0xAE2E250: TCint::ProcessLine(char const*, TInterpreter::EErrorCode*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xAE2BDD2: TCint::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xAD8ADD8: TApplication::ExecuteFile(char const*, int*, bool) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xAE2C972: TCint::ExecuteMacro(char const*, TInterpreter::EErrorCode*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xADD361E: TROOT::Macro(char const*, int*, bool) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xADBA6DA: TPluginManager::LoadHandlerMacros(char const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xADBAAA4: TPluginManager::LoadHandlersFromPluginDirs(char const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xADBB599: TPluginManager::FindHandler(char const*, char const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xAE06A38: TVirtualFFT::FFT(int, int*, char const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0x623DBAB: TH1::FFT(TH1*, char const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libHist.so)
==31403== by 0x47C39C: hilber_analysis(GLI::RTDR&, RIS::RTDR const&, std::pair<int, int>&) (in /home/arobic/FSI_code/fsianalysis/trunk/FSIAnalysis/fsi)
==31403== by 0x47E501: analyzeFourier(RIS::RTDR&, GLI::Collection<std::vector, std::allocator>&, int) (in /home/arobic/FSI_code/fsianalysis/trunk/FSIAnalysis/fsi)
==31403==
==31403== Invalid read of size 8
==31403== at 0xA9B47C4: __strspn_sse42 (smmintrin.h:628)
==31403== by 0xADD09E8: TROOT::GetType(char const*, bool) const (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xADBB95B: TPluginHandler::ExecPlugin(int, ...) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xAE06A6F: TVirtualFFT::FFT(int, int*, char const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0x623DBAB: TH1::FFT(TH1*, char const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libHist.so)
==31403== by 0x47C39C: hilber_analysis(GLI::RTDR&, RIS::RTDR const&, std::pair<int, int>&) (in /home/arobic/FSI_code/fsianalysis/trunk/FSIAnalysis/fsi)
==31403== by 0x47E501: analyzeFourier(RIS::RTDR&, GLI::Collection<std::vector, std::allocator>&, int) (in /home/arobic/FSI_code/fsianalysis/trunk/FSIAnalysis/fsi)
==31403== by 0x40634D: main (in /home/arobic/FSI_code/fsianalysis/trunk/FSIAnalysis/fsi)
==31403== Address 0x26a1a1c0 is 32 bytes inside a block of size 39 alloc'd
==31403== at 0x4C27A6C: calloc (vg_replace_malloc.c:467)
==31403== by 0x4E32030: operator new(unsigned long) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libNew.so)
==31403== by 0x4E324B8: operator new[](unsigned long) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libNew.so)
==31403== by 0xADD83B3: TStringRef::GetRep(int, int) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xADDA3BF: TString::TString(char const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xADBB945: TPluginHandler::ExecPlugin(int, ...) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0xAE06A6F: TVirtualFFT::FFT(int, int*, char const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libCore.so)
==31403== by 0x623DBAB: TH1::FFT(TH1*, char const*) (in /afs/cern.ch/sw/lcg/app/releases/ROOT/5.28.00c/x86_64-slc5-gcc43-opt/root/lib/libHist.so)
==31403== by 0x47C39C: hilber_analysis(GLI::RTDR&, RIS::RTDR const&, std::pair<int, int>&) (in /home/arobic/FSI_code/fsianalysis/trunk/FSIAnalysis/fsi)
==31403== by 0x47E501: analyzeFourier(RIS::RTDR&, GLI::Collection<std::vector, std::allocator>&, int) (in /home/arobic/FSI_code/fsianalysis/trunk/FSIAnalysis/fsi)
==31403== by 0x40634D: main (in /home/arobic/FSI_code/fsianalysis/trunk/FSIAnalysis/fsi)
The doc I read about valgrind mentionned that it was always preferable to fix issues pointed out by valgrind in the order they were showing up in the output, as the first ones might cause the later ones. The errors shown above are the first ones listed, but I don’t know what to do with them. Any insight?
Thanks.
Andrée