Seg. fault when using TCutG cut in a TChain chain

Below is the set of root input and output:

14:57:~/code/root/read/root-scripts>root
root [0] TChain *ptree= new TChain("ptree") ; ptree->Add("$CAENROOT/run159.root"); ptree->Add("$CAENROOT/run159_1.root");
root [1] .x ../psd-cut/cut_02_01/cut_ch1.C                                                                               
<TCanvas::MakeDefCanvas>: created default TCanvas with name c1
root [2] cutg->GetName()                                                                                                 
(const char* 0xb835f8)"cut1"
root [3] ptree->Draw("Ec","cut1")                                                                                        

 *** Break *** segmentation violation
Attaching to program: /proc/6608/exe, process 6608
[Thread debugging using libthread_db enabled]
[New Thread 0x7f657c4156f0 (LWP 6608)]
0x00007f657976d4a5 in waitpid () from /lib/libc.so.6
error detected on stdin
The program is running.  Quit anyway (and detach it)? (y or n) [answered Y; input not from terminal]
Detaching from program: /proc/6608/exe, process 6608
Root > 

And here is the interesting thing – if I do not Add the second file to the Chain, everything works out just fine:

14:58:~/code/root/read/root-scripts>root 
root [0] TChain *ptree= new TChain("ptree") ; ptree->Add("$CAENROOT/run159.root");                                       
root [1] .x ../psd-cut/cut_02_01/cut_ch1.C                                        
<TCanvas::MakeDefCanvas>: created default TCanvas with name c1
root [2] cutg->GetName()                                                          
(const char* 0xb83598)"cut1"
root [3] ptree->Draw("Ec","cut1")                                                 
(Long64_t)23200
root [4] 

What am I doing wrong?

p.s. the cut_ch1.C script is attached for your inspection.

p.p.s. just in case if this matters: the two files that go into the chain are together about 2.1GB, and total to ~10.7mln entries.
cut_ch1.C (1.86 KB)

Hi,

You might be able to debug the problem by using gdb or valgrind.
Alternatively, could you post the root file somewhere so that we can reproduce the problem?

Cheers,
Philippe.

Dear Philippe, thanks for responding.

I would post the .root files, however the smaller one is 0.3GB…the larger one ~2GB.
Is there a place on cern servers where I could upload it?

Btw, I run another test:

16:23:~/code/root/read/root-scripts>cp $CAENROOT/run159_1.root $CAENROOT/run159_test.root
16:23:~/code/root/read/root-scripts>root
root [0] TChain *ptree= new TChain("ptree") ; ptree->Add("$CAENROOT/run159_test.root"); ptree->Add("$CAENROOT/run159_1.root"); 
root [1] .x ../psd-cut/cut_02_01/cut_ch1.C              
<TCanvas::MakeDefCanvas>: created default TCanvas with name c1
root [2] ptree->Draw("Ec","cut1")                   

 *** Break *** segmentation violation
Attaching to program: /proc/10968/exe, process 10968
[Thread debugging using libthread_db enabled]
[New Thread 0x7fe99dd836f0 (LWP 10968)]
0x00007fe99b0db4a5 in waitpid () from /lib/libc.so.6
error detected on stdin
The program is running.  Quit anyway (and detach it)? (y or n) [answered Y; input not from terminal]
Detaching from program: /proc/10968/exe, process 10968
Root > 

Individually all files work fine. It appears that bad things happen when root switches from one file to another.

Hi,

I do not have a good place for you to post of a file, however I can read file on afs.

To debug this problem you might want to try to use valgrind (valgrind.org) to pin-point where the crash is coming from.

Cheers,
Philippe.