* Program execution
@ 2005-08-16 14:30 r_zaca
2005-08-16 14:48 ` Markus Rechberger
2005-08-16 15:16 ` Steve Graegert
0 siblings, 2 replies; 3+ messages in thread
From: r_zaca @ 2005-08-16 14:30 UTC (permalink / raw)
To: linux-c-programming
[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 360 bytes --]
Hello all,
I have a program that just stops execution and I can't see what is really
going on. Does anyone know how this kind of problem shoud be solved. I've
already read something about core dump memory, but I don't know how to make
it, or instruct my program to do that. Can anyone help me?
p.s.) My program runs on a Linux machine.
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Program execution
2005-08-16 14:30 Program execution r_zaca
@ 2005-08-16 14:48 ` Markus Rechberger
2005-08-16 15:16 ` Steve Graegert
1 sibling, 0 replies; 3+ messages in thread
From: Markus Rechberger @ 2005-08-16 14:48 UTC (permalink / raw)
To: r_zaca, linux-c-programming
Hello,
first enable coredumps
# ulimit -c unlimited
# ./yourfaultyapp
open another shell and kill the process using kill -SIGSEGV then it
should say core dumped (also compile your application with -g .. there
are a few other debugging options but that one might already help you)
afterwards run your application with gdb (should look like the following line)
# gdb ./yourfaultyapp coredumpfile
> bt // for a backtrace, last functions which got called and so
> frame #<framenumber> // inspect a frame
> list // show the sourcecode which is connected to that frame
hope this helps,
Markus
On 8/16/05, r_zaca <r_zaca@ig.com.br> wrote:
> Hello all,
>
> I have a program that just stops execution and I can't see what is really
> going on. Does anyone know how this kind of problem shoud be solved. I've
> already read something about core dump memory, but I don't know how to make
> it, or instruct my program to do that. Can anyone help me?
>
> p.s.) My program runs on a Linux machine.
>
> Thanks.
>
>
--
Markus Rechberger
http://www.wikiservice.at/dse/wiki.cgi?MarkusRechberger
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Program execution
2005-08-16 14:30 Program execution r_zaca
2005-08-16 14:48 ` Markus Rechberger
@ 2005-08-16 15:16 ` Steve Graegert
1 sibling, 0 replies; 3+ messages in thread
From: Steve Graegert @ 2005-08-16 15:16 UTC (permalink / raw)
To: r_zaca; +Cc: linux-c-programming
On 8/16/05, r_zaca <r_zaca@ig.com.br> wrote:
> Hello all,
>
> I have a program that just stops execution and I can't see what is really
> going on. Does anyone know how this kind of problem shoud be solved. I've
> already read something about core dump memory, but I don't know how to make
> it, or instruct my program to do that. Can anyone help me?
When a (UNIX) program exits abnormally it usally has received a signal
and probably has, depending on the signal (SIGSEGV, for example),
written a core dump. You can then examine the core dump by running
gdb:
$ gdb myapp core.1234
gdb usually jumps straight to the line where the crash occured.
If your program does not generate a core dump you can force it to do
so by calling abort(). A better solution is to provide an error
handler that automatically writes a core dump.
Regards
\Steve
--
Steve Graegert <graegerts@gmail.com>
Software Consultancy {C/C++ && Java && .NET}
Mobile: +49 (176) 21248869
Office: +49 (9131) 7126409
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-08-16 15:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-16 14:30 Program execution r_zaca
2005-08-16 14:48 ` Markus Rechberger
2005-08-16 15:16 ` Steve Graegert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).