[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Error message 'std::bad_alloc'



On Thursday 17 April 2008 16.09.38 Francesco Pietra wrote:
> Hi:
> OK. However, as my experience with compilations is very limited, could you
> give a web indication where to learn how to "build with debug info and run
> it under gdb and/or valgrind". Meanwhile I am starting a molecular dynamics
> simulation. As soon as completed (1-3 days, have not yet checked the speed
> of the new machine) I'll follow your indications. Thanks
> francesco pietra

Hi Francesco,

Run the compiler (g++) with the -g flag to add debug info (configure the 
source using 'CXXFLAGS="-g" ./configure' should do the trick).

You can debug the application by running gdb as 'gdb --args <prog> <args>'. 
When it dies, type bt to dump the callstack.

// Anders

> --- On Thu, 4/17/08, C. Ahlstrom <ahlstromc@bellsouth.net> wrote:
> > From: C. Ahlstrom <ahlstromc@bellsouth.net>
> > Subject: Re: Error message 'std::bad_alloc'
> > To: "Francesco Pietra" <chiendarret@yahoo.com>
> > Cc: "Lennart Sorensen" <lsorense@csclub.uwaterloo.ca>, "debian64"
> > <debian-amd64@lists.debian.org> Date: Thursday, April 17, 2008, 4:02 AM
> > ++++++++ Francesco Pietra 15:29 Wed 16 Apr      ++++++++
> >
> > >> >The std:: would to me make me think C++
> >
> > namespace
> >
> > >> 'std' function
> > >>
> > >> >'bad_alloc'.  So probably a bad_alloc
> >
> > function
> >
> > >> exists in C++ and is
> > >>
> > >> >returning an error.
> > >>
> > >> It is a standard exception thrown when the new()
> >
> > operator
> >
> > >> fails.
> > >>
> > >> Your running out of RAM, perhaps.
> > >>
> > >> Do you build this program yourself from source?
> > >
> > >Yes (g77-3.4 g++ 4.1.2 lib2c0-dev) from the configure
> >
> > file provided by
> >
> > >developers. No errors in either the serial or parallel
> >
> > compilations
> >
> > >(openmpi). Also, there is a very long test for both the
> >
> > serial and
> >
> > >parallel execution. All passed with a few marginal
> >
> > warnings for
> >
> > >different precision on different machines. Finally,
> >
> > docking of a
> >
> > >slightly smaller ligands occurs with no errors.
> >
> > I'd build with debug info and run it under gdb and/or
> > valgrind.  Might
> > tell you where it is messing up.
> >
> > --
> > I develop for Linux for a living, I used to develop for
> > DOS.
> > Going from DOS to Linux is like trading a glider for an
> > F117.
> > (By entropy@world.std.com, Lawrence Foard)
> >
> >
> > --
> > To UNSUBSCRIBE, email to
> > debian-amd64-REQUEST@lists.debian.org
> > with a subject of "unsubscribe". Trouble? Contact
> > listmaster@lists.debian.org
>
>      
> ___________________________________________________________________________
>_________ Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile.  Try it now. 
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


Reply to: