HP3000-L Archives

November 2003, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Wonsil <[log in to unmask]>
Reply To:
Mark Wonsil <[log in to unmask]>
Date:
Tue, 18 Nov 2003 14:38:39 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (41 lines)
Keven Miller wrote:
> I don't suppose that there is a way to trap and recover from a SIGBUS
> or SIGSEGV error in unix, like mpe provides with
> xsystrap,xlibtrap,xcodetrap,xcontrap.
>
> It appears that once I have sigbus, all I can do is pull over to the
> side of the road.

http://www.linux-mag.com/2000-02/compile_02.html
...
Signaling Programs That Violate System Rules

...

SIGBUS:While a variety of things can result in SIGBUS, the most common are:

1. Hardware Errors. Needless to say, there isn't much that the programmer
can do about these.

2. Out-of-memory Situations.Rather then have malloc() fail, Linux prefers to
send a SIGBUS when a process doesn't have enough RAM. There are actually
good reasons for this (lazy memory allocation), but this is the net effect.
Most programs don't handle a failed malloc() terribly gracefully anyway, so
the end result is normally the same in practice.

3. Unaligned Access on Some Architectures.Many processors require that
memory accesses be properly aligned, which means that 4-byte values are
accessed on 4-byte boundaries, 2-byte values are on 2-byte boundaries, and
so on. The Intel IA32 architecture doesn't require aligned accesses, but it
still is much slower to do unaligned fetches. Systems such as Linux/SPARC
and Linux/m68k send a SIGBUS when a process tries to perform an unaligned
access.

While SIGBUS can be caught and even ignored, doing so is normally a bad
idea. It's sent only in a genuine error condition, so the only reasonable
reaction is to terminate. By default, SIGBUS causes a process to terminate
and leave a core dump behind.

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2