[ADMB Users] memory allocation error

Derek Seiple dseiple84 at gmail.com
Tue Feb 28 05:27:32 PST 2012


If you are using gdb in the command line, then to put in a breakpoint you type

break <file>:<line>

so find where ad_exit() is in the code, say it is in ad_exit_file.cpp
at line 300 then you would say

break ad_exit_file.cpp:300

There are other ways but this is the easiest.

Once you run your program and it stops at your breakpoint type in 'bt'
without the quotes (bt for "backtrace"). That will give you a list of
functions: the function you are currently in, the function that called
the function you are in, the one that called that function, ... etc
back to main().

Hope that helps,

Derek

On Tue, Feb 28, 2012 at 12:27 AM, Mollie Brooks <mbrooks at ufl.edu> wrote:
> I have a memory allocation error. I found Dave's response to this problem in
> the past.
> http://groups.google.com/group/admb-users/browse_thread/thread/bfdc7a95371c9bf6/1e5f21e161033c20?lnk=gst&q=memory+allocation+error&pli=1
>
> However, I was hoping to get some of the gaps filled in.
> Dave says
> "If you compile your program in debug mode and put a breakpoint in
> ad_exit()
> and do a stack trace you can find the line where this is happening. It may
> be that you are doing something like trying to allocate a vector where
> one of the arguments is uninitialized. "
>
> Broken down into steps this is:
> (1) compile your program in debug mode
> I know this means to compile code with option -g and execute it as gdb
> --args ./
> (2)put a breakpoint in ad_exit()
> (3)do a stack trace
>
> Could someone please elaborate on steps (2) and (3) for me?
>
> thanks,
> Mollie
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/users
>



More information about the Users mailing list