Re: disabling Apple Crash Reporter
Re: disabling Apple Crash Reporter
- Subject: Re: disabling Apple Crash Reporter
- From: Jonathan Mitchell <email@hidden>
- Date: Mon, 09 Mar 2015 23:39:34 +0000
> On 9 Mar 2015, at 20:56, Torsten Curdt <email@hidden> wrote:
>
> This seems to work!
Nice catch indeed.
I have confirmed that this works with the HockeyApp SDK (which uses PLCrashReporter).
However the user experience is rather barren.
The app simply dies.
As well as posting the report ReportCrash(8) also allows informs the user of termination and allows restart.
I know that prompting users twice for reporting is inelegant and confusing but crashing with no UI feedback at all is a bit mystifying - where did my app go! Throwing up any sort of UI in the callback will be unreliable due to the normal re-entrant code caveats - I think the Adium code does this anyway.
HockeyApp
=========
BITCrashManagerCallbacks callbacks;
callbacks.context = NULL;
callbacks.handleSignal = exitCallback;
[hockeyManager.crashManager setCrashCallbacks:&callbacks];
void exitCallback(void *context)
{
BOOL triggerAppleCrashReporter = YES;
if (triggerAppleCrashReporter) {
abort();
} else {
// see man abort
exit(-1);
}
}
>
> void exitCallback(siginfo_t *info, ucontext_t *uap, void *context)
> {
> exit(-1);
> }
>
> - (void) setupCrashReporting
> {
> PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter];
>
> ...
>
> PLCrashReporterCallbacks callbacks;
> callbacks.version = 0;
> callbacks.context = NULL;
> callbacks.handleSignal = exitCallback;
> [crashReporter setCrashCallbacks:&callbacks];
>
> Yay!
>
>
>
>
> On Mon, Mar 9, 2015 at 9:45 PM, Torsten Curdt <email@hidden> wrote:
>
>> I guess it might be worth opening bug reports for the crash reporters to
>>> use "exit" if they don't.
>>>
>>>
>>> Or just find the exit point to PLCrashReporter’s signal handler, add an
>>> “exit” there, and send a patch to the developers. I can’t imagine it’d be
>>> much work.
>>>
>>
>> Touché :)
>>
>> Actually it seems that PLCrashReporter already has a callback.
>> I guess one could use that to then just exit. Will try!
>>
>> cheers,
>> Torsten
>>
> _______________________________________________
>
> 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
_______________________________________________
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