May a complex own class in tree cause a segmentation violation?

ROOT Version: 6.10/05
Platform, compiler (e.g. CentOS 7.3, gcc6.2): ScientificLinux6.9 (lxplus), 6.3.0

Dear Rooters,

I have a problem with my custom class in a tree. I have build a tree using a custom class, however when I try to read it I am facing a segmentation violation. The class is structured in a way that one of the private members is an other self defined class. Is it possible that this is causing the crash?

I am not posting code because is quite complicated and I cannot easily get a simple example.

I am compiling my code, I have also tried to use valgrind to identify the problem and I have been reported:

==13706== Invalid read of size 8
==13706== at 0x4A3D88: ROOT::delete_HGCC3D(void*) (DictHGCC3D.cxx:133)
==13706== by 0x537DB35: TGenCollectionProxy::Clear(char const*) (in /cvmfs/
==13706== by 0x5386E36: TGenCollectionStreamer::ReadBufferGeneric(TBuffer&, void*, TClass const*) (in /cvmfs/
==13706== by 0x53231E9: TBufferFile::ReadFastArray(void*, TClass const*, int, TMemberStreamer*, TClass const*) (in /cvmfs/
==13706== by 0x5418533: int TStreamerInfoActions::ReadSTL<&TStreamerInfoActions::ReadSTLMemberWiseSameClass, &TStreamerInfoActions::ReadSTLObjectWiseFastArray>(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*) (in /cvmfs/
==13706== by 0x5322A74: TBufferFile::ApplySequence(TStreamerInfoActions::TActionSequence const&, void*) (in /cvmfs/
==13706== by 0x5B87E1C: TBranchElement::ReadLeavesMember(TBuffer&) (in /cvmfs/
==13706== by 0x5B7B079: TBranch::GetEntry(long long, int) (in /cvmfs/
==13706== by 0x5B93010: TBranchElement::GetEntry(long long, int) (in /cvmfs/
==13706== by 0x5BD5CB7: TTree::GetEntry(long long, int) (in /cvmfs/
==13706== by 0x4BF441: main (test_root.cpp:28)
==13706== Address 0x16e12dc0 is 0 bytes inside a block of size 168 free’d

It seems that the problem is in my destructor, but it is empty…

Thank you for any answer or tip you can give!

Most likely some of the (pointer type) data member are not initialized in the default (or I/O) constructor.


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