+= operator and crash root cint

From: Venkatesh Kaushik <venkat.kaushik_at_cern.ch>
Date: Fri, 14 May 2010 05:44:30 -0700


Dear ROOT team,
a) Apologies if this is already a known/fixed issue, I couldn't find any mention of it.
b) I wanted to compute bin-labels and wrote a small macro (which follows) and it
crashed at the line where I have used a += operator. When I replaced it with val = val + 0.5
all is well and I get the desired output. Any suggestions appreciated. Regards,
Venkat

I am using ROOT that ships with Fink 0.29.10 installation on my Mac OS X (10.6.3 snow leopard)

05:41:37]:Downloads> gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5659)

05:40:56]:Downloads> root-config --version 5.22/00b

macro:
void test() {

   float val = 0.5;
   for(int i = 0; i < 13; i++) {

     std::cout << val << "\t" << TMath::Log10(val) << std::endl;
     val = val + 0.5; // <-- this works
     // val += 0.5; // <-- ROOT CINT doesn't like this
   }
}

stack trace:
Processing test.C...
0.5 -0.30103 Thread 1 (process 1813):
#0  0x99586515 in wait4 ()
#1  0x995f5493 in system$UNIX2003 ()
#2  0x0010bf8a in TUnixSystem::StackTrace ()
#3  0x0010f380 in TUnixSystem::DispatchSignals ()
#4  0x0010f458 in SigHandler ()
#5 <signal handler called>
#6  0x0086f880 in G__getexpr ()
#7  0x00903555 in G__exec_statement ()
#8  0x009102c9 in G__exec_loop ()
#9  0x0090c630 in G__exec_statement ()
#10 0x00847422 in G__exec_tempfile_core ()
#11 0x00847716 in G__exec_tempfile ()
#12 0x0091c8d0 in G__process_cmd ()
#13 0x000fd29b in TCint::ProcessLine ()
#14 0x000fc56f in TCint::ProcessLineSynch ()
#15 0x0005eefb in TApplication::ExecuteFile ()
#16 0x0005c5f5 in TApplication::ProcessLine ()
#17 0x0113547f in TRint::Run ()
#18 0x00001abe in main ()

-- 
=========================================================
               Venkatesh Kaushik, Ph.D
                  Research Associate
University of Arizona              ATLAS Experiment_at_CERN
Office: PAS 334                    40-1-C11
Tucson, Arizona                    Genève, Switzerland
Tel: +1 520 626 7042               +41 22 76 79137
venkat_at_physics.arizona.edu         venkat.kaushik_at_cern.ch
         http://atlas.physics.arizona.edu/~venkat
=========================================================
Received on Fri May 14 2010 - 14:44:46 CEST

This archive was generated by hypermail 2.2.0 : Fri May 14 2010 - 17:50:01 CEST