Re: [ROOT] TTree::MakeSelector compiling idiosyncracy

From: Mike Kordosky (kordosky@mail.hep.utexas.edu)
Date: Mon Apr 09 2001 - 17:47:49 MEST


Hi,

I ran root with gdb in order to attack my MakeSelector problem:

CINT/ROOT C/C++ Interpreter version 5.14.79, Feb 24 2001
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] gSystem->Load("libTestStand.so");              
root [1] TFile f("batch-1063.root");                    
root [2] TTree* tree = (TTree*)f.Get("T");              
root [3] tree->Process("SimpleSelector.C+", "fillList");
Creating shared library
/home/kordosky/work/devel/maketree/./SimpleSelector_C.so
Class SimpleSelector: Streamer() not declared
Class SimpleSelector: ShowMembers() not declared

Program received signal SIGSEGV, Segmentation fault.
0x200003387c4 in TClass::BuildRealData ()
   from /home/kordosky/root.3.00.06/lib/libCore.so.3.00
(gdb) info stack
#0  0x200003387c4 in TClass::BuildRealData ()
   from /home/kordosky/root.3.00.06/lib/libCore.so.3.00
#1  0x20001461a34 in TBranchObject::SetAddress ()
   from /home/kordosky/root.3.00.06/lib/libTree.so.3.00
#2  0x2000147f894 in TTree::SetBranchAddress ()
   from /home/kordosky/root.3.00.06/lib/libTree.so.3.00
#3  0x200034a9c58 in SimpleSelector::Init ()
   from /home/kordosky/work/devel/maketree/./SimpleSelector_C.so
#4  0x200034aa344 in SimpleSelector::Begin ()
   from /home/kordosky/work/devel/maketree/./SimpleSelector_C.so
#5  0x2000337d178 in TTreePlayer::Process ()
   from /home/kordosky/root.3.00.06/lib/libTreePlayer.so
#6  0x2000337cfcc in TTreePlayer::Process ()
   from /home/kordosky/root.3.00.06/lib/libTreePlayer.so
#7  0x2000147f0b4 in TTree::Process () from
/home/kordosky/root.3.00.06/lib/libTree.so.3.00
#8  0x200014957ac in G__TTree_Process_2_8__FP8G__valuePCcP8G__parami ()
   from /home/kordosky/root.3.00.06/lib/libTree.so.3.00
#9  0x200008ff774 in G__call_cppfunc () from
/home/kordosky/root.3.00.06/lib/libCint.so.3.00
#10 0x200008e68e8 in G__interpret_func ()
   from /home/kordosky/root.3.00.06/lib/libCint.so.3.00
#11 0x200008c64b0 in G__getfunction () from
/home/kordosky/root.3.00.06/lib/libCint.so.3.00
#12 0x2000097d808 in G__getstructmem () from
/home/kordosky/root.3.00.06/lib/libCint.so.3.00
#13 0x20000976698 in G__getvariable () from
/home/kordosky/root.3.00.06/lib/libCint.so.3.00
#14 0x200008becd0 in G__getitem () from
/home/kordosky/root.3.00.06/lib/libCint.so.3.00
#15 0x200008bd4b0 in G__getexpr () from
/home/kordosky/root.3.00.06/lib/libCint.so.3.00
#16 0x2000091e4d8 in G__exec_function () from
/home/kordosky/root.3.00.06/lib/libCint.so.3.00
#17 0x20000927f00 in G__exec_statement ()
   from /home/kordosky/root.3.00.06/lib/libCint.so.3.00
#18 0x200008a024c in G__exec_tempfile () from
/home/kordosky/root.3.00.06/lib/libCint.so.3.00
#19 0x200009348c0 in G__process_cmd () from
/home/kordosky/root.3.00.06/lib/libCint.so.3.00
#20 0x20000330314 in TCint::ProcessLine ()
   from /home/kordosky/root.3.00.06/lib/libCore.so.3.00
#21 0x200002697f4 in TApplication::ProcessLine ()
   from /home/kordosky/root.3.00.06/lib/libCore.so.3.00
#22 0x200017aaa08 in TRint::HandleTermInput ()
   from /home/kordosky/root.3.00.06/lib/libRint.so.3.00
#23 0x200017a91a4 in TTermInputHandler::Notify ()
   from /home/kordosky/root.3.00.06/lib/libRint.so.3.00
#24 0x200017aad80 in TTermInputHandler::ReadNotify ()
   from /home/kordosky/root.3.00.06/lib/libRint.so.3.00
#25 0x2000038e81c in TUnixSystem::CheckDescriptors ()
   from /home/kordosky/root.3.00.06/lib/libCore.so.3.00
#26 0x2000038ddbc in TUnixSystem::DispatchOneEvent ()
   from /home/kordosky/root.3.00.06/lib/libCore.so.3.00
