Re: what is a bus error?

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

 




 Looking at the kernel code, it appears that Linux
uses SIGBUS only in couple of extreme (or weird??)
cases: no page available when handling a page fault,
segment not present. AFAIK, these aren't the original
intended uses of this signal. 
Since this signal reports a kernel problem rather than
a userland error, it would be hard to simulate from a
program.

-Ravi.

--- Peter Jay Salzman <p@dirac.org> wrote:
> 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

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
--
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/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux