Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 06 Jun 1998 09:23:32 -0500
From:      Pedro Giffuni <giffunip@asme.org>
To:        Guy Harris <guy@netapp.com>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: POSIX 1003.1-1996-style SA_SIGINFO signals in FreeBSD?
Message-ID:  <357950E3.51F37EC1@asme.org>
References:  <199806051953.MAA05129@tooting.netapp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
(Re-directed to hackers)

Guy Harris wrote:

> Somebody in "comp.emulators.ms-windows.wine" wanted to catch SIGSEGV and
> get the fault address to implement some stuff in Wine.
>
> I looked at the 2.2.6 source, and the only way I found of getting the
> fault address was to find the trap frame via information in the signal
> context (I assume you can do that, I didn't check in detail) and extract
> it from "tf_err" in the trap frame (which appears to be where it gets
> stuffed by the page fault trap handler).
>
> It's a bit easier in SVR4-flavored systems, as you can establish the
> signal handler with SA_SIGINFO set in "sa_flags" and extract it from the
> "siginfo_t" structure a pointer to which is passed to the handler as its
> second argument.  At least some of that is also specified by the 1996
> edition of POSIX 1003.1 (I didn't check whether it specifies a fault
> address for SIGSEGV or not).
>
> Are there any plans to put that into, say, FreeBSD 3.0?  Any idea if any
> of the other BSDs do it?
>

OpenBSD has it, from http://www.openbsd.org/plus.html#21

* A SA_SIGINFO implementation for sigaction() and signal handlers. This is
a small part of POSIX 1003.1b and
    permits the signal handler to figure out the exact cause of a signal;
such as fault address information for
    SIGSEGV or more detailed information for SIGFPE.

No idea if this is already on current.

    Pedro.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?357950E3.51F37EC1>