R
Ron Natalie
Suresh said:My C++ program crashes with "signal BUS (invalid address alignment)" at
random places. Does anyone know what this could mean ? What is the cause of
signal BUS ?
I suspect, it's "invalid address alignment" just as it says. Typically, you are violating
the alignment constranits, etc...
char foo[10];
*(int*)(foo+1) = 1;
for example on a machine that requires int's to be aligned on some multiple number
of bytes.
The historical word SIGBUS comes from the UNIX signal names which was derived
from the PDP-11 BUS ERROR processor trap. There were two things that would cause
this trap. One was accessing words on odd addresses. The other was accessing a
memory address that, while mapped in to your address space, didn't answer (missing or
otherwise not responding).