All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christophe Rhodes <csr21@cam.ac.uk>
To: "David S. Miller" <davem@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: SPARC and SA_SIGINFO signal handling
Date: Wed, 31 Oct 2001 09:43:43 +0000	[thread overview]
Message-ID: <20011031094342.A27520@cam.ac.uk> (raw)
In-Reply-To: <20011029190027.A21372@cam.ac.uk> <20011030.125134.93645850.davem@redhat.com>
In-Reply-To: <20011030.125134.93645850.davem@redhat.com>

On Tue, Oct 30, 2001 at 12:51:34PM -0800, David S. Miller wrote:
> 
> You're doing something really wrong, it works perfectly
> fine here:
> 
> ? cat test.c
> #include <stdlib.h>
> #include <sys/ucontext.h>
> #include <signal.h>
> 
> void sigsegv_handler (int signo, siginfo_t *info, void *data) {
> 	if (info != 0)
        ^^^^

This gets me the siginfo struct; this is fine, and I'm happy with this
part.

However, what I don't see to get at is the usercontext/ucontext
structure containing register contents and so on, which as far as I am
aware should be in the third (data) argument to the sa_sigaction-type
sighandler; that's where I'm getting my problems.

> 		exit(1);
> 	exit(0);
> }
> [...]

Change the info above to data, and...

[ x86 does what I expect... ]
csr21@lambda:~$ uname -a
Linux lambda 2.4.13-ac4 #1 Mon Oct 29 18:26:51 GMT 2001 i686 unknown
csr21@lambda:~$ ./foo
csr21@lambda:~$ echo $?
1

[ sparc doesn't ]
csr21@caligula:~$ uname -a
Linux caligula 2.4.6 #1 SMP Sun Sep 30 16:40:07 BST 2001 sparc64
unknown
csr21@caligula:~$ ./foo
csr21@caligula:~$ echo $?
0

Thanks,

Christophe
-- 
Jesus College, Cambridge, CB5 8BL                           +44 1223 510 299
http://www-jcsu.jesus.cam.ac.uk/~csr21/                  (defun pling-dollar 
(str schar arg) (first (last +))) (make-dispatch-macro-character #\! t)
(set-dispatch-macro-character #\! #\$ #'pling-dollar)

  reply	other threads:[~2001-10-31  9:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-29 19:00 SPARC and SA_SIGINFO signal handling Christophe Rhodes
2001-10-30 20:51 ` David S. Miller
2001-10-31  9:43   ` Christophe Rhodes [this message]
2001-10-31 10:11     ` David S. Miller
2001-11-03 19:59       ` Richard Henderson
2001-11-03 23:54         ` David S. Miller
2001-11-04 17:25           ` Richard Henderson
2001-11-07  9:33           ` Christophe Rhodes

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=20011031094342.A27520@cam.ac.uk \
    --to=csr21@cam.ac.uk \
    --cc=davem@redhat.com \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.