Segmentation Fault using Cuts

I get the same segfault as the last one in this thread when I run my code, although my problem is the same as the thread “Odd behaviour when using several TCuts” in that I get the segfault after adding a fourth TCut, but any of the four cuts work individually or in groups of 2 or 3. I have implemented the solution given in both threads, but still get the same segfault. Im using root Version 5.14/00b. My macro and necessary files can be found at:

minos.phy.tufts.edu/danche/rootproblem/

Thanks

Dan

Hi Dan,

I moved your post under this new topic, because of the specific problem. The crash I got is not identical with the previous one. Using your example I’ve got the following bt:0x0021b489 in TString::Length (this=0xbffdef00) at include/TString.h:347 347 Ssiz_t Length() const { return Pref()->fNchars; } (gdb) bt #0 0x0021b489 in TString::Length (this=0xbffdef00) at include/TString.h:347 #1 0x0026bdee in TString::Index (this=0xbffdef00, pattern=0x12b3231 "prof", plen=4, startIndex=0, cmp=kExact) at base/src/TString.cxx:627 #2 0x00236671 in TString::Contains (this=0xbffdef00, s=0x12b3231 "prof", cmp=kExact) at include/TString.h:501 #3 0x011d146b in TSelectorDraw::Begin (this=0x9302d90, tree=0x90deca8) at treeplayer/src/TSelectorDraw.cxx:455 #4 0x01202fde in TTreePlayer::Process (this=0x9302d48, selector=0x9302d90, option=0x8b0cc12 "", nentries=109758, firstentry=0) at treeplayer/src/TTreePlayer.cxx:2625 #5 0x011fb840 in TTreePlayer::DrawSelect (this=0x9302d48, varexp0=0x928da38 "NueRecord.srevent.phNueGeV>>htemp1a", selection=0x92e2f78 "(NueRecord.mctrue.interactionType==0&&NueRecord.mctrue.resonanceCode<1004)* (((((NueRecord.srevent.phNueGeV>2&&NueRecord.srevent.showers==1&&NueRecord.srevent.tracks<2) &&(shwfit.par_a>0.64&&shwfit.par_"..., option=0x8b0cc12 "", nentries=1234567890, firstentry=0) at treeplayer/src/TTreePlayer.cxx:995 #6 0x08a606da in TTree::Draw (this=0x90deca8, varexp=0x928da38 "NueRecord.srevent.phNueGeV>>htemp1a", selection=0x92e2f78 ) at tree/src/TTree.cxx:3067 #7 0x08a31963 in TChain::Draw (this=0x90deca8, varexp=0x928da38 "NueRecord.srevent.phNueGeV>>htemp1a", selection=0x92e2f78 "(NueRecord.mctrue.interactionType==0&&NueRecord.mctrue.resonanceCode<1004)* (((((NueRecord.srevent.phNueGeV>2&&NueRecord.srevent.showers==1&&NueRecord.srevent.tracks<2) &&(shwfit.par_a>0.64&&shwfit.par_"..., option=0x8b0cc12 "", nentries=1234567890, firstentry=0) at tree/src/TChain.cxx:660 #8 0x08a3181b in TChain::Draw (this=0x90deca8, varexp=0x928da38 "NueRecord.srevent.phNueGeV>>htemp1a", selection=@0x92af1f8, option=0x8b0cc12 "", nentries=1234567890, firstentry=0) at tree/src/TChain.cxx:640 ...

Cheers, Ilka

The segfault I get looks like this:

