From: Eli Zaretskii <eliz@elta.co.il>
To: "Robin Rowe" <rower@MovieEditor.com>
Cc: gdb@sources.redhat.com
Subject: Re: Crash log
Date: Tue, 23 Sep 2003 05:03:00 -0000 [thread overview]
Message-ID: <u1xu8dopy.fsf@elta.co.il> (raw)
In-Reply-To: <0ca201c3814a$8e899490$0200a8c0@tbird> (rower@MovieEditor.com)
> From: "Robin Rowe" <rower@MovieEditor.com>
> Date: Mon, 22 Sep 2003 13:46:08 -0700
>
> When a program catches a bad signal such as SIGSEGV I want to write a crash
> log entry before the program exits. Is there anything useful I can put in
> the log besides the name of the program and when it crashed?
Yes, you can put there the address of the faulting instruction. Use
the Posix `sigaction' rather than `signal' to install the signal
handler, and you will have access to the siginfo_t structure which
gives the address of the memory location that caused the fault and
other useful info.
Some systems have extensions to `signal' that allow the signal
handlers to access the same information.
> Is it ok to
> write this log from my signal catcher, or should it first fork?
It's probably okay in most cases to do this without forking, although
some calamities such as smashed stack might cause another fault in the
code that writes the data. But then fork will probably fail in that
case as well.
prev parent reply other threads:[~2003-09-23 5:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-22 20:46 Robin Rowe
2003-09-23 5:03 ` Eli Zaretskii [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=u1xu8dopy.fsf@elta.co.il \
--to=eliz@elta.co.il \
--cc=gdb@sources.redhat.com \
--cc=rower@MovieEditor.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox