views:

16

answers:

1

I have a testing setup which runs an Application on OS X with a varying set of parameters, if/when the program crashes it's relaunched and continues from where it left off. However when the Application crashes OS X raises the “Application quit unexpectedly” dialog, I'd rather avoid this as it clutters the machine. Is there a way to inhibit this dialog from opening without modifying the source of the Application? If it's of any help in honing solutions the scripting setup is written in Python.

As an example, on Windows I handle the GPF dialog like this:

SEM_NOGPFAULTERRORBOX = 0x0002
ctypes.windll.kernel32.SetErrorMode(SEM_NOGPFAULTERRORBOX);

Ideally there'd be something similar I could use on OS X.

Thanks.

+1  A: 

With the developer tools (Xcode, etc.) installed, you get a tool called CrashReporterPrefs. This is basically an interface to some plist file that sets globally how you want crashes handled. Probably not exactly what you're looking for, but if you control the deployment environment it might help.

There must be other options because Google products, like Sketchup, override the default handler and install their own crash reporter. My guess is that they register signal handlers for SIGBUS, SIGSEGV, etc. (see man 2 sigaction) and somehow mask the crash from MacOSX... but I'm speculating here.

I'll let others ask the question on why you can't fix the crash instead. :-)

Simeon Fitch
Excellent, these sounds like promising approaches, as for fixing the crashes themselves, that's certainly the goal, this scripting setup sits on the end of a continuous integration build pipeline, so if a checkin introduces a crash I get instant feedback on it. Losing the annoying dialog is really just a plus.
nfg
CrashReporterPrefs is working perfectly, this is a testing environment that I control so setting the value globally is no problem, much appreciated.
nfg