RE: Gross CINT runtime error

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Mon, 27 Aug 2007 15:52:51 -0500


Hi Tom,

Could you try after disabling the CINT optmizer (Cint commend .O 0)? Is it an option for you to compile your script (using ACLiC)? Can you provide a complete example reproducing the problem?

Cheers,
Philippe

-----Original Message-----
From: owner-roottalk_at_pcroot.cern.ch [mailto:owner-roottalk_at_pcroot.cern.ch] On Behalf Of Tom Roberts
Sent: Monday, August 27, 2007 3:05 PM
To: 'ROOT Talk'
Subject: [ROOT] Gross CINT runtime error

This simple loop hangs forever. Note that ntuples[] has two valid pointers (TNtuples with 25 and 15 entries), and nNtuples=2; they are both class variables. This is a small part of a large macro entered on the root command-line. This code is preparing to fill a TGraph with data from multiple TNtuples, and needs to know how many entries to allocate.

         // count total entries
         int ntotal=0;
         for(int j=0; j<nNtuples; ++j) {
                 TNtuple *ntuple = ntuples[j];
                 ntotal += ntuple->GetEntries();
         }


So I instrumented it:
         // count total entries
         int ntotal=0;

//int k=0;
for(int j=0; j<nNtuples; ++j) {

//if(++k > 100) break;

printf("scan total entries A: j=%d\n",j); fflush(stdout);
                 TNtuple *ntuple = ntuples[j];
printf("scan total entries B: j=%d\n",j); fflush(stdout);
                 ntotal += ntuple->GetEntries();
printf("scan total entries C: j=%d\n",j); fflush(stdout);
         }

printf("scan: nNtuples=%d ntotal=%d\n",nNtuples,ntotal); fflush(stdout);

The output runs forever and begins:

scan total entries A: j=0
scan total entries B: j=0
scan total entries C: j=0
scan total entries A: j=1
scan total entries B: j=1
scan total entries C: j=0
scan total entries A: j=1
scan total entries B: j=1
scan total entries C: j=0
scan total entries A: j=1
scan total entries B: j=1
scan total entries C: j=0

... repeat last 3 lines forever

Clearly something is clobbering j. If I give it 3 or more TNtuples in ntuples[] and nNtuples, j still gets set to 0 while processing j=1.

The weird part which makes me think this is a CINT problem: If I uncomment the two lines referencing k it executes properly (i.e. 2 times through the loop).

This routine was called in response to the signal from a carriage-return entered into a TGTextEntry. Results are identical if it is called in response to moving either end of a TGDoubleHSlider. No surprise -- I built my own widget containing a TGDoubleHSlider and two TGTextEntry-s, and it generates a Changed() signal that was connected to this routine. As this smells like a signal problem, I am currently re-structuring my code to avoid the cascaded signals....

This is root 5.14 running on Mac OS X (Intel). On Linux it also hangs in response to that <CR>, but I did not track it down.

Tom Roberts Received on Mon Aug 27 2007 - 22:59:11 CEST

This archive was generated by hypermail 2.2.0 : Tue Aug 28 2007 - 05:50:02 CEST