Std::bad_alloc

Hello, I have a simple code that I compile and execute on lxplus. The main routine just load a root file with several histogram, them in a loop I produce a .gif image per histogram and then I save all of them to create an animated .gif. Here and there I do some graphical restyling. Now, when I run the code, after 52 steps I get:

terminate called after throwing an istance of ‘std::bad_alloc’
what(): Std9bad_alloc
Abort

To compile I use:
g++ root-config --cflags --libs --ldflags --glibs RICH_MovieMakex.cxx -o RICH_MovieMakex

I attach the source file.
Any Idea?
Thanks, Davide
RICH_MovieMaker.cxx (17.5 KB)

I cannot run your program because I do not have the root and txt files:

pcphsft55> ./RICH_MovieMakex
Reading your files...
Error, can't read input .txt file!
Give the number of slices (positive integer value): 4
Give the number of events per slice (greater than 0): 3
Give slide frequency (greater than 0): 3
Drawing the animated hitmap
Error in <TFile::TFile>: file run62152.root does not exist
Error, can't read input .root file!

Hello, I can give the file, but it is quite big (30M). Where do you want me to copy it?
Please, let me know!
Regards
Davide

in your public on afs ?

Hi, the two files (you need both) are here:

virgilio.mib.infn.it/~dperego/RootExperts/

Please, let me know!
Regards
Davide

ok I got them.

How long does it take ?
I started it… it is running… using CPU … but nothing happen

pcphsft55>  ./RICH_MovieMakex
Reading your files...
Drawing the animated hitmap
Now reading slice: 1

Ok, this happen also if I use my desktop (SLC4).
Please, use your lxplus account and CPU, I don’t know why but on lxplus it works (more or less).
Davide

Hmmm… that does not sound very logical … I should be able to run it on my Desktop to… My guess is that on lxplus there is a time limit on job execution and my be your job was stop… this morning your program was still in the same state on my desktop after having run all night …

Hi, I agree with you. But please try on lxplus, the process is very fast, and the program will stop after 52 steps.
Cheers
DvD

see root.cern.ch/phpBB2/viewtopic.php?p=40588#40588

Rene