Random crash on iOS

Hi everybody!

My testers report a random crash which cannot be reproduced on a certain screen. Took me a few months(!) until I also got one and now I finally have a crash report. I can’t make any sense of it though. I am reading a lot with “audio” in that crash log. I don’t use any audio in that screen though. Maybe someone here can help if I post it? Thank you!

Incident Identifier: 13F338E7-866E-4F81-872E-A48BEF17CCF5
CrashReporter Key:   d12b235b705e44029566442b2a16fdb90b742724
Hardware Model:      iPhone8,4
Process:             AppName [418]
Path:                /private/var/containers/Bundle/Application/59A37251-DA11-4F5E-91B4-3AE8748C9B99/AppName.app/AppName
Identifier:          com.CompanyName. AppName
Version:             0.2.2 (0.2.2)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.CompanyName.AppName [516]


Date/Time:           2020-10-09 23:38:17.8876 +0200
Launch Time:         2020-10-09 23:36:17.6296 +0200
OS Version:          iPhone OS 13.7 (17H35)
Release Type:        User
Baseband Version:    9.71.01
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib        	0x000000018f241d88 __pthread_kill + 8
1   libsystem_pthread.dylib       	0x000000018f15a1e8 pthread_kill$VARIANT$mp + 136
2   libsystem_c.dylib             	0x000000018f0ad934 abort + 100
3   libsystem_c.dylib             	0x000000018f0acd54 err + 0
4   AppName                 	0x000000010263ffb8 0x100f90000 + 23789496
5   AppName                 	0x000000010264e444 0x100f90000 + 23848004
6   AppName                 	0x000000010264e6c8 0x100f90000 + 23848648
7   UIKitCore                     	0x00000001930d2f24 _UIGestureEnvironmentUpdate + 7088
8   UIKitCore                     	0x00000001930d1328 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 372
9   UIKitCore                     	0x00000001930d10f4 -[UIGestureEnvironment _updateForEvent:window:] + 232
10  UIKitCore                     	0x000000019353cc48 -[UIWindow sendEvent:] + 3440
11  UIKitCore                     	0x00000001935188ec -[UIApplication sendEvent:] + 344
12  UIKitCore                     	0x0000000193599970 __dispatchPreprocessedEventFromEventQueue + 6808
13  UIKitCore                     	0x000000019359c4ec __handleEventQueueInternal + 5364
14  UIKitCore                     	0x0000000193594168 __handleHIDEventFetcherDrain + 140
15  CoreFoundation                	0x000000018f3caad8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
16  CoreFoundation                	0x000000018f3caa30 __CFRunLoopDoSource0 + 80
17  CoreFoundation                	0x000000018f3ca1b8 __CFRunLoopDoSources0 + 184
18  CoreFoundation                	0x000000018f3c51e8 __CFRunLoopRun + 788
19  CoreFoundation                	0x000000018f3c4ba8 CFRunLoopRunSpecific + 424
20  GraphicsServices              	0x000000019953b344 GSEventRunModal + 160
21  UIKitCore                     	0x00000001935003e4 UIApplicationMain + 1932
22  AppName                 	0x000000010264093c 0x100f90000 + 23791932
23  AppName                 	0x0000000100f95388 0x100f90000 + 21384
24  AppName                 	0x000000010252b3f8 0x100f90000 + 22655992
25  AppName                 	0x000000010252acf8 0x100f90000 + 22654200
26  libdyld.dylib                 	0x000000018f24c8f0 start + 4

Thread 1 name:  com.apple.uikit.eventfetch-thread
Thread 1:
0   libsystem_kernel.dylib        	0x000000018f220198 mach_msg_trap + 8
1   libsystem_kernel.dylib        	0x000000018f21f60c mach_msg + 72
2   CoreFoundation                	0x000000018f3ca328 __CFRunLoopServiceMachPort + 148
3   CoreFoundation                	0x000000018f3c535c __CFRunLoopRun + 1160
4   CoreFoundation                	0x000000018f3c4ba8 CFRunLoopRunSpecific + 424
5   Foundation                    	0x000000018f71601c -[NSRunLoop+ 32796 (NSRunLoop) runMode:beforeDate:] + 228
6   Foundation                    	0x000000018f715efc -[NSRunLoop+ 32508 (NSRunLoop) runUntilDate:] + 88
7   UIKitCore                     	0x00000001935a357c -[UIEventFetcher threadMain] + 152
8   Foundation                    	0x000000018f844e20 __NSThread__start__ + 848
9   libsystem_pthread.dylib       	0x000000018f162d98 _pthread_start + 156
10  libsystem_pthread.dylib       	0x000000018f16674c thread_start + 8

