From owner-freebsd-hackers Sat Jun 6 07:25:24 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA06783 for freebsd-hackers-outgoing; Sat, 6 Jun 1998 07:25:24 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from usc.usc.unal.edu.co ([200.21.26.65]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id HAA06773 for ; Sat, 6 Jun 1998 07:25:14 -0700 (PDT) (envelope-from giffunip@asme.org) Received: from unalmodem17.usc.unal.edu.co by usc.usc.unal.edu.co (AIX 4.1/UCB 5.64/4.03) id AA18018; Sat, 6 Jun 1998 10:06:41 -0400 Message-Id: <357950E3.51F37EC1@asme.org> Date: Sat, 06 Jun 1998 09:23:32 -0500 From: Pedro Giffuni Organization: Progen Ltda. X-Mailer: Mozilla 4.04 [en] (X11; I; FreeBSD 2.2.5-RELEASE i386) Mime-Version: 1.0 To: Guy Harris Cc: hackers@FreeBSD.ORG Subject: Re: POSIX 1003.1-1996-style SA_SIGINFO signals in FreeBSD? References: <199806051953.MAA05129@tooting.netapp.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG (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