RE: [ROOT] crash when " nb = fChain->GetEntry(jentry); " to read from a TMBTree root file

From: Philippe Canal (pcanal@fnal.gov)
Date: Mon Apr 19 2004 - 17:56:55 MEST


Hi,

There could be sereval explaination to your problem.  It could be that
MyTadJHuang does not set properly the tree address (by confusing an
object branch for a TClonesArray branch or vice et versa).
It could also be that your specific file encounters one of the TMBTree
specific issues that we have encountered recently.
One is fixed by using a newer version of ROOT (in your case v3_05_00c)
the other is fixed by disabling the problem branch
(fChain->SetBranchStatus("fHeader.fBits",0);)

Cheers,
Philippe.

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of ly1@indiana.edu
Sent: Sunday, April 18, 2004 5:21 PM
To: roottalk@pcroot.cern.ch
Subject: [ROOT] crash when " nb = fChain->GetEntry(jentry); " to read
from a TMBTree root file



Hi,

   I want to read data from TMBTree root file.
But always meet a crash.
(MuTagTMBTree was made from TMBTree->MakeClass("MuTagJHuang"))

I did like this in root

.x LoadTMBTree_so.C
.x MakeTMBTreeClasses_so.C
.L MuTagJHuang.C++
TChain jet("TMBTree");
jet->Add("~/data/*.root")
MuTagJHuang t(&jet);
t.Loop()  // I modified the parameters of this function, empty means default

I got the error

*** Break *** segmentation violation
 Generating stack trace...
0x40192291 in TUnixSystem::StackTrace(void) at
/cdf/scratch/jeffk/root_cutting/KCC_4_0-opt-thread-exception/root/unix/src/T
UnixSystem.cxx:1358
from
/fnal/ups/prd/root/Linux-2-4/v3_05_00b-KCC_4_0--exception--opt--thread/lib/l
ibCore.so
 0x40191600 in TUnixSystem::DispatchSignals(ESignals) at
/cdf/scratch/jeffk/root_cutting/KCC_4_0-opt-thread-exception/root/unix/src/T
UnixSystem.cxx:583
from
/fnal/ups/prd/root/Linux-2-4/v3_05_00b-KCC_4_0--exception--opt--thread/lib/l
ibCore.so
 0x4018ec2a in <unknown> from
/fnal/ups/prd/root/Linux-2-4/v3_05_00b-KCC_4_0--exception--opt--thread/lib/l
ibCore.so
 0x4018ecaa in <unknown> from
/fnal/ups/prd/root/Linux-2-4/v3_05_00b-KCC_4_0--exception--opt--thread/lib/l
ibCore.so
 0x40b89a65 in <unknown> from /lib/i686/libpthread.so.0
 0x40bc3958 in <unknown> from /lib/i686/libc.so.6
 0x4098681f in TBranchElement::ReadLeaves(TBuffer &) at
/cdf/scratch/jeffk/root_cutting/KCC_4_0-opt-thread-exception/root/tree/src/T
BranchElement.cxx:1316
from
/fnal/ups/prd/root/Linux-2-4/v3_05_00b-KCC_4_0--exception--opt--thread/lib/l
ibTree.so
 0x4097c674 in TBranch::GetEntry(int, int) at
/cdf/scratch/jeffk/root_cutting/KCC_4_0-opt-thread-exception/root/tree/src/T
Branch.cxx:740
from
/fnal/ups/prd/root/Linux-2-4/v3_05_00b-KCC_4_0--exception--opt--thread/lib/l
ibTree.so
0x4098681f in TBranchElement::ReadLeaves(TBuffer &) at
/cdf/scratch/jeffk/root_cutting/KCC_4_0-opt-thread-exception/root/tree/src/T
BranchElement.cxx:1316
from
/fnal/ups/prd/root/Linux-2-4/v3_05_00b-KCC_4_0--exception--opt--thread/lib/l
ibTree.so
 0x4097c674 in TBranch::GetEntry(int, int) at
/cdf/scratch/jeffk/root_cutting/KCC_4_0-opt-thread-exception/root/tree/src/T
Branch.cxx:740
from
/fnal/ups/prd/root/Linux-2-4/v3_05_00b-KCC_4_0--exception--opt--thread/lib/l
ibTree.so
 0x40985362 in TBranchElement::GetEntry(int, int) at
/cdf/scratch/jeffk/root_cutting/KCC_4_0-opt-thread-exception/root/tree/src/T
BranchElement.cxx:899
from
/fnal/ups/prd/root/Linux-2-4/v3_05_00b-KCC_4_0--exception--opt--thread/lib/l
ibTree.so
 0x409852a8 in TBranchElement::GetEntry(int, int) at
/cdf/scratch/jeffk/root_cutting/KCC_4_0-opt-thread-exception/root/tree/src/T
BranchElement.cxx:893
from
/fnal/ups/prd/root/Linux-2-4/v3_05_00b-KCC_4_0--exception--opt--thread/lib/l
ibTree.so
 0x409a65c8 in TTree::GetEntry(int, int) at
/cdf/scratch/jeffk/root_cutting/KCC_4_0-opt-thread-exception/root/tree/src/T
Tree.cxx:2410
from
/fnal/ups/prd/root/Linux-2-4/v3_05_00b-KCC_4_0--exception--opt--thread/lib/l
ibTree.so
 0x4098c6a4 in TChain::GetEntry(int, int) at
/cdf/scratch/jeffk/root_cutting/KCC_4_0-opt-thread-exception/root/tree/src/T
Chain.cxx:540
from
/fnal/ups/prd/root/Linux-2-4/v3_05_00b-KCC_4_0--exception--opt--thread/lib/l
ibTree.so
 0x40ef3118 in MuTag::Loop(char *, char *, int, bool, bool) at
/home/s4/ly1/work/11-tmbtree/jpsi-1/tmb_analyze/macros/MuTagJHuang.C:227
from
/home/s4/ly1/work/11-tmbtree/jpsi-1/tmb_analyze/macros/./MuTagJHuang_C.so
 0x40eeb26c in <unknown> from
/home/s4/ly1/work/11-tmbtree/jpsi-1/tmb_analyze/macros/./MuTagJHuang_C.so

...(lots of error output).......


I tracecd the problem, and it's from:
(I can get the total entries number with fChain->GetEntries()
before the following code)

        nb = fChain->GetEntry(jentry);

any idea about this problem ?
I had working on it for a long time since last week.
It really made me almost crazy

Lingyun



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:07 MET