Thread 2 name:  AVAudioSession Notify Thread
Thread 2:
0   libsystem_kernel.dylib        	0x000000018f220198 mach_msg_trap + 8
1   libsystem_kernel.dylib        	0x000000018f21f60c mach_msg + 72
2   CoreFoundation                	0x000000018f3ca328 __CFRunLoopServiceMachPort + 148
3   CoreFoundation                	0x000000018f3c535c __CFRunLoopRun + 1160
4   CoreFoundation                	0x000000018f3c4ba8 CFRunLoopRunSpecific + 424
5   AVFAudio                      	0x000000019c19ba2c GenericRunLoopThread::Entry+ 416300 (void*) + 156
6   AVFAudio                      	0x000000019c1ec7a0 CAPThread::Entry+ 747424 (CAPThread*) + 204
7   libsystem_pthread.dylib       	0x000000018f162d98 _pthread_start + 156
8   libsystem_pthread.dylib       	0x000000018f16674c thread_start + 8

Thread 3 name:  com.apple.coreaudio.AQClient
Thread 3:
0   libsystem_kernel.dylib        	0x000000018f220198 mach_msg_trap + 8
1   libsystem_kernel.dylib        	0x000000018f21f60c mach_msg + 72
2   CoreFoundation                	0x000000018f3ca328 __CFRunLoopServiceMachPort + 148
3   CoreFoundation                	0x000000018f3c535c __CFRunLoopRun + 1160
4   CoreFoundation                	0x000000018f3c4ba8 CFRunLoopRunSpecific + 424
5   AudioToolbox                  	0x000000019a7248fc GenericRunLoopThread::Entry+ 1591548 (void*) + 156
6   libAudioToolboxUtility.dylib  	0x000000019a7e56a4 CAPThread::Entry+ 63140 (CAPThread*) + 88
7   libsystem_pthread.dylib       	0x000000018f162d98 _pthread_start + 156
8   libsystem_pthread.dylib       	0x000000018f16674c thread_start + 8

Thread 4:
0   libsystem_pthread.dylib       	0x000000018f166738 start_wqthread + 0

Thread 5:
0   libsystem_pthread.dylib       	0x000000018f166738 start_wqthread + 0

Thread 6:
0   libsystem_pthread.dylib       	0x000000018f166738 start_wqthread + 0

Thread 7:
0   libsystem_pthread.dylib       	0x000000018f166738 start_wqthread + 0

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x0000000000000000   x3: 0x0000000000000000
    x4: 0x0000000000000000   x5: 0x000000016ee6c2f8   x6: 0x000000000000fffd   x7: 0x000000018f52b4d0
    x8: 0x0000000102b41840   x9: 0x681207e77202ca02  x10: 0x000000018f15a160  x11: 0x000000000000000a
   x12: 0x0000000000000000  x13: 0x0000000000000039  x14: 0x00000000fca02400  x15: 0x0000000000000002
   x16: 0x0000000000000148  x17: 0x0000000000000004  x18: 0x0000000000000000  x19: 0x0000000000000006
   x20: 0x0000000000000407  x21: 0x000000000000005c  x22: 0x0000000102b41920  x23: 0x000000012287c000
   x24: 0x00000001dbfdc000  x25: 0x000000028346c6d8  x26: 0x0000000122612030  x27: 0x000000028fde03c0
   x28: 0x0000000290908600   fp: 0x000000016ee6ccb0   lr: 0x000000018f15a1e8
    sp: 0x000000016ee6cc90   pc: 0x000000018f241d88 cpsr: 0x40000000
   esr: 0x56000080  Address size fault

