Dear all,
Trying to read in a TTree containing a single branch of (custom) type DitauBranches, which I have just successfully written out to a TFile… This is done in the following function:
void Plotter::MakePlots(Topology* iTopology){
TTree* eventTree = iTopology->GetGoodEventsForSignal();
DitauBranches* event = NULL;
eventTree->SetBranchAddress("goodEventsForSignal", &event);
for(unsigned int e = 0; e < eventTree->GetEntries(); e++){
eventTree->GetEntry(e);
}
}
Now, this function is called several times, i.e.:
MakePlots(myTopology1);
MakePlots(myTopology2);
MakePlots(myTopology3);
MakePlots(myTopology4);
...
It runs find the first time around, but it segfaults at the “eventTree->GetEntry(e);” on the second call. The interesting part is that it always segfaults on the second call of MakePlots, no matter what the pointer being passed is. For example, the above will segfault during the call taking in “myTopology2”, but…
//MakePlots(myTopology1);
MakePlots(myTopology2);
MakePlots(myTopology3);
MakePlots(myTopology4);
...
will segfault during the call taking in “myTopology3”, also when “eventTree->GetEntry(e);”
I have tried to make sense of the stack trace. Something fishy appears to be there with the dictionary that I generated with rootcint, but it escapes my debugging skills.
The complete code can be found at /afs/cern.ch/user/n/nvallsve/public/nidraSegfaults/
Thanks very much,
– Nil
===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0 0x000000355049a115 in waitpid () from /lib64/libc.so.6
#1 0x000000355043c481 in do_system () from /lib64/libc.so.6
#2 0x00002ba97355f222 in TUnixSystem::StackTrace() ()
from /afs/cern.ch/cms/slc5_amd64_gcc434/cms/cmssw-patch/CMSSW_4_2_3_patch2/external/slc5_amd64_gcc434/lib/libCore.so
#3 0x00002ba97355fcdc in TUnixSystem::DispatchSignals(ESignals) ()
from /afs/cern.ch/cms/slc5_amd64_gcc434/cms/cmssw-patch/CMSSW_4_2_3_patch2/external/slc5_amd64_gcc434/lib/libCore.so
#4 <signal handler called>
#5 0x0000000000451594 in std::vector<float, std::allocator<float> >::clear (
this=0xffffffff)
at /afs/cern.ch/cms/slc5_amd64_gcc434/external/gcc/4.3.4-cms/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.3.4/../../../../include/c++/4.3.4/bits/stl_vector.h:892
#6 0x00002ba9732c3507 in ROOT::TCollectionProxyInfo::Type<std::vector<float, std::allocator<float> > >::clear (env=0x1d06cf90)
at /afs/cern.ch/cms/slc5_amd64_gcc434/lcg/root/5.27.06b-cms16/include/TCollectionProxyInfo.h:140
#7 0x00002ba9744f72fe in TGenCollectionStreamer::Streamer(TBuffer&) ()
from /afs/cern.ch/cms/slc5_amd64_gcc434/cms/cmssw-patch/CMSSW_4_2_3_patch2/external/slc5_amd64_gcc434/lib/libRIO.so
#8 0x00002ba9744d1be7 in TCollectionStreamer::Streamer(TBuffer&, void*, int, TClass*) ()
from /afs/cern.ch/cms/slc5_amd64_gcc434/cms/cmssw-patch/CMSSW_4_2_3_patch2/external/slc5_amd64_gcc434/lib/libRIO.so
#9 0x00002ba973530ada in TClass::Streamer(void*, TBuffer&, TClass const*) const ()
from /afs/cern.ch/cms/slc5_amd64_gcc434/cms/cmssw-patch/CMSSW_4_2_3_patch2/external/slc5_amd64_gcc434/lib/libCore.so
#10 0x00002ba974575128 in int TStreamerInfo::ReadBuffer<char**>(TBuffer&, char** const&, int, int, int, int) ()
from /afs/cern.ch/cms/slc5_amd64_gcc434/cms/cmssw-patch/CMSSW_4_2_3_patch2/external/slc5_amd64_gcc434/lib/libRIO.so
#11 0x00002ba975040146 in TBranchElement::ReadLeavesMember(TBuffer&) ()
from /afs/cern.ch/cms/slc5_amd64_gcc434/cms/cmssw-patch/CMSSW_4_2_3_patch2/external/slc5_amd64_gcc434/lib/libTree.so
#12 0x00002ba975030d95 in TBranch::GetEntry(long long, int) ()
from /afs/cern.ch/cms/slc5_amd64_gcc434/cms/cmssw-patch/CMSSW_4_2_3_patch2/external/slc5_amd64_gcc434/lib/libTree.so
#13 0x00002ba97503cd57 in TBranchElement::GetEntry(long long, int) ()
from /afs/cern.ch/cms/slc5_amd64_gcc434/cms/cmssw-patch/CMSSW_4_2_3_patch2/external/slc5_amd64_gcc434/lib/libTree.so
#14 0x00002ba97503ce6a in TBranchElement::GetEntry(long long, int) ()
from /afs/cern.ch/cms/slc5_amd64_gcc434/cms/cmssw-patch/CMSSW_4_2_3_patch2/external/slc5_amd64_gcc434/lib/libTree.so
#15 0x00002ba975078180 in TTree::GetEntry(long long, int) ()
from /afs/cern.ch/cms/slc5_amd64_gcc434/cms/cmssw-patch/CMSSW_4_2_3_patch2/external/slc5_amd64_gcc434/lib/libTree.so
#16 0x000000000045a257 in Plotter::MakePlots (this=0x7fff7668dba0,
iTopology=0x19ba1740) at Plotter.cc:82
#17 0x0000000000458cad in Plotter::MakePlots (this=0x7fff7668dba0,
iTopologies=0x18032e30) at Plotter.cc:107
#18 0x000000000045a42d in Plotter::MakePlots (this=0x7fff7668dba0,
iTopologies=0x16c14fa0) at Plotter.cc:55
#19 0x000000000045a799 in Plotter (this=0x7fff7668dba0, iParams=0x4759c0)
at Plotter.cc:26
#20 0x0000000000436203 in PreparePlots () at Driver.cc:101
#21 0x00000000004394a2 in main (argc=3, argv=0x7fff7668dd48) at Nidra.cc:19
===========================================================
The lines below might hint at the cause of the crash.
If they do not help you then please submit a bug report at
http://root.cern.ch/bugs. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#5 0x0000000000451594 in std::vector<float, std::allocator<float> >::clear (
this=0xffffffff)
at /afs/cern.ch/cms/slc5_amd64_gcc434/external/gcc/4.3.4-cms/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.3.4/../../../../include/c++/4.3.4/bits/stl_vector.h:892
#6 0x00002ba9732c3507 in ROOT::TCollectionProxyInfo::Type<std::vector<float, std::allocator<float> > >::clear (env=0x1d06cf90)
at /afs/cern.ch/cms/slc5_amd64_gcc434/lcg/root/5.27.06b-cms16/include/TCollectionProxyInfo.h:140
#7 0x00002ba9744f72fe in TGenCollectionStreamer::Streamer(TBuffer&) ()
from /afs/cern.ch/cms/slc5_amd64_gcc434/cms/cmssw-patch/CMSSW_4_2_3_patch2/external/slc5_amd64_gcc434/lib/libRIO.so
#8 0x00002ba9744d1be7 in TCollectionStreamer::Streamer(TBuffer&, void*, int, TClass*) ()
from /afs/cern.ch/cms/slc5_amd64_gcc434/cms/cmssw-patch/CMSSW_4_2_3_patch2/external/slc5_amd64_gcc434/lib/libRIO.so
#9 0x00002ba973530ada in TClass::Streamer(void*, TBuffer&, TClass const*) const ()
from /afs/cern.ch/cms/slc5_amd64_gcc434/cms/cmssw-patch/CMSSW_4_2_3_patch2/external/slc5_amd64_gcc434/lib/libCore.so
#10 0x00002ba974575128 in int TStreamerInfo::ReadBuffer<char**>(TBuffer&, char** const&, int, int, int, int) ()
from /afs/cern.ch/cms/slc5_amd64_gcc434/cms/cmssw-patch/CMSSW_4_2_3_patch2/external/slc5_amd64_gcc434/lib/libRIO.so
#11 0x00002ba975040146 in TBranchElement::ReadLeavesMember(TBuffer&) ()
from /afs/cern.ch/cms/slc5_amd64_gcc434/cms/cmssw-patch/CMSSW_4_2_3_patch2/external/slc5_amd64_gcc434/lib/libTree.so
#12 0x00002ba975030d95 in TBranch::GetEntry(long long, int) ()
from /afs/cern.ch/cms/slc5_amd64_gcc434/cms/cmssw-patch/CMSSW_4_2_3_patch2/external/slc5_amd64_gcc434/lib/libTree.so
#13 0x00002ba97503cd57 in TBranchElement::GetEntry(long long, int) ()
from /afs/cern.ch/cms/slc5_amd64_gcc434/cms/cmssw-patch/CMSSW_4_2_3_patch2/external/slc5_amd64_gcc434/lib/libTree.so
#14 0x00002ba97503ce6a in TBranchElement::GetEntry(long long, int) ()
from /afs/cern.ch/cms/slc5_amd64_gcc434/cms/cmssw-patch/CMSSW_4_2_3_patch2/external/slc5_amd64_gcc434/lib/libTree.so
#15 0x00002ba975078180 in TTree::GetEntry(long long, int) ()
from /afs/cern.ch/cms/slc5_amd64_gcc434/cms/cmssw-patch/CMSSW_4_2_3_patch2/external/slc5_amd64_gcc434/lib/libTree.so
#16 0x000000000045a257 in Plotter::MakePlots (this=0x7fff7668dba0,
iTopology=0x19ba1740) at Plotter.cc:82
#17 0x0000000000458cad in Plotter::MakePlots (this=0x7fff7668dba0,
iTopologies=0x18032e30) at Plotter.cc:107
#18 0x000000000045a42d in Plotter::MakePlots (this=0x7fff7668dba0,
iTopologies=0x16c14fa0) at Plotter.cc:55
#19 0x000000000045a799 in Plotter (this=0x7fff7668dba0, iParams=0x4759c0)
at Plotter.cc:26
#20 0x0000000000436203 in PreparePlots () at Driver.cc:101
#21 0x00000000004394a2 in main (argc=3, argv=0x7fff7668dd48) at Nidra.cc:19
===========================================================