views:

315

answers:

3

Hey all, I'm in the process of debugging a C++ app on mac os 10.5. Occasionally, I'll do something bad and cause a segfault or an otherwise illegal operation. This results in the app hanging for a while, and eventually a system dialog notifying me of the crash. The wait time between the "hang" and the dialog is significant; a few minutes. If I try to force quit the application or kill -9 it from the command line nothing happens. If I start the app from the debugger (gdb), upon a crash I get back to gdb prompt and can exit the process cleanly. That's not ideal though as gdb is slow to load.

Anyway, can you guys recommend something? Is there a way to disable the crash reporting mechanism in OS X?

Thanks.

Update 1: Here're the zombies that are left over from an XCode execution. Apparently xcode can't stop 'em properly either.

  1 eightieight@eightieights-MacBook-Pro:~$ ps auxw|grep -i Reader
  2 eightieight   28639   0.0  0.0   599828    504 s004  R+    2:54pm   0:00.00 grep -i reader
  3 eightieight   28288   0.0  1.1  1049324  45032   ??  UEs   2:46pm   0:00.89 /Users/eightieight/workspace/spark/spark/reader/browser/build/Debug/Reader.app/Contents/MacOS/Reader
  4 eightieight   28271   0.0  1.1  1049324  45036   ??  UEs   2:45pm   0:00.89 /Users/eightieight/workspace/spark/spark/reader/browser/build/Debug/Reader.app/Contents/MacOS/Reader
  5 eightieight   28146   0.0  1.1  1049324  44996   ??  UEs   2:39pm   0:00.90 /Users/eightieight/workspace/spark/spark/reader/browser/build/Debug/Reader.app/Contents/MacOS/Reader
  6 eightieight   27421   0.0  1.1  1049328  45024   ??  UEs   2:29pm   0:00.88 /Users/eightieight/workspace/spark/spark/reader/browser/build/Debug/Reader.app/Contents/MacOS/Reader
  7 eightieight   27398   0.0  1.1  1049324  45044   ??  UEs   2:28pm   0:00.90 /Users/eightieight/workspace/spark/spark/reader/browser/build/Debug/Reader.app/Contents/MacOS/Reader
+1  A: 

There's the CrashReporterPrefs app that comes with XCode (search for it with Spotlight; should be in /Developer/Applications/Utilities). That can be to set to Server Mode to disable the application 'Unexpectedly Quit' dialog too.

Here's another suggestion:

sudo chmod 000 /System/Library/CoreServices/Problem\ Reporter.app

To re-enable, do the following:

sudo chmod 755 /System/Library/CoreServices/Problem\ Reporter.app

It might be that the application is dumping a large core file - you'd probably notice the effect on available disk space though. You can switch off core dumping using

sudo sysctl -w kern.coredump=0

Reactivate by setting =1.

martin clayton
Yeah, I tried this already. The dialog no longer popups but there's still the delay..
EightyEight
I would not advise the `chmod` approach. Modifying system files or permissions is asking for trouble. The Prefs app will do what you ask.
gavinb
@gavinb - agreed; reordered suggestions.
martin clayton
+1  A: 

This article from osxdaily.com says you just need to type:

defaults write com.apple.CrashReporter DialogType none

in the terminal. Don't know if that will fix the delay though.

Jan
A: 

I finally figured it out.

in /System/Library/CoreServices:

----------    1 root  wheel    56752 11 Aug  2009 ReportPanic

That must've been from my earlier attempts to disable the annoying report dialog. Live and learn. :]

EightyEight