Thread 0 crashed, doesn’t seem to be anything related with Audio.

Can you desymbolicate the crash log, especially lines 4 to 6 of Thread 0? Seems like that’s where the error happened.

Is it this you’re looking for?

Date/Time:           2020-10-10 09:48:48.2740 +0200
Launch Time:         2020-10-10 09:42:52.9579 +0200
OS Version:          iPhone OS 14.0.1 (18A393)
Release Type:        User
Baseband Version:    3.00.01
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib        	0x00000001be62398c __pthread_kill + 8
1   libsystem_pthread.dylib       	0x00000001d9c4bc74 pthread_kill + 272
2   libsystem_c.dylib             	0x000000019b7f4bb4 abort + 104
3   libsystem_c.dylib             	0x000000019b7f3ed0 err + 0
4   Bundestrainer                 	0x00000001065fffb8 UnhandledException(RuntimeObject*) + 23789496 (iOSApplication.mm:0)
5   Bundestrainer                 	0x000000010660e444 -[XOJCanvasView invokeTouchEvent:withTouches:event:] + 23848004 (RBUICanvas.mm:76)
6   Bundestrainer                 	0x000000010660e6c8 -[XOJCanvasView touchesEnded:withEvent:] + 23848648 (RBUICanvas.mm:102)
7   UIKitCore                     	0x0000000194b68de8 _UIGestureEnvironmentUpdate + 6632
8   UIKitCore                     	0x0000000194b66f88 -[UIGestureEnvironment _updateForEvent:window:] + 764
9   UIKitCore                     	0x0000000195052550 -[UIWindow sendEvent:] + 3948
10  UIKitCore                     	0x000000019502c190 -[UIApplication sendEvent:] + 712
11  UIKitCore                     	0x00000001950b3560 __dispatchPreprocessedEventFromEventQueue + 7360
12  UIKitCore                     	0x00000001950b64b8 __processEventQueue + 6460
13  UIKitCore                     	0x00000001950ada3c __eventFetcherSourceCallback + 160
14  CoreFoundation                	0x000000019266f81c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
15  CoreFoundation                	0x000000019266f718 __CFRunLoopDoSource0 + 208
16  CoreFoundation                	0x000000019266ea28 __CFRunLoopDoSources0 + 268
17  CoreFoundation                	0x0000000192668d20 __CFRunLoopRun + 824
18  CoreFoundation                	0x00000001926684bc CFRunLoopRunSpecific + 600
19  GraphicsServices              	0x00000001a90ed820 GSEventRunModal + 164
20  UIKitCore                     	0x000000019500c734 -[UIApplication _run] + 1072
21  UIKitCore                     	0x0000000195011e10 UIApplicationMain + 168
22  Bundestrainer                 	0x000000010660093c runIOSMainLoop() + 23791932 (iOSAppDelegate.mm:170)
23  Bundestrainer                 	0x0000000104f54d78 Xojo._RuntimeRun + 36
24  Bundestrainer                 	0x00000001064eb3f8 _Main + 404
25  Bundestrainer                 	0x00000001064eacf8 main + 36
26  libdyld.dylib                 	0x000000019232fe60 start + 4

Seems that in a iOSCanvas touch event (pointer down or pointer up) you have an exception.

2 Likes

Thank you @DerkJ. Fortunately there is only one Canvas when the app crashes and I think I found what’s wrong. I’ll keep monitoring it.

1 Like

This is the last thing that happens before the UnhandledException is raised:

-[XOJCanvasView invokeTouchEvent:withTouches:event:] + 23848004 (RBUICanvas.mm:76)

So it seems. It could be some background task crashing other than the canvas PointerUp or PointerDown but i can’t see that from here.

What you can do is:

in UnhandledException use IntroSpection to Get the Type of exception, that’s one step forward.

Var exceptionType As Text = Xojo.Core.Introspection.GetType(err).FullName
System.Debuglog CurrentmethodName + " Exception of type: "+exceptionType + ", "+err.Reason

Out of my head. Now you should be able to open the console with your device attached and filter using “MyApplicationName” (use the actual app name) in the device selection.