Re: disabling Apple Crash Reporter

2015-03-10 Thread Torsten Curdt
I wasn't aware that this is OK to do from a signal handler. Is it really?

On Tue, Mar 10, 2015 at 10:22 AM, dangerwillrobinsondan...@gmail.com
wrote:

 Again Unix to the rescue.

 http://stackoverflow.com/questions/19147386/system-call-fork-and-execv-function


 Sent from my iPhone

 On 2015/03/10, at 18:08, Torsten Curdt tcu...@vafer.org wrote:


 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!



 True. It would be better to have a custom dialog - but from a signal
 handler?


 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.



 Where did you find that?

 Well, I guess a crash is a crash. So maybe unreliable ist acceptable if it
 works most of the time. After all a crash *should* be an edge case that
 does not happen too often.

 Maybe this could be done from another process?

 cheers,
 Torsten
 ___

 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

 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:

 https://lists.apple.com/mailman/options/cocoa-dev/dangerwillrobinsondanger%40gmail.com

 This email sent to dangerwillrobinsondan...@gmail.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: disabling Apple Crash Reporter

2015-03-10 Thread Jonathan Mitchell

 On 10 Mar 2015, at 09:08, Torsten Curdt tcu...@vafer.org wrote:
 
 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!
  
 True. It would be better to have a custom dialog - but from a signal handler?
Yep. A dialog would be preferable.

Mr Ash suggests kqueue and GCD based handlers which can (though I have not 
tested this) run arbitrary code post signal.
https://mikeash.com/pyblog/friday-qa-2011-04-01-signal-handling.html

However PLCrashReporter uses a straight ahead signal handler:
https://github.com/plausiblelabs/plcrashreporter/blob/e6d1ac18d758e8e0197f32f927bb6b31b8559f95/Source/PLCrashReporter.m

The PLCrashReporter repo does contain GTMSignalHandler (part of the google 
toolbox) which is kqueue based but this is not utilised.

