Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Oct 1999 09:42:45 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        John Polstra <jdp@polstra.com>
Cc:        "David O'Brien" <obrien@FreeBSD.ORG>, current@FreeBSD.ORG, Alan Cox <alc@cs.rice.edu>
Subject:   Re: Now that sigcontext is gone ...
Message-ID:  <Pine.BSF.4.10.9910030928230.4614-100000@alphplex.bde.org>
In-Reply-To: <XFMail.991002122051.jdp@polstra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> >> > 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.
> >> 
> >> Yes, this even violates the 1996 POSIX spec.
> > 
> > So lets make the change for 4.0. :-)
> 
> Hang on, hang on.  This has been discussed in the mailing list
> before.  Bruce pointed out that it's useful for distinguishing between
> protection violations and unmapped pages.  He requested that we

I think the POSIX way is to use an auxiliary error code in siginfo_t to
distinguish the causes of the signal.  This only works for SA_SIGINFO
handlers.  We do something similar using the signal code of 3-arg signal
handlers.

> first implement the SA_SIGINFO support to the point where it could
> accomplish that before changing SIGBUS to SIGSEGV.  I think that makes
> sense.

SA_SIGINFO is implemented now.

More details on the POSIX signal numbers: SIGBUS is mainly for accesses
beyond the end of mmap()ed objects.  It's not clear what this means in
an address space with multiple mmap()ed objects and/or non-mmap()ed
objects.

Bruce



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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.9910030928230.4614-100000>