What is a "bus error"?

Grant Edwards grante at visi.com
Fri Feb 1 18:02:51 CET 2002


In article <mailman.1012579203.9499.python-list at python.org>, Steven Majewski wrote:

>> | 	However, some of these programs now give a "bus error" message -
>> | what does this mean?
>>
>> it means python got a SIGBUS signal from the kernel, ie it crashed.
>> SIGBUS commonly results from attempting to access unaligned memory.
> 
> ... or chasing a nil pointer or useing something that's not a pointer
> as a pointer.

On many systems (e.g. Linux/Intel) that's a different signal.
On Linux/Intel SIGSEGV is used to indicate you've tried to
access memory which you're not allowed to access (e.g.
de-referencing a null pointer).

In my experience SIGBUS has always been an alignment error.
I've seen it on SPARCs running both SunOS and Linux.  I don't
think I've ever seena SIGBUS on Intel hardware.

It's not uncommon for SW developed on Intel hardware to have
SIGBUS faults when it's run on SPARC, ARM, or other hardware
with alignment requirements.  I remember finding such a bug in
the Linux ppp daemon when I tried to run it on a SPARC system.

-- 
Grant Edwards                   grante             Yow!  Here I am at the flea
                                  at               market but nobody is buying
                               visi.com            my urine sample bottles...



More information about the Python-list mailing list