2 Replies
      Latest reply on Dec 2, 2016 1:59 PM by KMT
      absinth Level 1 Level 1 (0 points)

        hello all,

         

        i'm currently working on our crash reporting facilities.

        we are using an exception handler ( NSSetUncaughtExceptionHandler ) to catch exeptions and throw up an alert to the user that allows to send details back to us.

        i've found out that sometimes this would not work because using -[NSAlert runModal] incurrs re-display of all existing windows, which can lead to existing NSTableViews re-loading their data before actually showing the alert (despite it being modal!). if the TableView data is corrupted (after all we just had an exception), further exceptions might be triggered, prevent the alert about the first exception from ever becoming visible.

        i think its weird that -[NSAlert runModal] can force other windows to reload but i've thought about a solution. since the app is broken at this point anyway, the only

         

        thing we really want to do at this point is show the user some 'crash dialoge' with the option to send details back to us.

         

        i've developed a 'CrashHelper' application that would load details from the passed arguments and display it in a nice alert.

         

        however, launching this CrashHelper application from our main application with

        [NSWorkspace launchApplicationAtURL:helperURL …]

        does not immediately launch the application, but rather ask the user if this is really what he wants with a standard system dialoge (

        http://i.stack.imgur.com/TQCcf.png )

         

        this is certainly not what we want in this case. the CrashHelper app needs to be launched without asking the user beforehand.

         

        our main application is sandboxed, and the helper application is also sandboxed (& both are properly signed). i've also made sure the helper doesn't have 'quarantine bit'.

         

        is there any way to prevent this system dialoge asking the user whether really to launch the helper application? i've certainly seen other apps launch helper apps without the system asking back ... not sure if they are sandboxed though.

         

        so how i can i launch a (sandboxed) helper application from a (sandboxed) main application without this alert appearing? is doing it as a XPC helper the only way?

        does anyone have any other ideas how to reliably trigger a 'crash report' dialoge from an exception handler without using NSAlert that might trigger further exceptions and therefore not work?

         

        any help would be greatly appreciated