• 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: Inducing a crash?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inducing a crash?


  • Subject: Re: Inducing a crash?
  • From: Rick Mann <email@hidden>
  • Date: Mon, 9 Mar 2009 17:29:53 -0700


On Mar 9, 2009, at 16:52:09, Greg Parker wrote:

On Mar 9, 2009, at 3:17 PM, Rick Mann wrote:
On Mar 9, 2009, at 15:15:18, email@hidden wrote:

On Mar 9, 2009, at 6:05 PM, Rick Mann wrote:
I want to test how well our background agent is restarted. I'd like to programmatically induce a crash. What's a good way to do so?

I'm not certain if you mean crashing use a Cocoa method, but this should certainly cause a memory fault crash.


int *x;
x = 0;
*x = 5;

Yeah, something like that. I didn't know if there was a more preferred way.

abort() and __builtin_trap() work well. They have the advantage of being grep-able when you want to take them out. abort() and __builtin_trap() and intentional memory faults should behave identically other than the precise contents of the crash log, unless you have signal handlers for SIGSEGV/SIGBUS/SIGABRT.

Hmm. Good to know. We may have *some* sig handlers, but this is just for testing in one place (-(void) crash: (id) sender)).


Thanks!

--
Rick

_______________________________________________

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


References: 
 >Inducing a crash? (From: Rick Mann <email@hidden>)
 >Re: Inducing a crash? (From: email@hidden)
 >Re: Inducing a crash? (From: Rick Mann <email@hidden>)
 >Re: Inducing a crash? (From: Greg Parker <email@hidden>)

  • Prev by Date: Re: User In-Activity hook? And a request
  • Next by Date: Re: persisting user credentials -- how?
  • Previous by thread: Re: Inducing a crash?
  • Next by thread: [CAWUG] Reminder Meeting Tomorrow
  • Index(es):
    • Date
    • Thread