linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: linux-c-programming@vger.kernel.org
Subject: sigaction() handler question
Date: Sat, 1 Mar 2003 16:34:43 +0100	[thread overview]
Message-ID: <20030301153443.GB27794@lug-owl.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 1312 bytes --]

Hi!

I've added a handler function for a SEGSEGV signal. I'm now that far
that I do know where (from the third void * parameter to the handling
function) to find the entry to the stack. So, for i386, I now can climb
down the stack printing out the stack trace.

Unfortunately, the void * (it is mentioned to be a (ucontext_t *) in
reality...) isn't *that* big help. The stack (with "stack" I here mean
that pointer which points to some stack frame's next stack pointer) is
(on i386) 11*sizeof(long) away. To the worse, I've not really found
helpful manpages or example sources on how to "really" walk down the
stack (from a segsegv handler function). I think this could really help
in debugging for production applications esp. on slow, small
memory-sized system where you otherwise can't shoot down some really
rarely SEGViolations which (of course:-) you can't reproduce in the labs
and (because of it being a multi-threaded application) you won't even
get a core from it...

MfG, JBG

-- 
   Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481
   "Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg
    fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!
      ret = do_actions((curr | FREE_SPEECH) & ~(IRAQ_WAR_2 | DRM | TCPA));

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2003-03-01 15:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-01 15:34 Jan-Benedict Glaw [this message]
2003-03-01 19:42 ` sigaction() handler question Glynn Clements

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=20030301153443.GB27794@lug-owl.de \
    --to=jbglaw@lug-owl.de \
    --cc=linux-c-programming@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).