[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: what is a bus error?
I believe the kernel raises SIGBUS when an application exhibits
data misalignment on the data bus. I think that since most[?] modern
compilers for most processors pad / align the data for the programmers,
the alignment troubles of yore (at least) mitigated, and hence one does
not see SIGBUS too often these days (AFAIK).
--
Sean
_______________________________________________
Sean C. Murphy
Principal Software Technologist
Storage Computer Corp.
Peter Jay Salzman
<p@dirac.org> To: kernel newbie mailing list
Sent by: <kernelnewbies@nl.linux.org>
kernelnewbies-bounce@nl cc:
.linux.org Subject: what is a bus error?
01/07/2002 09:24 PM
we all know what a segfault is.
however, what exactly is a "bus error"? can somone show me a "hello
world" type program that barfs with a SIGBUS? something like:
char *p; /* p is a pointer to a char */
p = (char *) rand(); /* now p points to la-la land */
printf("\%c", *p); /* whammo: a segfault! */
but which produces a bus error...
pete
--
PGP Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D
PGP Public Key: finger p@dirac.org
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
IRC Channel: irc.openprojects.net / #kernelnewbies
Web Page: http://www.kernelnewbies.org/
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
IRC Channel: irc.openprojects.net / #kernelnewbies
Web Page: http://www.kernelnewbies.org/