SEGFAULT with Class from TTree::MakeClass()

I have been having the problem that whenever I create a class using TTree::MakeClass() and then create an instance of that class it will seg fault if I try to call GetEntry().

Here is the line input/output. I also get the Seg Fault in a compiled version. Just in case your wondering, the files contain identical tree structures of the name “t”.

Thank you for your help,
Taylor Childers
Univ. of Minnesota

root [0] TChain *treeA = new TChain(“t”,“t”);
root [1] treeA->Add("/home/childers/CREAM/DataRootFiles/flight0106.136.S3.root")
(Int_t)1
root [2] treeA->Add("/home/childers/CREAM/DataRootFiles/flight0107.136.S3.root")
(Int_t)1
root [3] treeA->MakeClass(“test”)
Warning in : no dictionary for class UC_TCDRawData is available
Warning in : no dictionary for class PSU_TCDData is available
Warning in : no dictionary for class UC_CerData is available
Warning in : no dictionary for class UC_SCDData is available
Warning in : no dictionary for class UC_Track is available
Warning in : no dictionary for class UC_TubeHit is available
Warning in : no dictionary for class UC_CalRawData is available
Info in : Files: test.h and test.C generated from TTree: t
(Int_t)0
root [4] .L test.C
root [5] test *treeB = new test
root [6] treeB->fChain->GetEntries()
(const Long64_t)732688
root [7] treeB->GetEntry(5)

*** Break *** segmentation violation
Generating stack trace…
0xb6a3bdab in TBranchElement::ReadLeaves(TBuffer&) + 0x747 from /usr/programs/root-5.12/lib/libTree.so
0xb6a2f479 in TBranch::GetEntry(long long, int) + 0x285 from /usr/programs/root-5.12/lib/libTree.so
0xb6a3a4c7 in TBranchElement::GetEntry(long long, int) + 0x189 from /usr/programs/root-5.12/lib/libTree.so
0xb6a3a442 in TBranchElement::GetEntry(long long, int) + 0x104 from /usr/programs/root-5.12/lib/libTree.so
0xb6a71874 in TTree::GetEntry(long long, int) + 0xaa from /usr/programs/root-5.12/lib/libTree.so
0xb6a47314 in TChain::GetEntry(long long, int) + 0x70 from /usr/programs/root-5.12/lib/libTree.so
0xb6a9b4c9 in from /usr/programs/root-5.12/lib/libTree.so
0xb72e0029 in G__ExceptionWrapper + 0x5d from /usr/programs/root-5.12/lib/libCint.so
0xb73a040c in G__call_cppfunc + 0x30e from /usr/programs/root-5.12/lib/libCint.so
0xb738d366 in G__interpret_func + 0x89e from /usr/programs/root-5.12/lib/libCint.so
0xb737344c in G__getfunction + 0x1c9e from /usr/programs/root-5.12/lib/libCint.so
0xb7412c37 in G__getstructmem + 0xc2d from /usr/programs/root-5.12/lib/libCint.so
0xb7409e30 in G__getvariable + 0x7b8 from /usr/programs/root-5.12/lib/libCint.so
0xb736877e in G__getitem + 0x6d6 from /usr/programs/root-5.12/lib/libCint.so
0xb7366ca2 in G__getexpr + 0xc27e from /usr/programs/root-5.12/lib/libCint.so
0xb73be4a5 in G__return_value + 0x173 from /usr/programs/root-5.12/lib/libCint.so
0xb73c1f40 in G__exec_statement + 0x1466 from /usr/programs/root-5.12/lib/libCint.so
0xb738ef2b in G__interpret_func + 0x2463 from /usr/programs/root-5.12/lib/libCint.so
0xb737344c in G__getfunction + 0x1c9e from /usr/programs/root-5.12/lib/libCint.so
0xb7412c37 in G__getstructmem + 0xc2d from /usr/programs/root-5.12/lib/libCint.so
0xb7409e30 in G__getvariable + 0x7b8 from /usr/programs/root-5.12/lib/libCint.so
0xb736877e in G__getitem + 0x6d6 from /usr/programs/root-5.12/lib/libCint.so
0xb7366ca2 in G__getexpr + 0xc27e from /usr/programs/root-5.12/lib/libCint.so
0xb73bb606 in G__exec_function + 0x202 from /usr/programs/root-5.12/lib/libCint.so
0xb73c3521 in G__exec_statement + 0x2a47 from /usr/programs/root-5.12/lib/libCint.so
0xb7348747 in G__exec_tempfile_core + 0x399 from /usr/programs/root-5.12/lib/libCint.so
0xb7348a17 in G__exec_tempfile_fp + 0x31 from /usr/programs/root-5.12/lib/libCint.so
0xb73cc885 in G__process_cmd + 0x5013 from /usr/programs/root-5.12/lib/libCint.so
0xb786ddf1 in TCint::ProcessLine(char const*, TInterpreter::EErrorCode*) + 0x139 from /usr/programs/root-5.12/lib/libCore.so
0xb7793a4f in TApplication::ProcessLine(char const*, bool, int*) + 0x673 from /usr/programs/root-5.12/lib/libCore.so
0xb6783bfc in TRint::HandleTermInput() + 0x24e from /usr/programs/root-5.12/lib/libRint.so
0xb678228f in TTermInputHandler::Notify() + 0x27 from /usr/programs/root-5.12/lib/libRint.so
0xb678482e in TTermInputHandler::ReadNotify() + 0x14 from /usr/programs/root-5.12/lib/libRint.so
0xb7912af4 in TUnixSystem::CheckDescriptors() + 0x166 from /usr/programs/root-5.12/lib/libCore.so
0xb7911939 in TUnixSystem::DispatchOneEvent(bool) + 0x185 from /usr/programs/root-5.12/lib/libCore.so
0xb781cbb2 in TSystem::InnerLoop() + 0x22 from /usr/programs/root-5.12/lib/libCore.so
0xb781cb48 in TSystem::Run() + 0x80 from /usr/programs/root-5.12/lib/libCore.so
0xb779472f in TApplication::Run(bool) + 0x37 from /usr/programs/root-5.12/lib/libCore.so
0xb6783563 in TRint::Run(bool) + 0x449 from /usr/programs/root-5.12/lib/libRint.so
0x08048e34 in main + 0x90 from /usr/programs/root-5.12/bin/root.exe
0xb654c974 in __libc_start_main + 0xf4 from /lib/tls/libc.so.6
0x08048d01 in TApplicationImp::ShowMembers(TMemberInspector&, char*) + 0x39 from /usr/programs/root-5.12/bin/root.exe
Root > Function GetEntry() busy flag cleared

Can you specify which version of ROOT you are using? Could you attached the file created by MakeClass?

Thanks,
Philippe

I am using ROOT 5.12/00e.
test.C (1.4 KB)
test.h (20 KB)

Hi,

The only possible issue I see so far is:

If one of the file/event has more that one Track this will lead to memory corruption.

If this is not the issue then I would need access to the ROOT files to investigate further.

Cheers,
Philippe

I just track down the problem to the code that creates the root files with the TTree in them. I apologize for wasting your time.

Thanks,
Taylor

Although, it is strange that using TTree::Draw() worked fine and so did TTree::GetEntry(). However when I used the GetEntry() function from the class created by MakeClass() it would seg fault.

Thanks again,
Taylor