Operating System - HP-UX
1837239 Members
2161 Online
110115 Solutions
New Discussion

Application Exiting Without Core

 
Chris_164
Contributor

Application Exiting Without Core

I have a third party application that continuely exits with status code 377 (Exhausted Available Memory). Is there any way to force the application to generate a stack trace either via DDE or GDB? When I execute the application within DDE or GDB the application exits and I am unable to see the stack.

Thanks,
Chris Thompson
3 REPLIES 3
Adam J Markiewicz
Trusted Contributor

Re: Application Exiting Without Core

Hi

Try this (untested):
start program under gdb, then type:
xbreak malloc
(you'll get breakpoint number, the first one is '1')
then
condition 1 $ret0=0
(register ret0 contains the result of function)
then
run

HTH
Good luck
Adam
I do everything perfectly, except from my mistakes
A. Clay Stephenson
Acclaimed Contributor

Re: Application Exiting Without Core

Your problem is that even when you try to add a breakpoint; it's likely not even "close" to the right spot. Because of the "bogus" (i.e. non-errno value) and the non-standard error message (i.e. not generated by perror()), I can't even rule out that this is a "normal" dynamic memory allocation error. This might simply be that a statically defined array has filled and the program detects this and exits. In that case, it's a program induced exit and no core file would be generated.

I do assume that you have not done ulimit -c 0 to suppress core file creation.

This is probably one of those times when it's time to call the developers. You might try increasing maxdsiz and ensuring that you have plenty of swap but I doubt that it's going to help.

If it ain't broke, I can fix that.
Mike Stroyan
Honored Contributor

Re: Application Exiting Without Core

You could try using gdb and setting breakpoints on exit and _exit. I often use that to catch programs that are printing an error message and exiting.

(gdb) b exit
Breakpoint 1 (deferred) at "exit" ("exit" was not found).
Breakpoint deferred until a shared library containing "exit" is loaded.
(gdb) b _exit
Breakpoint 2 (deferred) at "_exit" ("_exit" was not found).
Breakpoint deferred until a shared library containing "_exit" is loaded.
(gdb) r