Segfault on TTree::GetEntry

Hello,

I’ve come across a very odd error when trying to reconstruct some simulations. I have a TTree filled with PrtEvent entries (just a class to hold our event data), with each event having it’s own PrtHit vector (another class for holding data for individual pixel hits). I find that I get the error below for some, but not all of my simulation files when I try to do tree->GetEntry(n).

===========================================================
#5  0x0000000000466321 in void std::_Destroy<PrtHit>(PrtHit*) ()
#6  0x00000000004661de in void std::_Destroy_aux<false>::__destroy<PrtHit*>(PrtHit*, PrtHit*) ()
#7  0x0000000000466020 in void std::_Destroy<PrtHit*>(PrtHit*, PrtHit*) ()
#8  0x0000000000465ddf in void std::_Destroy<PrtHit*, PrtHit>(PrtHit*, PrtHit*, std::allocator<PrtHit>&) ()
#9  0x00000000004acb88 in std::vector<PrtHit, std::allocator<PrtHit> >::_M_erase_at_end(PrtHit*) ()
#10 0x00000000004a8601 in std::vector<PrtHit, std::allocator<PrtHit> >::resize(unsigned long) ()
#11 0x00000000004aa855 in ROOT::TCollectionProxyInfo::Pushback<std::vector<PrtHit, std::allocator<PrtHit> > >::resize(void*, unsigned long) ()
#12 0x00007feeb32c2c53 in TGenCollectionProxy::Allocate(unsigned int, bool) () from /usr/local/root/root/lib/libRIO.so
#13 0x00007feeb1f9fe44 in TBranchElement::ReadLeavesCollection(TBuffer&) () from /usr/local/root/root/lib/libTree.so
#14 0x00007feeb1f984fc in TBranch::GetEntry(long long, int) () from /usr/local/root/root/lib/libTree.so
#15 0x00007feeb1fab926 in TBranchElement::GetEntry(long long, int) () from /usr/local/root/root/lib/libTree.so
#16 0x00007feeb1fab994 in TBranchElement::GetEntry(long long, int) () from /usr/local/root/root/lib/libTree.so
#17 0x00007feeb1fe99a1 in TTree::GetEntry(long long, int) () from /usr/local/root/root/lib/libTree.so
#18 0x0000000000473ee7 in PrtLutReco::Run(int, int, double) ()
#19 0x000000000044ebd5 in main ()
===========================================================

It looks like it’s complaining about a PrtHit pointer, but I make no pointers of type PrtHit anywhere in my code. To take the weirdness one step further I had this same error on my local machine and the “fix” was to change the binning of a completely unrelated histogram earlier in the code, but that neither makes sense nor works in this instance when running on a batch farm. I can, however, access the entries just fine whne using the ROOT interpreter.

I found one post that has something similar here, but their problem was with pushing an object to their vector, whereas I am getting the crash when I try to get an entry from my TTree.

Has anyone ever seen this type of error? What does it mean?

Hi,

Does the class PrtHit contains any pointers of any kind? Are they all initialized in the default constructor of PrtHit?

Cheers,
Philippe.

Hi Philippe,

No, all data members of PrtHit are either int, double, or TVector3.

Regards,
Lee

Then something odd is going on.

Can you run your failing case with valgrind (eg. valgrind --suppressions=$ROOTSYS/etc/valgrind-root.supp root.exe …)

Cheers,
Philippe.

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