• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to catch and log EXC_BAD_ACCESS?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to catch and log EXC_BAD_ACCESS?


  • Subject: Re: How to catch and log EXC_BAD_ACCESS?
  • From: Slava Pestov <email@hidden>
  • Date: Mon, 26 Jan 2009 23:03:34 -0600

On Mon, Jan 26, 2009 at 10:43 PM, Michael Ash <email@hidden> wrote:
> Actually it's pretty easy to avoid exiting due to EXC_BAD_ACCESS, just
> install a signal handler for SIGSEGV.

In my experience, setting a handler for SIGSEGV is problematic because
the crash reporter still starts up, so its best to handle the Mach
exception directly instead of resorting to Unix signals (which seem to
be emulated under Mach, rather than a native feature).

The Crash Reporter is not always what you want, because illegal memory
access is not always a fatal error in all cases, for example some
language VMs use memory protection to implement funky GC algorithms.

Anyway, to answer Oleg's question, I have some BSD-licensed code which
demonstrates this. Once you figure out the somewhat-hairy Mach APIs,
it is pretty straightforward:

http://gitweb.factorcode.org/gitweb.cgi?p=factor/.git;a=blob_plain;f=vm/mach_signal.c;hb=HEAD

Slava
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How to catch and log EXC_BAD_ACCESS?
      • From: Jean-Daniel Dupas <email@hidden>
References: 
 >How to catch and log EXC_BAD_ACCESS? (From: Oleg Krupnov <email@hidden>)
 >Re: How to catch and log EXC_BAD_ACCESS? (From: Scott Ribe <email@hidden>)
 >Re: How to catch and log EXC_BAD_ACCESS? (From: Michael Ash <email@hidden>)

  • Prev by Date: Re: CoreData silently failing to insert?
  • Next by Date: Re: Is there a more efficient way to get the first 4 bytes off a NSInputStream to compare
  • Previous by thread: Re: How to catch and log EXC_BAD_ACCESS?
  • Next by thread: Re: How to catch and log EXC_BAD_ACCESS?
  • Index(es):
    • Date
    • Thread