*** Break *** segmentation violation
Using host libthread_db library “/lib/tls/libthread_db.so.1”.
Attaching to program: /proc/21547/exe, process 21547
[Thread debugging using libthread_db enabled]
[New Thread 1100843488 (LWP 21547)]
0xffffe410 in ?? ()
#1 0xbffe074c in ?? ()
#2 0x00000000 in ?? ()
#3 0xbffe0608 in ?? ()
#4 0x41915273 in waitpid () from /lib/tls/libc.so.6
#5 0x418c05a4 in strtold_l () from /lib/tls/libc.so.6
#6 0x4188667d in system () from /lib/tls/libpthread.so.0
at unix/src/TUnixSystem.cxx:1768
#8 0x40303038 in TUnixSystem::StackTrace (this=0x8319528) at unix/src/TUnixSystem.cxx:1953
#9 0x40300f77 in TUnixSystem::DispatchSignals (this=0x8319528, sig=kSigSegmentationViolation) at unix/src/TUnixSystem.cxx:936
#10 0x402ff199 in SigHandler (sig=kSigSegmentationViolation) at unix/src/TUnixSystem.cxx:338
#11 0x40305b0a in sighandler (sig=11) at unix/src/TUnixSystem.cxx:3142
#12
#13 0x40156f2d in TString::Length (this=0xbffe34c0) at TString.h:348
#14 0x401e9758 in TString::Index (this=0xbffe34c0, pattern=0x42fb60c9 “prof”, plen=4, startIndex=0, cmp=kExact) at base/src/TString.cxx:544
#15 0x4017f00f in TString::Contains (this=0xbffe34c0, s=0x42fb60c9 “prof”, cmp=kExact) at TString.h:503
#16 0x42ed4264 in TSelectorDraw::Begin (this=0x98379a0, tree=0x8f609d0) at treeplayer/src/TSelectorDraw.cxx:401
#17 0x42f0581b in TTreePlayer::Process (this=0x8f86610, selector=0x98379a0, option=0x414cae40 “”, nentries=109758, firstentry=0)
at treeplayer/src/TTreePlayer.cxx:2596
#18 0x42efe051 in TTreePlayer::DrawSelect (this=0x8f86610, varexp0=0x8c97da8 “NueRecord.srevent.phNueGeV>>htemp1a”,
selection=0x8cba9a0 “(NueRecord.mctrue.interactionType==0&&NueRecord.mctrue.resonanceCode<1004)(((((NueRecord.srevent.phNueGeV>2&&NueRecord.srevent.showers==1&&NueRecord.srevent.tracks<2)&&(shwfit.par_a>0.64&&shwfit.par_"…, option=0x414cae40 “”, nentries=1234567890, firstentry=0) at treeplayer/src/TTreePlayer.cxx:967
#19 0x4141f48c in TTree::Draw (this=0x8f609d0, varexp=0x8c97da8 “NueRecord.srevent.phNueGeV>>htemp1a”,
selection=0x8cba9a0 "(NueRecord.mctrue.interactionType==0&&NueRecord.mctrue.resonanceCode<1004)
(((((NueRecord.srevent.phNueGeV>2&&NueRecord.srevent.showers==1&&NueRecord.srevent.tracks<2)&&(shwfit.par_a>0.64&&shwfit.par_”…, option=0x414cae40 “”, nentries=1234567890, firstentry=0) at tree/src/TTree.cxx:3017
#20 0x413f2545 in TChain::Draw (this=0x8f609d0, varexp=0x8c97da8 “NueRecord.srevent.phNueGeV>>htemp1a”,
selection=0x8cba9a0 "(NueRecord.mctrue.interactionType==0&&NueRecord.mctrue.resonanceCode<1004)(((((NueRecord.srevent.phNueGeV>2&&NueRecord.srevent.showers==1&&NueRecord.srevent.tracks<2)&&(shwfit.par_a>0.64&&shwfit.par_"…, option=0x414cae40 “”, nentries=1234567890, firstentry=0) at tree/src/TChain.cxx:649
#21 0x413f240b in TChain::Draw (this=0x8f609d0, varexp=0x8c97da8 “NueRecord.srevent.phNueGeV>>htemp1a”, selection=@0x97e4aa0, option=0x414cae40 “”,
nentries=1234567890, firstentry=0) at tree/src/TChain.cxx:629
#22 0x41472752 in G__G__Tree_225_0_16 () from /home/minos/Minossoft/root/pro/lib/libTree.so
#23 0x408d9ca5 in Cint::G__ExceptionWrapper (funcp=0x414724ac <G__G__Tree_225_0_16(G__value
, char const*, G__param*, int)>, result7=0xbfff0db0,
funcname=0x8ad3de8 “\001”, libp=0xbffed7d0, hash=0) at cint/src/Api.cxx:355
#24 0x4099f936 in G__call_cppfunc (result7=0xbfff0db0, libp=0xbffed7d0, ifunc=0x8ad3de8, ifn=0) at cint/src/v6_newlink.cxx:465
#25 0x40989b90 in G__interpret_func (result7=0xbfff0db0, funcname=0xbfff09b0 “Draw”, libp=0xbffed7d0, hash=398, p_ifunc=0x8ad3de8, funcmatch=1, memfunc_flag=1)
at cint/src/v6_ifunc.cxx:5167
#26 0x40972237 in G__getfunction (
item=0x973762e “Draw(var1a,“NueRecord.mctrue.interactionType==0&&NueRecord.mctrue.resonanceCode<1004”(precuts&&shwfitcuts1&&shwfitcuts2&&shwfitcuts3&&shwfitcuts4))", known3=0xbfff260c, memfunc_flag=1) at cint/src/v6_func.cxx:2600
#27 0x40a231ff in G__getstructmem (store_var_type=112, varname=0xbfff2270 “øó\023\n”,
membername=0x973762e "Draw(var1a,“NueRecord.mctrue.interactionType==0&&NueRecord.mctrue.resonanceCode<1004”
(precuts&&shwfitcuts1&&shwfitcuts2&&shwfitcuts3&&shwfitcuts4))”, tagname=0xbfff15d0 “Data”, known2=0xbfff260c, varglobal=0x40aac9a0, objptr=2) at cint/src/v6_var.cxx:4468
#28 0x40a18a9e in G__getvariable (
item=0x9737628 “Data->Draw(var1a,“NueRecord.mctrue.interactionType==0&&NueRecord.mctrue.resonanceCode<1004”(precuts&&shwfitcuts1&&shwfitcuts2&&shwfitcuts3&&shwfitcuts4))", known2=0xbfff260c, varglobal=0x40aac9a0, varlocal=0x0) at cint/src/v6_var.cxx:3234
#29 0x40966776 in G__getitem (
item=0x9737628 "Data->Draw(var1a,“NueRecord.mctrue.interactionType==0&&NueRecord.mctrue.resonanceCode<1004”
(precuts&&shwfitcuts1&&shwfitcuts2&&shwfitcuts3&&shwfitcuts4))”) at cint/src/v6_expr.cxx:1846
#30 0x40964dd2 in G__getexpr (
expression=0xbfff4780 “Data->Draw(var1a,“NueRecord.mctrue.interactionType==0&&NueRecord.mctrue.resonanceCode<1004”(precuts&&shwfitcuts1&&shwfitcuts2&&shwfitcuts3&&shwfitcuts4))") at cint/src/v6_expr.cxx:1315
#31 0x409bdc8d in G__exec_function (
statement=0xbfff4780 "Data->Draw(var1a,“NueRecord.mctrue.interactionType==0&&NueRecord.mctrue.resonanceCode<1004”
(precuts&&shwfitcuts1&&shwfitcuts2&&shwfitcuts3&&shwfitcuts4))”, pc=0xbfff477c, piout=0xbfff4770, plargestep=0xbfff4760, presult=0xbfff4b80) at cint/src/v6_parse.cxx:457
#32 0x409c734a in G__exec_statement () at cint/src/v6_parse.cxx:4187
#33 0x40943fe7 in G__exec_tempfile_core (file=0xbfffcef0 “/home/danche/ViewScan5/NueAna/./macros/wekafriends_CutonAllNueAnavars.C”, fp=0x0)
at cint/src/v6_debug.cxx:358
#34 0x4094426a in G__exec_tempfile (file=0xbfffcef0 “/home/danche/ViewScan5/NueAna/./macros/wekafriends_CutonAllNueAnavars.C”) at cint/src/v6_debug.cxx:433
#35 0x409d18d3 in G__process_cmd (line=0x4081bbdc “.x /home/danche/ViewScan5/NueAna/./macros/wekafriends_CutonAllNueAnavars.C”, prompt=0x831c4ec “”,
more=0x831c4e4, err=0xbfffd74c, rslt=0xbfffd750) at cint/src/v6_pause.cxx:3218
#36 0x402576d7 in TCint::ProcessLine (this=0x831c4c8, line=0x4081bbdc “.x /home/danche/ViewScan5/NueAna/./macros/wekafriends_CutonAllNueAnavars.C”, error=0x0)
at meta/src/TCint.cxx:318
#37 0x4025785c in TCint::ProcessLineSynch (this=0x831c4c8, line=0x4081bbdc “.x /home/danche/ViewScan5/NueAna/./macros/wekafriends_CutonAllNueAnavars.C”, error=0x0)
at meta/src/TCint.cxx:351
#38 0x4015cd11 in TApplication::ProcessFile (this=0x8368330, name=0x8e44693 “macros/wekafriends_CutonAllNueAnavars.C”, error=0x0) at base/src/TApplication.cxx:804
#39 0x4015c4ef in TApplication::ProcessLine (this=0x8368330, line=0x8e44690 “.x macros/wekafriends_CutonAllNueAnavars.C”, sync=false, err=0x0)
at base/src/TApplication.cxx:676
#40 0x41758162 in TRint::HandleTermInput (this=0x8368330) at rint/src/TRint.cxx:500
#41 0x41756248 in TTermInputHandler::Notify (this=0x8a58940) at rint/src/TRint.cxx:121
#42 0x417590d6 in TTermInputHandler::ReadNotify (this=0x8a58940) at rint/src/TRint.cxx:113
#43 0x40301319 in TUnixSystem::CheckDescriptors (this=0x8319528) at unix/src/TUnixSystem.cxx:1046
#44 0x40300696 in TUnixSystem::DispatchOneEvent (this=0x8319528, pendingOnly=false) at unix/src/TUnixSystem.cxx:754
#45 0x401fd8e6 in TSystem::InnerLoop (this=0x8319528) at base/src/TSystem.cxx:347
#46 0x401fd874 in TSystem::Run (this=0x8319528) at base/src/TSystem.cxx:315
#47 0x4015cf62 in TApplication::Run (this=0x8368330, retrn=false) at base/src/TApplication.cxx:824
#48 0x41757a2c in TRint::Run (this=0x8368330, retrn=false) at rint/src/TRint.cxx:359
#49 0x08048952 in main (argc=2, argv=0xbfffe4e4) at main/src/rmain.cxx:29
Root > !!!Dictionary position not recovered because G__unloadfile() is used in a macro!!!

Hi Dan,

The crash info provided by you is exactly what I got - the only difference comes from runnung root with gdb in my case. I will leave the further investigation of your case to our experts with deep knowledge about trees and cuts.

Cheers, Ilka

Hi,

This problem is now fixed in CVS. Note that the problem was not the number of Cuts but rather the sheer length of the resulting cut (2601 characters!).

Cheers,
Philippe