views:

252

answers:

3

I am wondering about embedding the CrashCatcher framework (http://code.google.com/p/plcrashreporter) in a production app. I have written some code that will upload a crash report directly to a server. And, my intent on this was to have quicker access to crash reports and not need to go through Apple/iTunes to get them.

Does anyone know whether or not embedding the CrashCatcher framework is likely to pass the application review process? And, if it does, is it likely to cause any problems or conflict with the crash catching mechanisms that Apple has built into iTunes/iTunesConnect?

Thoughts?

A: 

The guys that created the framework got numerous apps on the store. If someone uses it successfully in a production app, they must know about it. You should try to contact: http://www.plausiblelabs.com/

nico
A: 

It should be fine, however you should give users the choice as to whether you send back the crash report.

When we did it we pre populated an email when the app started after a crash with the appropriate stacktrace in it. The user could the choose to send or not.

lyonanderson
+1  A: 

I corresponded with one of the authors of CrashReporter, Landon (thank you!), to provide some additional clarity on this.

Apparently, the mechanisms used by CrashReporter (signals) and Apple's crash catching (Mach exceptions) are distinct and mutually compatible.

Do you understand the differences between how Apple is catching crashes vs CrashReporter? I have not looked closely at the CrashReporter source, but from what I read/remember it works by registering signal handlers? Is this accurate?

Right -- PLCrashReporter registers standard signals handlers for the signals its interested in: http://code.google.com/p/plcrashreporter/source/browse/trunk/Source/PLCrashSignalHandler.m#41 http://code.google.com/p/plcrashreporter/source/browse/trunk/Source/PLCrashSignalHandler.m#223

Do you know if Apple leveraging a different mechanism?

Apple makes use of a Mach exception handler to implement their crash reporting on both Mac OS X and the iPhone; mach exceptions can be handled by an exception server (either in-process or external to the process) -- the default kernel-provided UNIX exception handler maps mach exceptions to UNIX signals.

The UNIX exception handler is registered here: http://fxr.watson.org/fxr/source/bsd/kern/bsd%5Finit.c?v=xnu-1456.1.26#L999

For crash reporting, the advantage of the Mach exception API is that you can simply pass the unmodified exceptions directly on to the next handler. I investigated implementing this early on, but the necessary API is private[1], so settled on registering standard UNIX signal handlers. If you want to read more about the Mach exception system, I'd recommend starting with Chapter 9, Section 7 of Mac OS X Internals.

Cheers, Landon

[1] Unity 3d recently ran issues with mach exception private API via exc_server(): http://blogs.unity3d.com/2009/11/14/unity-iphone-app-store-submissions-problem-solved/

xyzzycoder