From owner-freebsd-current Thu Sep 30 14:28:46 1999 Delivered-To: freebsd-current@freebsd.org Received: from cs.rice.edu (cs.rice.edu [128.42.1.30]) by hub.freebsd.org (Postfix) with ESMTP id 37B7714C98 for ; Thu, 30 Sep 1999 14:28:43 -0700 (PDT) (envelope-from alc@cs.rice.edu) Received: from nonpc.cs.rice.edu (nonpc.cs.rice.edu [128.42.1.219]) by cs.rice.edu (8.9.0/8.9.0) with ESMTP id QAA11129; Thu, 30 Sep 1999 16:28:35 -0500 (CDT) Received: (from alc@localhost) by nonpc.cs.rice.edu (8.9.3/8.7.3) id QAA25237; Thu, 30 Sep 1999 16:28:34 -0500 (CDT) Date: Thu, 30 Sep 1999 16:28:34 -0500 From: Alan Cox To: John Polstra Cc: Alan Cox , current@freebsd.org Subject: Re: Now that sigcontext is gone ... Message-ID: <19990930162834.C20978@nonpc.cs.rice.edu> References: <19990930151137.H19202@cs.rice.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.1i In-Reply-To: ; from John Polstra on Thu, Sep 30, 1999 at 01:40:22PM -0700 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Sep 30, 1999 at 01:40:22PM -0700, John Polstra wrote: > > Yep, I have fixed that in the PM3 release (which is the one that's > actively maintained these days), but probably not in the SRC release > on which our port is based. I have ports for PM3 in the wings, > but I'm waiting for some necessary changes to to be > committed. > My recollection is that sc_err got added to sigcontext when VM86 support was added. I'm not sure that sc_err was ever documented to contain the faulting address either. It only gets the faulting address by historical accident/hack, specifically, from trap_pfault: } /* kludge to pass faulting virtual address to sendsig */ frame->tf_err = eva; return((rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV); } Up until this point, frame->tf_err tells me details about the page fault, such as whether it was a read or a write access. I'd really like that information to make it out to user-level in addition to the faulting address. In other words, we should find another way to pass the faulting address to sendsig than by overwriting frame->tf_err. The siginfo si_addr field is the proper place for the faulting address to wind up anyway. Alan P.S. This also reminds me that FreeBSD is non-standard relative to Linux and all of the major vender commercial Unices in that a disallowed access, such as a write to a read-only region of memory, generates a SIGBUS rather than a SIGSEGV. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message