[swift-users] intercept fatalError() or other termination messages from swift?

Joe Groff jgroff at apple.com
Wed Jun 28 11:13:22 CDT 2017


> On Jun 26, 2017, at 7:45 PM, David Baraff <davidbaraff at gmail.com> wrote:
> 
> Ok, the data is for sure not there, or possibly i’m looking at the wrong thing. Here is what I see:
> 
> Incident Identifier: 15D12BCE-975B-47B6-BD03-DD8512D40DAF
> CrashReporter Key:   8af1402ae87b0184acff113b3f7312743d94d074
> Hardware Model:      iPad6,7
> Process:             hackyApp [4965]
> Path:                /private/var/containers/Bundle/Application/29195F7D-7548-4917-93D8-2B027481EAFB/hackyApp.app/hackyApp
> Identifier:          deb.hackyApp
> Version:             1 (1.1)
> Code Type:           ARM-64 (Native)
> Role:                Foreground
> Parent Process:      launchd [1]
> Coalition:           deb.hackyApp [5747]
> 
> 
> Date/Time:           2017-06-26 19:38:48.2905 -0700
> Launch Time:         2017-06-26 19:38:48.1510 -0700
> OS Version:          iPhone OS 10.3.2 (14F89)
> Report Version:      104
> 
> Exception Type:  EXC_BREAKPOINT (SIGTRAP)
> Exception Codes: 0x0000000000000001, 0x000000010045f734
> Termination Signal: Trace/BPT trap: 5
> Termination Reason: Namespace SIGNAL, Code 0x5
> Terminating Process: exc handler [0]
> Triggered by Thread:  0
> 
> Filtered syslog:
> None found
> 
> Thread 0 name:  Dispatch queue: com.apple.main-thread
> Thread 0 Crashed:
> 0   libswiftCore.dylib            	0x000000010045f734 0x100304000 + 1423156
> 1   libswiftCore.dylib            	0x000000010045f734 0x100304000 + 1423156
> 2   hackyApp                      	0x00000001000b0708 0x1000a8000 + 34568
> 3   hackyApp                      	0x00000001000b08c0 0x1000a8000 + 35008
> 4   UIKit                         	0x000000019822cec0 -[UIViewController loadViewIfRequired] + 1036
> 
> 
>> 
> The stack trace continues for a while, then a list of binary images.  There is nothing that says "Application Specific Information”. Am I pulling the wrong data in xcode?  Is my app setup in a weird way that this is not reported?
> 
> This is doing the very simple “fatalError()” route in the main controller's viewDidLoad() routine.
> 
> Thanks for any insights.

Unfortunately, it looks like iOS on-device prunes the application-specific info from crash logs because of user privacy concerns. The crash reason does show up in macOS or simulator crash logs, however.

-Joe


More information about the swift-users mailing list