TTree based class with vector (CallRecursiveRemoveIfNeeded in delete, coming back)

Bonjour !

Coming back to you for an issue, that I opened in June but which has been closed, awaiting from opinion from pcanal or Axel (see here : TTree based class with vector (CallRecursiveRemoveIfNeeded in delete) - #3 by jbb ). In short, in my derived TTree class I’ve a large bunch of conditionnal jumps when running valgrind with g++ 7.1.1 that are not shown when using g++ 5.1.1.

I’m reopening this, has moving from 6.14.00 to 6.14.06, has brought me a nice reduction of warning/memleak/complains from valgrind, but these one remain.

I’ve reproduced the behaviour thanks to a toy model. The idea is that i’m creating a tree-based class to handle our data. I’m creating branches with different types (double, string, vector). In this class I’m allocating the memory myself but when i delete an instance of this class with g++ 7.1.1 (not with 5.1.1) i got the log shown below once run with valgrind.

I’m joining to this a piece of code that reproduce this behaviour (MyTreeBasedClass.C). On g++ 7.1.1, once compiled as follow

g++ -g -o JBBtest MyTreeBasedClass.C root-config --cflags --evelibs

I run valgrind like this

valgrind --leak-check=full --suppressions=${ROOTSYS}/etc/valgrind-root.supp --show-possibly-lost=no ./JBBtest

And here is the results… Any hints will be more than welcome…
The question is should I mask these if I want a clean output or am I doing something stupid ? (highly probable :stuck_out_tongue: )
cheers
jb

The log:

==19572== Memcheck, a memory error detector
==19572== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==19572== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==19572== Command: ./JBBtest
==19572== 
==19572== Conditional jump or move depends on uninitialised value(s)
==19572==    at 0x6AC6577: CallRecursiveRemoveIfNeeded (TROOT.h:401)
==19572==    by 0x6AC6577: TObject::~TObject() (TObject.cxx:84)
==19572==    by 0x8E5300C: ~TConfiguredAction (TStreamerInfoActions.h:114)
==19572==    by 0x8E5300C: _Destroy<TStreamerInfoActions::TConfiguredAction> (stl_construct.h:98)
==19572==    by 0x8E5300C: __destroy<TStreamerInfoActions::TConfiguredAction*> (stl_construct.h:108)
==19572==    by 0x8E5300C: _Destroy<TStreamerInfoActions::TConfiguredAction*> (stl_construct.h:132)
==19572==    by 0x8E5300C: _Destroy<TStreamerInfoActions::TConfiguredAction*, TStreamerInfoActions::TConfiguredAction> (stl_construct.h:196)
==19572==    by 0x8E5300C: ~vector (stl_vector.h:434)
==19572==    by 0x8E5300C: ~TActionSequence (TStreamerInfoActions.h:179)
==19572==    by 0x8E5300C: ~TActionSequence (TStreamerInfoActions.h:181)
==19572==    by 0x8E5300C: TBranchElement::SetActionSequence(TClass*, TStreamerInfo*, TStreamerInfoActions::TActionSequence::SequencePtr (*)(TStreamerInfo*, TVirtualCollectionProxy*, TClass*), TStreamerInfoActions::TActionSequence*&) (TBranchElement.cxx:5430)
==19572==    by 0x8E55515: TBranchElement::InitInfo() (TBranchElement.cxx:2379)
==19572==    by 0x8E60111: TBranchElement::GetInfoImp() const (TBranchElement.cxx:996)
==19572==    by 0x8E5657D: TBranchElement::SetAddress(void*) (TBranchElement.cxx:4849)
==19572==    by 0x8EA8E4F: TTree::BronchExec(char const*, char const*, void*, bool, int, int) (TTree.cxx:2396)
==19572==    by 0x8E922A7: TTree::Bronch(char const*, char const*, void*, int, int) (TTree.cxx:2277)
==19572==    by 0x40929D: TBranch* TTree::Branch<std::vector<double, std::allocator<double> > >(char const*, char const*, std::vector<double, std::allocator<double> >**, int, int) (TTree.h:330)
==19572==    by 0x40847C: MyClass::MyClass(char const*, char const*) (MyTreeBasedClass.C:33)
==19572==    by 0x4084C9: main (MyTreeBasedClass.C:42)
==19572== 
==19572== Conditional jump or move depends on uninitialised value(s)
==19572==    at 0x6AC6577: CallRecursiveRemoveIfNeeded (TROOT.h:401)
==19572==    by 0x6AC6577: TObject::~TObject() (TObject.cxx:84)
==19572==    by 0x8E5300C: ~TConfiguredAction (TStreamerInfoActions.h:114)
==19572==    by 0x8E5300C: _Destroy<TStreamerInfoActions::TConfiguredAction> (stl_construct.h:98)
==19572==    by 0x8E5300C: __destroy<TStreamerInfoActions::TConfiguredAction*> (stl_construct.h:108)
==19572==    by 0x8E5300C: _Destroy<TStreamerInfoActions::TConfiguredAction*> (stl_construct.h:132)
==19572==    by 0x8E5300C: _Destroy<TStreamerInfoActions::TConfiguredAction*, TStreamerInfoActions::TConfiguredAction> (stl_construct.h:196)
==19572==    by 0x8E5300C: ~vector (stl_vector.h:434)
==19572==    by 0x8E5300C: ~TActionSequence (TStreamerInfoActions.h:179)
==19572==    by 0x8E5300C: ~TActionSequence (TStreamerInfoActions.h:181)
==19572==    by 0x8E5300C: TBranchElement::SetActionSequence(TClass*, TStreamerInfo*, TStreamerInfoActions::TActionSequence::SequencePtr (*)(TStreamerInfo*, TVirtualCollectionProxy*, TClass*), TStreamerInfoActions::TActionSequence*&) (TBranchElement.cxx:5430)
==19572==    by 0x8E5551D: TBranchElement::InitInfo() (TBranchElement.cxx:2380)
==19572==    by 0x8E60111: TBranchElement::GetInfoImp() const (TBranchElement.cxx:996)
==19572==    by 0x8E5657D: TBranchElement::SetAddress(void*) (TBranchElement.cxx:4849)
==19572==    by 0x8EA8E4F: TTree::BronchExec(char const*, char const*, void*, bool, int, int) (TTree.cxx:2396)
==19572==    by 0x8E922A7: TTree::Bronch(char const*, char const*, void*, int, int) (TTree.cxx:2277)
==19572==    by 0x40929D: TBranch* TTree::Branch<std::vector<double, std::allocator<double> > >(char const*, char const*, std::vector<double, std::allocator<double> >**, int, int) (TTree.h:330)
==19572==    by 0x40847C: MyClass::MyClass(char const*, char const*) (MyTreeBasedClass.C:33)
==19572==    by 0x4084C9: main (MyTreeBasedClass.C:42)
==19572== 
Object name is Test
==19572== Conditional jump or move depends on uninitialised value(s)
==19572==    at 0x6AC6577: CallRecursiveRemoveIfNeeded (TROOT.h:401)
==19572==    by 0x6AC6577: TObject::~TObject() (TObject.cxx:84)
==19572==    by 0x8E4E34C: ~TConfiguredAction (TStreamerInfoActions.h:114)
==19572==    by 0x8E4E34C: _Destroy<TStreamerInfoActions::TConfiguredAction> (stl_construct.h:98)
==19572==    by 0x8E4E34C: __destroy<TStreamerInfoActions::TConfiguredAction*> (stl_construct.h:108)
==19572==    by 0x8E4E34C: _Destroy<TStreamerInfoActions::TConfiguredAction*> (stl_construct.h:132)
==19572==    by 0x8E4E34C: _Destroy<TStreamerInfoActions::TConfiguredAction*, TStreamerInfoActions::TConfiguredAction> (stl_construct.h:196)
==19572==    by 0x8E4E34C: ~vector (stl_vector.h:434)
==19572==    by 0x8E4E34C: ~TActionSequence (TStreamerInfoActions.h:179)
==19572==    by 0x8E4E34C: ~TActionSequence (TStreamerInfoActions.h:181)
==19572==    by 0x8E4E34C: TBranchElement::~TBranchElement() (TBranchElement.cxx:978)
==19572==    by 0x8E4E758: TBranchElement::~TBranchElement() (TBranchElement.cxx:983)
==19572==    by 0x6B46CAE: TObjArray::Delete(char const*) (TObjArray.cxx:375)
==19572==    by 0x8EA48B7: TTree::~TTree() (TTree.cxx:916)
==19572==    by 0x4090DB: MyClass::~MyClass() (MyTreeBasedClass.C:18)
==19572==    by 0x409111: MyClass::~MyClass() (MyTreeBasedClass.C:18)
==19572==    by 0x40852E: main (MyTreeBasedClass.C:46)
==19572== 
==19572== Conditional jump or move depends on uninitialised value(s)
==19572==    at 0x6AC6577: CallRecursiveRemoveIfNeeded (TROOT.h:401)
==19572==    by 0x6AC6577: TObject::~TObject() (TObject.cxx:84)
==19572==    by 0x8E4E42C: ~TConfiguredAction (TStreamerInfoActions.h:114)
==19572==    by 0x8E4E42C: _Destroy<TStreamerInfoActions::TConfiguredAction> (stl_construct.h:98)
==19572==    by 0x8E4E42C: __destroy<TStreamerInfoActions::TConfiguredAction*> (stl_construct.h:108)
==19572==    by 0x8E4E42C: _Destroy<TStreamerInfoActions::TConfiguredAction*> (stl_construct.h:132)
==19572==    by 0x8E4E42C: _Destroy<TStreamerInfoActions::TConfiguredAction*, TStreamerInfoActions::TConfiguredAction> (stl_construct.h:196)
==19572==    by 0x8E4E42C: ~vector (stl_vector.h:434)
==19572==    by 0x8E4E42C: ~TActionSequence (TStreamerInfoActions.h:179)
==19572==    by 0x8E4E42C: ~TActionSequence (TStreamerInfoActions.h:181)
==19572==    by 0x8E4E42C: TBranchElement::~TBranchElement() (TBranchElement.cxx:979)
==19572==    by 0x8E4E758: TBranchElement::~TBranchElement() (TBranchElement.cxx:983)
==19572==    by 0x6B46CAE: TObjArray::Delete(char const*) (TObjArray.cxx:375)
==19572==    by 0x8EA48B7: TTree::~TTree() (TTree.cxx:916)
==19572==    by 0x4090DB: MyClass::~MyClass() (MyTreeBasedClass.C:18)
==19572==    by 0x409111: MyClass::~MyClass() (MyTreeBasedClass.C:18)
==19572==    by 0x40852E: main (MyTreeBasedClass.C:46)
==19572== 
==19572== 
==19572== HEAP SUMMARY:
==19572==     in use at exit: 30,702,904 bytes in 71,623 blocks
==19572==   total heap usage: 161,631 allocs, 90,008 frees, 87,580,865 bytes allocated
==19572== 
==19572== LEAK SUMMARY:
==19572==    definitely lost: 0 bytes in 0 blocks
==19572==    indirectly lost: 0 bytes in 0 blocks
==19572==      possibly lost: 288 bytes in 3 blocks
==19572==    still reachable: 30,638,149 bytes in 70,871 blocks
==19572==                       of which reachable via heuristic:
==19572==                         newarray           : 8,544 bytes in 18 blocks
==19572==                         multipleinheritance: 928 bytes in 2 blocks
==19572==         suppressed: 64,467 bytes in 749 blocks
==19572== Reachable blocks (those to which a pointer was found) are not shown.
==19572== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==19572== 
==19572== For counts of detected and suppressed errors, rerun with: -v
==19572== Use --track-origins=yes to see where uninitialised values come from
==19572== ERROR SUMMARY: 7 errors from 7 contexts (suppressed: 976 from 160)

ROOT Version: 6.14.06
Platform: Fedora26
Compiler: g++ 7.1.1


I know that @pcanal was going to look at the validity of these valgrind reports. And progress, @pcanal ?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.