Dear Root experts,
I’m experiencing a very frustrating crash when projecting a histogram in compiled code. I wrote a very simple test program that:
- opens root file
- gets ttree
- books a histogram
- projects one variable onto the booked histogram.
The code compiles without problems but crashes when projecting the histogram. I have put the simplified version of the code in www-hep.colorado.edu/~eluiggi/testRoot.tar. The tar includes the code, makefile, and the rootfile.
I’m experiencing this problem both on my machine running root version 5.27/03 and gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3, and on my workstation running root version 5.22/00 (cms) and gcc 3.4.5.
The Makefile is very simple and in my machine has the following definitions:
ROOTGLIBS = -L/usr/local/bin/root/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lz -lGui -pthread -lm -ldl -rdynamic
ROOTCFLAGS = -pthread -m32 -I/usr/local/bin/root/include
Below, I’m copying the output of gdb running the test program.
Thanks for any help.
Eduardo Luiggi
luiggi@cepheid> gdb test
GNU gdb 6.8-debian
Copyright © 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and “show warranty” for details.
This GDB was configured as “i486-linux-gnu”…
(gdb) run
Starting program: /home/luiggi/work/cms/hiMassTauTau/test
[Thread debugging using libthread_db enabled]
[New Thread 0xb4dda6d0 (LWP 31709)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb4dda6d0 (LWP 31709)]
0xb72d1a24 in TClass::AddRef () from /usr/local/bin/root/lib/libCore.so
Current language: auto; currently asm
(gdb) bt
#0 0xb72d1a24 in TClass::AddRef () from /usr/local/bin/root/lib/libCore.so
#1 0xb72e3377 in TClassRef::InternalGetClass () from /usr/local/bin/root/lib/libCore.so
#2 0xb76a06fe in TClassRef::GetClass () from /usr/local/bin/root/lib/libCore.so
#3 0xb5f055f0 in TBranchElement::InitInfo () from /usr/local/bin/root/lib/libTree.so
#4 0xb5efc6a8 in TBranchElement::GetInfo () from /usr/local/bin/root/lib/libTree.so
#5 0xb4c42cc5 in TTreeFormula::FindLeafForExpression () from /usr/local/bin/root/lib/libTreePlayer.so
#6 0xb4c44cb9 in TTreeFormula::DefinedVariable () from /usr/local/bin/root/lib/libTreePlayer.so
#7 0xb64da896 in TFormula::Analyze () from /usr/local/bin/root/lib/libHist.so
#8 0xb64e5a8a in TFormula::Compile () from /usr/local/bin/root/lib/libHist.so
#9 0xb4c334e4 in TTreeFormula::Init () from /usr/local/bin/root/lib/libTreePlayer.so
#10 0xb4c3563a in TTreeFormula::TTreeFormula () from /usr/local/bin/root/lib/libTreePlayer.so
#11 0xb4c2abff in TSelectorDraw::CompileVariables () from /usr/local/bin/root/lib/libTreePlayer.so
#12 0xb4c2b304 in TSelectorDraw::Begin () from /usr/local/bin/root/lib/libTreePlayer.so
#13 0xb4c500f1 in TTreePlayer::Process () from /usr/local/bin/root/lib/libTreePlayer.so
#14 0xb4c5c7dc in TTreePlayer::DrawSelect () from /usr/local/bin/root/lib/libTreePlayer.so
#15 0xb5f4478d in TTree::Draw () from /usr/local/bin/root/lib/libTree.so
#16 0xb5f43eae in TTree::Project () from /usr/local/bin/root/lib/libTree.so
#17 0x08048ac5 in main () at test.C:12
(gdb)