Re: Merging with 'hadd' results in 'std::bad_alloc'

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Wed, 12 Oct 2011 04:06:02 -0500


Hi Ida,

One thing you can do is to try to merge only 2 of the file together. If this succeeds you can merge the file 2 at times and them merge the results (i.e. hadd -f intermediate1.root one.root two.root; hadd -f intermediate2.root three.root four.root; hadd -f intermediate3.root five.root six.root; hadd -f intermediate4.root intermediate1.root intermediate2.root; hadd -f final.root intermediate3.root intermediate4.root).

 > but how do I attain the "stack trace information"?

It 'should' have been printed at the end of the output. Alternatively, you ought to be able to see it when running in a debugger:

gdb --args hadd -f final.root one.root two.root three.root four.root five.root six.root $ run
* seg fault after several hours *
$ where

Cheers,
Philippe.

PS. Alternatively, if you can shared with us the 6 files, we can check what the problem is.

On 10/12/11 3:28 AM, Ida Häggström wrote:
> Hello Philippe and thanks for your input!
>
> I've installed ROOT v5.30 and tried hadd on all six files. After about 2.5 hours I recieved the error "*** Break *** bus error". I
> started a run with only five of the files yesterday (root 5.28), but this morning I found it had crashed as usual with
> "std::bad_alloc". I've looked at all six root-files and there seem to be nothing wrong with them (no errors on opening them, all
> trees are there). I will now try and send my files to a cluster computer and see if I can hadd them there... I really need to
> merge those files... And I'm sorry but my root and c++ skills are not at all what they should be, but how do I attain the "stack
> trace information"?
> Thanks!
> Ida
>
> On Tue, Oct 11, 2011 at 3:21 PM, Philippe Canal <pcanal_at_fnal.gov <mailto:pcanal_at_fnal.gov>> wrote:
>
> Hi Ida,
>
> Could you try with v5.30? What is the minimal number of files needed to reached this problem (i.e. does it also crash if you
> merge
> only 5 files)? Does it matter which file you try to merge with (i.e. if you merge 6 times with the first file does it also
> crash)? Was there any stack trace information?
>
> Philippe.
>
> On 10/11/11 8:14 AM, Ida Häggström wrote:
> > Hello!
> >
> > I'll start with some info:
> > Root version: 5.28/00a (21 February 2011)
> > OS: Ubuntu version 10.10 (as a guest via VirtualBox4.0.4 on host Windows 7)
> > Memory:
> >
> > I'm experiencing some problems when trying to merge some root files. I have six files (around 1.1 GB each) that I want to merge.
> > The files contain the same structure (four different trees + some histograms each). I'm trying to use the 'hadd' method, but
> after
> > a couple of hours it crashes with the message "terminate called after throwing an instance of 'std::bad_alloc'" (see below).
> > I've googled the issue and figured I run out of memory (I'm not so skilled with root or C++!).
> >
> > I found a thread addressing a similar issue as mine (http://root.cern.ch/phpBB3/viewtopic.php?t=9008) where it was suggested to
> > flush the baskets of each root file, then use hadd. I've tried this according to:
> > TFile f(fileName.c_str(),"update");
> > cout << "Flushing \"finalCoinci\"..." << endl;
> > TTree *T1 = (TTree*)f.Get("finalCoinci");
> > T1->FlushBaskets();
> > T1->Write();
> >
> > but I still get the same error.
> >
> > ------------------------------------------------
> > hadd test.root rootOutput*
> > Target file: test.root
> > Source file 1: rootOutput_Prompts_t0-1.root
> > Source file 2: rootOutput_Prompts_t0-2.root
> > Source file 3: rootOutput_Prompts_t0-3.root
> > Source file 4: rootOutput_Prompts_t0-4.root
> > Source file 5: rootOutput_Prompts_t0-5.root
> > Source file 6: rootOutput_Prompts_t0-6.root
> > Target path: test.root:/
> > rootOutput_Prompts_t0-1.root tree:finalCoinci entries=1234567890
> > rootOutput_Prompts_t0-2.root tree:finalCoinci entries=1234567890
> > rootOutput_Prompts_t0-3.root tree:finalCoinci entries=1234567890
> > rootOutput_Prompts_t0-4.root tree:finalCoinci entries=1234567890
> > rootOutput_Prompts_t0-5.root tree:finalCoinci entries=1234567890
> > rootOutput_Prompts_t0-6.root tree:finalCoinci entries=1234567890
> > terminate called after throwing an instance of 'std::bad_alloc'
> > what(): std::bad_alloc
> > Aborted
> > ------------------------------------------------
> >
>
>
Received on Wed Oct 12 2011 - 11:06:16 CEST

This archive was generated by hypermail 2.2.0 : Wed Oct 12 2011 - 17:50:01 CEST