#27 0x200002e8c14 in TSystem::InnerLoop ()
   from /home/kordosky/root.3.00.06/lib/libCore.so.3.00
#28 0x200002e8b54 in TSystem::Run () from
/home/kordosky/root.3.00.06/lib/libCore.so.3.00
#29 0x2000026a414 in TApplication::Run ()
   from /home/kordosky/root.3.00.06/lib/libCore.so.3.00
#30 0x200017aa320 in TRint::Run () from
/home/kordosky/root.3.00.06/lib/libRint.so.3.00
---Type <return> to continue, or q <return> to quit---
#31 0x120000b80 in main ()
(gdb) help

The seg fault looks like it comes from BuildRealData(), but perhaps that
is due to a mistake by SetAddress().  The Init() method is exactly what is
produced by MakeSelector.  I did notice one odd looking call in there:

   fChain->SetBranchAddress("HistRef",(void*)-1);

HistRef is my own class in a split branch.  That class has only basic data
types.

Thanks!

Mike Kordosky

On Mon, 9 Apr 2001, Rene Brun wrote:

> Hi Mike,
> 
> Difficult to make a diagnostic without having your code. It looks like an
> unitialized variable somewhere.
> It would also help if you could send the result of the debugger traceback
> when you get the seg fault, eg on Linux, run under gdb
>   gdb root.exe
>   root > tree->Process(....)
>      here you get the crash
>   gdb > info stack
> 
> Rene Brun
> 
>  
> Mike Kordosky wrote:
> > 
> > Hi,
> > 
> > I am using the TTree::MakeSelector method to analyze some data that I have
> > in a TTree.  It seems that when I initially have root compile the selector
> > code, I get a seg fault.  The shared library does get created though, and
> > further root sessions don't produce any problems.  Here is a sample
> > session:
> > 
> >   *******************************************
> >   *                                         *
> >   *        W E L C O M E  to  R O O T       *
> >   *                                         *
> >   *   Version   3.00/06      3 April 2001   *
> >   *                                         *
> >   *  You are welcome to visit our Web site  *
> >   *          http://root.cern.ch            *
> >   *                                         *
> >   *******************************************
> > 
> > FreeType Engine v1.x used to render TrueType fonts.
> > 
> > CINT/ROOT C/C++ Interpreter version 5.14.79, Feb 24 2001
> > Type ? for help. Commands must be C++ statements.
> > Enclose multiple statements between { }.
> > root [0] gSystem->Load("libTestStand.so");
> > root [1] TFile m3file("batch-1063.root");
> > root [2] TTree* tree = (TTree*)m3file.Get("T");
> > root [3] tree->Process("SimpleSelector.C+","fillList");
> > Creating shared library
> > /home/kordosky/work/devel/maketree/./SimpleSelector_C.soClass
> > SimpleSelector: Streamer() not declared
> > Class SimpleSelector: ShowMembers() not declared
> > 
> >  *** Break *** segmentation violation
> > Root > tree->Process("SimpleSelector.C+","fillList");
> > Unmodified script has already been compiled and loaded.
> > Starting SimpleSelector Analysis with Option: fillList
> > Before Histogram
> > Before HistRef
> > After HistRef
> > <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
> > root [5] .q
> > alpha2:/home/kordosky/work/devel/maketree# root
> >   *******************************************
> >   *                                         *
> >   *        W E L C O M E  to  R O O T       *
> >   *                                         *
> >   *   Version   3.00/06      3 April 2001   *
> >   *                                         *
> >   *  You are welcome to visit our Web site  *
> >   *          http://root.cern.ch            *
> >   *                                         *
> >   *******************************************
> > 
> > FreeType Engine v1.x used to render TrueType fonts.
> > 
> > CINT/ROOT C/C++ Interpreter version 5.14.79, Feb 24 2001
> > Type ? for help. Commands must be C++ statements.
> > Enclose multiple statements between { }.
> > root [0] gSystem->Load("libTestStand.so");
> > root [1] TFile m3file("batch-1063.root");
> > root [2] TTree* tree = (TTree*)m3file.Get("T");
> > root [3] tree->Process("SimpleSelector.C+","fillList");
> > Starting SimpleSelector Analysis with Option: fillList
> > Before Histogram
> > Before HistRef
> > After HistRef
> > <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
> > root [4] PostScript file: c1.ps has been created
> > 
> > My tree entry does contain a (split) class called HistRef, which I load
> > via gSystem->Load(...) above.  I include HistRef.h in the SimpleSelector.h
> > file.  Perhaps this is causing some of the problems? I actually don't care
> > about this one segfault, since I think that during the second session I
> > am running at compiled speed and the seg fault only seems to happen once.
> > Anyone got any ideas?
> > 
> > Thanks!
> > 
> > Mike Kordosky
> 



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:41 MET