[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

what is a bus error?



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/