*BSD News Article 86723


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.mel.connect.com.au!news.mel.aone.net.au!grumpy.fl.net.au!news.webspan.net!newsfeeds.sol.net!news-xfer.netaxs.com!news.mathworks.com!fu-berlin.de!irz401!orion.sax.de!uriah.heep!news
From: j@uriah.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: What causes a bus error?
Date: 18 Jan 1997 23:21:14 GMT
Organization: Private BSD site, Dresden
Lines: 42
Message-ID: <5brlta$35u@uriah.heep.sax.de>
References: <craigs-ya023180001501970036510001@news.os.com>
  <5biv26$boh@sol.ctr.columbia.edu>
  <craigs-ya023180001501972048120001@news.os.com>
Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch)
NNTP-Posting-Host: localhost.heep.sax.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: knews 0.9.6
X-Phone: +49-351-2012 669
X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F  93 21 E0 7D F9 12 D6 4E
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:34008

craigs@os.com (Craig Shrimpton) wrote:

> When I first saw it I thought I was having a bus error as in motherboard
> bus.  Glad it's only software.

The i386 architecture doesn't really support bus errors.  (Well, it
didn't even have something that deserves the term `bus' for a long
time. :-)

The differentiation between SIGBUS and SIGSEGV is of historic nature.
If you look at the first 16 or so signals, and you know a little about
the PDP-11 architecture, you'll surprisingly find that many of the
signals map 1:1 to the PDP-11 traps. ;-)

I think a segmentation violation was a signal caused by the MMU, while
a bus error was usually an access to the void on the system bus (which
either triggered a timeout, or caused the bus arbiter to signal the
bad access -- i eventually forgot).

Some newer systems use SIGSEGV for all of this (Linux to the least),
and i think Posix doesn't mention SIGBUS either.

FreeBSD currently uses SIGBUS as a catch-all for various protection
violations.  If you fiddle with a segment register (causing it to
point to an invalid segment descriptor), or try accessing IO ports
from a user program, you'll get it.  To the contrary, unresolved page
faults (this is the usual out-of-bounds memory access) result in a
SIGSEGV.  (_Resolved_ page faults result in faulting in the page from
secondary storage.)

>   I'm also
> looking a qmail which is supposed to be secure and can do everything but
> uucp (I've been told).

Too bad.

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)