Re: [ROOT] seg. violation in TTree::Branch

From: Topher Cawlfield (cawlfiel@uiuc.edu)
Date: Wed Apr 09 2003 - 00:09:24 MEST


Sorry, I forgot to include exactly what I'm seeing when I compile and 
run this.  Here ya go:

topher@tophtop 18:05$ make
g++ -g -Wall -fPIC -D_REENTRANT -I/usr/local/root/include -c exampleTree.cxx
g++ -g -Wall -fPIC -D_REENTRANT -I/usr/local/root/include -c CCABit.cxx
rootcint -f CCABitDict.cxx -c CCABit.h
g++ -g -Wall -fPIC -D_REENTRANT -I/usr/local/root/include -c CCABitDict.cxx
g++ -shared -g CCABit.o CCABitDict.o -L/usr/local/root/lib -lCore -lCint 
-lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix 
-lPhysics -lpthread -lm -ldl -rdynamic  -o libCCABit.so
g++ -g exampleTree.o libCCABit.so -L/usr/local/root/lib -lCore -lCint 
-lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix 
-lPhysics -lpthread -lm -ldl -rdynamic  -o exampleTree
rm CCABitDict.cxx

topher@tophtop 18:05$ gdb exampleTree
GNU gdb 5.3-22mdk (Mandrake Linux)
...
(gdb) run
Starting program: /home/topher/root/simpleTree/exampleTree
[New Thread 16384 (LWP 8020)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 8020)]
0x405e8041 in G__ClassInfo::RootFlag() () from 
/usr/local/root/lib/libCint.so
Current language:  auto; currently c
(gdb) where
#0  0x405e8041 in G__ClassInfo::RootFlag() ()
    from /usr/local/root/lib/libCint.so
#1  0x40caaa6c in __JCR_LIST__ () from /usr/local/root/lib/libTree.so
#2  0x40c1da8b in TTree::Branch(char const*, char const*, void*, int, 
int) ()
    from /usr/local/root/lib/libTree.so
#3  0x08048dc5 in main (argc=1, argv=0xbffff514) at exampleTree.cxx:36
#4  0x40f077f7 in __libc_start_main () from /lib/i686/libc.so.6
(gdb) l 36
31         // Create a ROOT Tree
32         TTree *tree = new TTree("T","An example of a ROOT tree");
33
34         tree->Branch("event", &myevent.x, "x/F:y"); // this works fine
35         //  tree->Branch("CCABitArray", &ccaa); // !!GIVES ME A 
SEGMENTATION VIOLATION!!
36         tree->Branch("CCABitArray", "TClonesArray", &ccaa); // same thing
37         //   tree->Branch(&ccaa); // doesn't work either
38         int nev;
39
40         // Fill event with some random numbers
(gdb)

This may help.

  - Topher



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:10 MET