Perhaps you could utilise the kqueue based handlers, show your UI and then call 
the PLCrashReporter signal handler (which in turn calls your signal handler 
with containing exit(-1). 

  
 
 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.
 
 Where did you find that?

https://www.plcrashreporter.org/documentation/api/v1.2/async_safety.html
http://landonf.bikemonkey.org/code/objc/Reliable_Crash_Reporting.20110912.html

 
 Well, I guess a crash is a crash. So maybe unreliable ist acceptable if it 
 works most of the time. After all a crash *should* be an edge case that does 
 not happen too often.
True. But an unreliable crash catcher is not much of an asset!

 
 Maybe this could be done from another process?
 
 cheers,
 Torsten
 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: disabling Apple Crash Reporter

2015-03-10 Thread Torsten Curdt

 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!


True. It would be better to have a custom dialog - but from a signal
handler?


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.


Where did you find that?

Well, I guess a crash is a crash. So maybe unreliable ist acceptable if it
works most of the time. After all a crash *should* be an edge case that
does not happen too often.

Maybe this could be done from another process?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: disabling Apple Crash Reporter

2015-03-10 Thread dangerwillrobinsondanger
Again Unix to the rescue. 
http://stackoverflow.com/questions/19147386/system-call-fork-and-execv-function


Sent from my iPhone

On 2015/03/10, at 18:08, Torsten Curdt tcu...@vafer.org wrote:

 
 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!
 
 
 True. It would be better to have a custom dialog - but from a signal
 handler?
 
 
 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.
 
 Where did you find that?
 
 Well, I guess a crash is a crash. So maybe unreliable ist acceptable if it
 works most of the time. After all a crash *should* be an edge case that
 does not happen too often.
 
 Maybe this could be done from another process?
 
 cheers,
 Torsten
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 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:
 https://lists.apple.com/mailman/options/cocoa-dev/dangerwillrobinsondanger%40gmail.com
 
 This email sent to dangerwillrobinsondan...@gmail.com
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: disabling Apple Crash Reporter

2015-03-09 Thread Jonathan Mitchell



 On 7 Mar 2015, at 12:55, Torsten Curdt tcu...@vafer.org wrote:
 
 Is there a way to disabled the Apple crash reporter dialog?

I know why you want to do this (I do too) but I don’t think you can on a per 
app basis.
An info.plist key could provide the necessary token but ReportCrash(8) is not 
documented to process a crashed apps info.plist

Jonathan
 
 I want to use PLCrashReporter and show my UI instead.
 I don't want to confuse the user by having to fill out two crash reports.
 
 So far I only found a ways to turn if off completely:
 
  sudo launchctl unload -w
 /System/Library/LaunchDaemons/com.apple.locate.plist
  defaults write com.apple.CrashReporter DialogType none
 
 And in the docs I found a reference to a CrashReporterPrefs.app but that
 information seems to be outdated.
 
 Is there a way to just disable it for my app?
 
 cheers,
 Torsten
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 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:
 https://lists.apple.com/mailman/options/cocoa-dev/jonathan%40mugginsoft.com
 
 This email sent to jonat...@mugginsoft.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: disabling Apple Crash Reporter

2015-03-09 Thread Torsten Curdt
I could not find the prefs app


https://developer.apple.com/library/mac/technotes/tn2004/tn2123.html#FIGCRASHREPORTERPREFS

but seems like it's just a fancy way of switching the global state.

  http://cocoadev.com/HowToAvoidSendToAppleWindow

has some further suggestions.

Apparently Adium works around this

  https://hg.adium.im/adium/file/024e5177ce06/Source/AIAdium.m
  https://hg.adium.im/adium/file/024e5177ce06/Source/AICrashController.m

but I am not sure how this would work together with PLCR (or other in
process crash reporters).

Just inspecting the info.plist on a crash - wouldn't that be a smart and
easy way to handle this.

*sigh*

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: disabling Apple Crash Reporter

2015-03-09 Thread dangerwillrobinsondanger
If you read the man page for abort() it says use exit() to avoid the 
ReportCrash daemon. 
Adium does this after launching their crash report helper app. 

How do they get there?
Simple. 
Unix signals handling. 
Right there in the really nice Adium code you linked to. 
You could copy and paste verbatim almost. 

That said, if you're doing this, you should look for a way to share it to Apple 
as well. There's always a possibility they need to know something too. 

But importantly consider your users. Many/most will not know the difference and 
may blame Apple and seek support there. So if you do this, make it very clear 
to users that you are not sending this to Apple but to yourself, what you are 
sending and why. 

Sent from my iPhone

 On 2015/03/10, at 0:04, Robert Monaghan b...@gluetools.com wrote:
 
 Hi Torsten,
 
 This is of interest to me, as well. I haven't had a chance to look into it, 
 but I will over the next few days.
 
 Bob
 
 Sent from my iPhone
 
 On Mar 9, 2015, at 15:54, Torsten Curdt tcu...@vafer.org wrote:
 
 I could not find the prefs app
 
 
 https://developer.apple.com/library/mac/technotes/tn2004/tn2123.html#FIGCRASHREPORTERPREFS
 
 but seems like it's just a fancy way of switching the global state.
 
 http://cocoadev.com/HowToAvoidSendToAppleWindow
 
 has some further suggestions.
 
 Apparently Adium works around this
 
 https://hg.adium.im/adium/file/024e5177ce06/Source/AIAdium.m
 https://hg.adium.im/adium/file/024e5177ce06/Source/AICrashController.m
 
 but I am not sure how this would work together with PLCR (or other in
 process crash reporters).
 
 Just inspecting the info.plist on a crash - wouldn't that be a smart and
 easy way to handle this.
 
 *sigh*
 
 cheers,
 Torsten
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 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:
 https://lists.apple.com/mailman/options/cocoa-dev/bob%40gluetools.com
 
 This email sent to b...@gluetools.com
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 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:
 https://lists.apple.com/mailman/options/cocoa-dev/dangerwillrobinsondanger%40gmail.com
 
 This email sent to dangerwillrobinsondan...@gmail.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: disabling Apple Crash Reporter

2015-03-09 Thread Robert Monaghan
Hi Torsten,

This is of interest to me, as well. I haven't had a chance to look into it, but 
I will over the next few days.

Bob

Sent from my iPhone

 On Mar 9, 2015, at 15:54, Torsten Curdt tcu...@vafer.org wrote:
 
 I could not find the prefs app
 
 
 https://developer.apple.com/library/mac/technotes/tn2004/tn2123.html#FIGCRASHREPORTERPREFS
 
 but seems like it's just a fancy way of switching the global state.
 
  http://cocoadev.com/HowToAvoidSendToAppleWindow
 
 has some further suggestions.
 
 Apparently Adium works around this
 
  https://hg.adium.im/adium/file/024e5177ce06/Source/AIAdium.m
  https://hg.adium.im/adium/file/024e5177ce06/Source/AICrashController.m
 
 but I am not sure how this would work together with PLCR (or other in
 process crash reporters).
 
 Just inspecting the info.plist on a crash - wouldn't that be a smart and
 easy way to handle this.
 
 *sigh*
 
 cheers,
 Torsten
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 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:
 https://lists.apple.com/mailman/options/cocoa-dev/bob%40gluetools.com
 
 This email sent to b...@gluetools.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: disabling Apple Crash Reporter

2015-03-09 Thread Giacomo Tufano
 Il giorno 09/mar/2015, alle ore 16:53, dangerwillrobinsondan...@gmail.com ha 
 scritto:
 Right there in the really nice Adium code you linked to. 
 You could copy and paste verbatim almost. 

The Adium code (and this one for sure, check the starting comment) is licensed 
under the GPL, you should not copy and paste it unless your code is GPL’d too.

 2  * Adium is the legal property of its developers, whose names are listed 
in the copyright file included
 3  * with this source distribution.
 4  * 
 5  * This program is free software; you can redistribute it and/or modify 
it under the terms of the GNU
 6  * General Public License as published by the Free Software Foundation; 
either version 2 of the License,
 7  * or (at your option) any later version.

Really. If we programmer don’t respect licenses I don’t really know who 
should...

Ciao,
gt


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: disabling Apple Crash Reporter

2015-03-09 Thread Charles Srstka
On Mar 9, 2015, at 2:46 PM, Torsten Curdt tcu...@vafer.org 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.

Charles

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: disabling Apple Crash Reporter

2015-03-09 Thread Torsten Curdt

 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: disabling Apple Crash Reporter

2015-03-09 Thread Torsten Curdt
This seems to work!

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 tcu...@vafer.org 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: disabling Apple Crash Reporter

2015-03-09 Thread Torsten Curdt

 If you read the man page for abort() it says use exit() to avoid the
 ReportCrash daemon.


Ah, nice. Need to try that.


Adium does this after launching their crash report helper app.

 How do they get there?
 Simple.
 Unix signals handling.
 Right there in the really nice Adium code you linked to.


True - but if you have in process crash reporter like e.g. PLCR it suddenly
isn't as easy anymore.



 You could copy and paste verbatim almost.


As Giacomo said - I shouldn't because the beloved GPL. But it would be easy
enough to implement anyway.

The problem really is the signal handling is already occupied.

I guess it might be worth opening bug reports for the crash reporters to
use exit if they don't.



 That said, if you're doing this, you should look for a way to share it to
 Apple as well. There's always a possibility they need to know something too.


I rather get them myself and open rdars as I seem fit.
The Apple Crash Reporter feels more like a Black Hole.



 But importantly consider your users.


That is my main concern :)

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: disabling Apple Crash Reporter

2015-03-09 Thread Jonathan Mitchell

 On 9 Mar 2015, at 20:56, Torsten Curdt tcu...@vafer.org 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 tcu...@vafer.org 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 (Cocoa-dev@lists.apple.com)
 
 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:
 https://lists.apple.com/mailman/options/cocoa-dev/jonathan%40mugginsoft.com
 
 This email sent to jonat...@mugginsoft.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

disabling Apple Crash Reporter

2015-03-07 Thread Torsten Curdt
Is there a way to disabled the Apple crash reporter dialog?

I want to use PLCrashReporter and show my UI instead.
I don't want to confuse the user by having to fill out two crash reports.

So far I only found a ways to turn if off completely:

  sudo launchctl unload -w
/System/Library/LaunchDaemons/com.apple.locate.plist
  defaults write com.apple.CrashReporter DialogType none

And in the docs I found a reference to a CrashReporterPrefs.app but that
information seems to be outdated.

Is there a way to just disable it for my app?

cheers,
Torsten
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com