Re: Weird SIGBUS errors
Re: Weird SIGBUS errors
- Subject: Re: Weird SIGBUS errors
- From: Douglas Davidson <email@hidden>
- Date: Tue, 6 Nov 2001 09:47:31 -0800
On Monday, November 5, 2001, at 06:48 PM, Kurt Revis wrote:
You do NOT want to do this. You are getting the SIGBUS or SIGSEGV for a
reason--because your app is crashing. After this point, it's dead. You
can't just ignore the crash and go on afterwards (as you found out).
You need to find out why it's crashing, and fix that.
(BTW, the two signals are basically equivalent as far as you're
concerned--don't worry too much about which one you get specifically.)
A bit of trivia: on Mac OS X, both signals are caused by illegal memory
accesses; an attempt to access an address that is not mapped at all
causes a SIGSEGV ("Segmentation fault"), while an attempt to perform an
operation inconsistent with a memory region's protection (e.g., writing
to memory mapped read-only) causes a SIGBUS ("Bus error"). The names
are historic.
Kurt is correct--while in theory it is possible to catch these signals
and handle them, it certainly is not possible to simply ignore them. In
practice, these signals are the sign of a bug in your app, typically an
invalid pointer, and you need to fix it.
Douglas Davidson