App got crashed upon the launch

We got multiple crash events reported by our customers post-app update.

The event is like the app got crashed upon the app launch.

After reinstalling the app, it works for them.

Here I have attached complete crash logs shared by our customers from their devices as well as from the Testflight crash logs console from Xcode.

Here is the suspected code that causes the crash but we are not sure:


Thread 0 name:   Dispatch queue: com.apple.main-thread
Thread 0:
0   libsystem_kernel.dylib        	       0x2007c5b48 mach_msg2_trap + 8
1   libsystem_kernel.dylib        	       0x2007d8008 mach_msg2_internal + 80
2   libsystem_kernel.dylib        	       0x2007d8248 mach_msg_overwrite + 388
3   libsystem_kernel.dylib        	       0x2007c608c mach_msg + 24
4   libdispatch.dylib             	       0x1cb1b9364 _dispatch_mach_send_and_wait_for_reply + 540
5   libdispatch.dylib             	       0x1cb1b96ec dispatch_mach_send_with_result_and_wait_for_reply + 60
6   libxpc.dylib                  	       0x210c7b2e4 xpc_connection_send_message_with_reply_sync + 240
7   Security                      	       0x1cb9989b4 securityd_message_with_reply_sync + 124
8   Security                      	       0x1cb9a2aa4 securityd_send_sync_and_do + 88
9   Security                      	       0x1cba49598 cftype_to_bool_cftype_error_request + 160
10  Security                      	       0x1cb992d4c __SecItemCopyMatching_block_invoke_2 + 200
11  Security                      	       0x1cb995dc4 __SecItemAuthDoQuery_block_invoke + 532
12  Security                      	       0x1cb994898 SecItemAuthDoQuery + 1236
13  Security                      	       0x1cb995a94 __SecItemCopyMatching_block_invoke + 140
14  Security                      	       0x1cb99b99c SecOSStatusWith + 56
15  Security                      	       0x1cb99595c SecItemCopyMatching + 400
16  myappname                     	       0x10273ec34 0x102188000 + 5991476
17  myappname                     	       0x102473298 0x102188000 + 3060376
18  myappname                     	       0x1023e0be0 0x102188000 + 2460640
19  myappname                     	       0x1021d6f54 0x102188000 + 323412
20  myappname                     	       0x10264cd8c 0x102188000 + 5000588
21  UIKitCore                     	       0x1c60db810 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 180
22  UIKitCore                     	       0x1c60dafac -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 2848
23  UIKitCore                     	       0x1c60d9f88 -[UIApplication _runWithMainScene:transitionContext:completion:] + 856
24  UIKitCore                     	       0x1c60d9bd4 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 132
25  UIKitCore                     	       0x1c5e1f600 _UIScenePerformActionsWithLifecycleActionMask + 108
26  UIKitCore                     	       0x1c6161918 __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 216

Kindly help here to get it resolved.

Thank you, Prashant

Replies

Here is the suspected code that causes the crash

No. Consider this line:

Triggered by Thread:  6

So you want to look at the backtrace of thread 6:

Thread 6 name:   Dispatch queue: com.apple.usernotifications.UNUserNotificationServiceConnection
Thread 6 Crashed:
0   libxpc.dylib            … _xpc_dictionary_insert + 96
1   libxpc.dylib            … _xpc_dictionary_insert + 76
2   libxpc.dylib            … _xpc_dictionary_deserialize_apply + 68
3   libxpc.dylib            … _xpc_dictionary_apply_wire_f + 136
4   libxpc.dylib            … _xpc_dictionary_create_from_received_message + 224
5   libxpc.dylib            … _xpc_graph_unpack_impl + 236
6   libxpc.dylib            … xpc_receive_mach_msg + 280
7   libxpc.dylib            … _xpc_pipe_routine + 668
8   libxpc.dylib            … _xpc_interface_routine + 184
9   libxpc.dylib            … _xpc_look_up_endpoint + 268
10  libxpc.dylib            … _xpc_connection_bootstrap_look_up_slow + 288
11  libxpc.dylib            … _xpc_connection_init + 1004
12  libxpc.dylib            … _xpc_connection_activate_if_needed + 296
13  libxpc.dylib            … xpc_connection_resume + 92
14  UserNotifications       … -[UNUserNotificationServiceConnection _queue_ensureConnection] + 456
15  UserNotifications       … __109-[UNUserNotificationServiceConnection requestAuthorizationWithOptions:forBundleIdentifier:completionHandler:]_block_invoke + 44
16  libdispatch.dylib       … _dispatch_call_block_and_release + 32
17  libdispatch.dylib       … _dispatch_client_callout + 20
18  libdispatch.dylib       … _dispatch_lane_serial_drain + 672
19  libdispatch.dylib       … _dispatch_lane_invoke + 436
20  libdispatch.dylib       … _dispatch_workloop_worker_thread + 652
21  libsystem_pthread.dylib … _pthread_wqthread + 288
22  libsystem_pthread.dylib … start_wqthread + 8

You’re deep within XPC, handling what looks like something to do with user notifications, and have hit a memory management problem deserialising a message. I strongly suspect that’s caused by a memory management problem in your app and I recommend that you apply the standard memory debugging tools to see if you can make it more reproducible.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"