<s>
In	O
computing	O
,	O
a	O
bus	B-General_Concept
error	I-General_Concept
is	O
a	O
fault	B-Application
raised	O
by	O
hardware	B-Architecture
,	O
notifying	O
an	O
operating	B-General_Concept
system	I-General_Concept
(	O
OS	O
)	O
that	O
a	O
process	O
is	O
trying	O
to	O
access	O
memory	B-General_Concept
that	O
the	O
CPU	B-General_Concept
cannot	O
physically	O
address	O
:	O
an	O
invalid	O
address	O
for	O
the	O
address	B-Architecture
bus	I-Architecture
,	O
hence	O
the	O
name	O
.	O
</s>
<s>
In	O
modern	O
use	O
on	O
most	O
architectures	O
these	O
are	O
much	O
rarer	O
than	O
segmentation	B-Error_Name
faults	I-Error_Name
,	O
which	O
occur	O
primarily	O
due	O
to	O
memory	B-General_Concept
access	B-Error_Name
violations	I-Error_Name
:	O
problems	O
in	O
the	O
logical	B-General_Concept
address	I-General_Concept
or	O
permissions	O
.	O
</s>
<s>
On	O
POSIX-compliant	O
platforms	O
,	O
bus	B-General_Concept
errors	I-General_Concept
usually	O
result	O
in	O
the	O
SIGBUS	B-General_Concept
signal	O
being	O
sent	O
to	O
the	O
process	O
that	O
caused	O
the	O
error	O
.	O
</s>
<s>
SIGBUS	B-General_Concept
can	O
also	O
be	O
caused	O
by	O
any	O
general	O
device	O
fault	B-Application
that	O
the	O
computer	O
detects	O
,	O
though	O
a	O
bus	B-General_Concept
error	I-General_Concept
rarely	O
means	O
that	O
the	O
computer	B-Architecture
hardware	I-Architecture
is	O
physically	O
broken	O
—	O
it	O
is	O
normally	O
caused	O
by	O
a	O
bug	B-Error_Name
in	O
software	B-Application
.	O
</s>
<s>
Bus	B-General_Concept
errors	I-General_Concept
may	O
also	O
be	O
raised	O
for	O
certain	O
other	O
paging	B-Architecture
errors	O
;	O
see	O
below	O
.	O
</s>
<s>
There	O
are	O
at	O
least	O
three	O
main	O
causes	O
of	O
bus	B-General_Concept
errors	I-General_Concept
:	O
</s>
<s>
Software	B-Application
instructs	O
the	O
CPU	B-General_Concept
to	O
read	O
or	O
write	O
a	O
specific	O
physical	O
memory	B-General_Concept
address	I-General_Concept
.	O
</s>
<s>
Accordingly	O
,	O
the	O
CPU	B-General_Concept
sets	O
this	O
physical	O
address	O
on	O
its	O
address	B-Architecture
bus	I-Architecture
and	O
requests	O
all	O
other	O
hardware	B-Architecture
connected	O
to	O
the	O
CPU	B-General_Concept
to	O
respond	O
with	O
the	O
results	O
,	O
if	O
they	O
answer	O
for	O
this	O
specific	O
address	O
.	O
</s>
<s>
If	O
no	O
other	O
hardware	B-Architecture
responds	O
,	O
the	O
CPU	B-General_Concept
raises	O
an	O
exception	B-General_Concept
,	O
stating	O
that	O
the	O
requested	O
physical	O
address	O
is	O
unrecognized	O
by	O
the	O
whole	O
computer	O
system	O
.	O
</s>
<s>
Note	O
that	O
this	O
only	O
covers	O
physical	O
memory	B-General_Concept
addresses	O
.	O
</s>
<s>
Trying	O
to	O
access	O
an	O
undefined	O
virtual	B-Architecture
memory	I-Architecture
address	O
is	O
generally	O
considered	O
to	O
be	O
a	O
segmentation	B-Error_Name
fault	I-Error_Name
rather	O
than	O
a	O
bus	B-General_Concept
error	I-General_Concept
,	O
though	O
if	O
the	O
MMU	B-General_Concept
is	O
separate	O
,	O
the	O
processor	O
cannot	O
tell	O
the	O
difference	O
.	O
</s>
<s>
Most	O
CPUs	O
are	O
byte-addressable	O
,	O
where	O
each	O
unique	O
memory	B-General_Concept
address	I-General_Concept
refers	O
to	O
an	O
8-bit	O
byte	B-Application
.	O
</s>
<s>
Most	O
CPUs	O
can	O
access	O
individual	O
bytes	B-Application
from	O
each	O
memory	B-General_Concept
address	I-General_Concept
,	O
but	O
they	O
generally	O
cannot	O
access	O
larger	O
units	O
(	O
16	O
bits	O
,	O
32	O
bits	O
,	O
64	O
bits	O
and	O
so	O
on	O
)	O
without	O
these	O
units	O
being	O
"	O
aligned	B-Application
"	O
to	O
a	O
specific	O
boundary	O
(	O
the	O
x86	B-Operating_System
platform	I-Operating_System
being	O
a	O
notable	O
exception	B-General_Concept
)	O
.	O
</s>
<s>
For	O
example	O
,	O
if	O
multi-byte	O
accesses	O
must	O
be	O
16	O
bit-aligned	O
,	O
addresses	O
(	O
given	O
in	O
bytes	B-Application
)	O
at	O
0	O
,	O
2	O
,	O
4	O
,	O
6	O
,	O
and	O
so	O
on	O
would	O
be	O
considered	O
aligned	B-Application
and	O
therefore	O
accessible	O
,	O
while	O
addresses	O
1	O
,	O
3	O
,	O
5	O
,	O
and	O
so	O
on	O
would	O
be	O
considered	O
unaligned	O
.	O
</s>
<s>
Similarly	O
,	O
if	O
multi-byte	O
accesses	O
must	O
be	O
32-bit	O
aligned	B-Application
,	O
addresses	O
0	O
,	O
4	O
,	O
8	O
,	O
12	O
,	O
and	O
so	O
on	O
would	O
be	O
considered	O
aligned	B-Application
and	O
therefore	O
accessible	O
,	O
and	O
all	O
addresses	O
in	O
between	O
would	O
be	O
considered	O
unaligned	O
.	O
</s>
<s>
Attempting	O
to	O
access	O
a	O
unit	O
larger	O
than	O
a	O
byte	B-Application
at	O
an	O
unaligned	O
address	O
can	O
cause	O
a	O
bus	B-General_Concept
error	I-General_Concept
.	O
</s>
<s>
For	O
example	O
,	O
for	O
hardware	B-Architecture
based	O
on	O
the	O
IBM	B-Application
System/360	I-Application
mainframe	O
,	O
including	O
the	O
IBM	B-Device
System	I-Device
z	I-Device
,	O
Fujitsu	O
B8000	O
,	O
RCA	O
Spectra	O
,	O
and	O
UNIVAC	B-Device
Series	I-Device
90	I-Device
,	O
instructions	O
must	O
be	O
on	O
a	O
16-bit	O
boundary	O
,	O
that	O
is	O
,	O
execution	O
addresses	O
must	O
start	O
on	O
an	O
even	O
byte	B-Application
.	O
</s>
<s>
Attempts	O
to	O
branch	O
to	O
an	O
odd	O
address	O
results	O
in	O
a	O
specification	O
exception	B-General_Concept
.	O
</s>
<s>
Data	O
,	O
however	O
,	O
may	O
be	O
retrieved	O
from	O
any	O
address	O
in	O
memory	B-General_Concept
,	O
and	O
may	O
be	O
one	O
byte	B-Application
or	O
longer	O
depending	O
on	O
the	O
instruction	O
.	O
</s>
<s>
CPUs	O
generally	O
access	O
data	O
at	O
the	O
full	O
width	O
of	O
their	O
data	B-General_Concept
bus	I-General_Concept
at	O
all	O
times	O
.	O
</s>
<s>
To	O
address	O
bytes	B-Application
,	O
they	O
access	O
memory	B-General_Concept
at	O
the	O
full	O
width	O
of	O
their	O
data	B-General_Concept
bus	I-General_Concept
,	O
then	O
mask	O
and	O
shift	O
to	O
address	O
the	O
individual	O
byte	B-Application
.	O
</s>
<s>
Systems	O
tolerate	O
this	O
inefficient	O
algorithm	O
,	O
as	O
it	O
is	O
an	O
essential	O
feature	O
for	O
most	O
software	B-Application
,	O
especially	O
string	O
processing	O
.	O
</s>
<s>
Unlike	O
bytes	B-Application
,	O
larger	O
units	O
can	O
span	O
two	O
aligned	B-Application
addresses	O
and	O
would	O
thus	O
require	O
more	O
than	O
one	O
fetch	O
on	O
the	O
data	B-General_Concept
bus	I-General_Concept
.	O
</s>
<s>
It	O
is	O
possible	O
for	O
CPUs	O
to	O
support	O
this	O
,	O
but	O
this	O
functionality	O
is	O
rarely	O
required	O
directly	O
at	O
the	O
machine	B-Language
code	I-Language
level	O
,	O
thus	O
CPU	B-General_Concept
designers	O
normally	O
avoid	O
implementing	O
it	O
and	O
instead	O
issue	O
bus	B-General_Concept
errors	I-General_Concept
for	O
unaligned	O
memory	B-General_Concept
access	O
.	O
</s>
<s>
FreeBSD	B-Operating_System
,	O
Linux	B-Application
and	O
Solaris	B-Application
can	O
signal	O
a	O
bus	B-General_Concept
error	I-General_Concept
when	O
virtual	B-Architecture
memory	I-Architecture
pages	O
cannot	O
be	O
paged	B-Architecture
in	I-Architecture
,	O
e.g.	O
</s>
<s>
accessing	O
a	O
memory-mapped	B-General_Concept
file	I-General_Concept
or	O
executing	O
a	O
binary	B-Application
image	I-Application
which	O
has	O
been	O
truncated	O
while	O
the	O
program	O
was	O
running	O
)	O
,	O
or	O
because	O
a	O
just-created	O
memory-mapped	B-General_Concept
file	I-General_Concept
cannot	O
be	O
physically	O
allocated	O
,	O
because	O
the	O
disk	O
is	O
full	O
.	O
</s>
<s>
mechanism	O
known	O
as	O
segmentation	B-Device
.	O
</s>
<s>
Linux	B-Application
this	O
generates	O
SIGBUS	B-General_Concept
.	O
</s>
<s>
This	O
is	O
an	O
example	O
of	O
unaligned	O
memory	B-General_Concept
access	O
,	O
written	O
in	O
the	O
C	B-Language
programming	I-Language
language	I-Language
with	O
AT&T	O
assembly	O
syntax	O
.	O
</s>
<s>
Compiling	O
and	O
running	O
the	O
example	O
on	O
a	O
POSIX	O
compliant	O
OS	O
on	O
x86	B-Operating_System
demonstrates	O
the	O
error	O
:	O
</s>
<s>
The	O
GDB	B-Language
debugger	B-Application
shows	O
that	O
the	O
immediate	O
value	O
0x2a	O
is	O
being	O
stored	O
at	O
the	O
location	O
stored	O
in	O
the	O
EAX	B-Device
register	B-General_Concept
,	O
using	O
X86	B-Language
assembly	I-Language
language	I-Language
.	O
</s>
<s>
This	O
is	O
an	O
example	O
of	O
register	B-General_Concept
indirect	O
addressing	O
.	O
</s>
<s>
Printing	O
the	O
low	O
order	O
bits	O
of	O
the	O
address	O
shows	O
that	O
it	O
is	O
not	O
aligned	B-Application
to	I-Application
a	I-Application
word	I-Application
boundary	I-Application
(	O
"	O
dword	O
"	O
using	O
x86	B-Operating_System
terminology	O
)	O
.	O
</s>
