Hi,
My app hangs for about a second when I open the app when it's been in background phase. It doesn't hang every time, but it hangs randomly (like once in 10 times) when I open the app again. I am not able to reproduce what causes this hang.
Hang Detection provides hang logs (spindump) when hang occurs. It has something to do with MusicKit as logs mention it but I cannot understand what it is. Please help me understand these logs.
I am running iOS 17 beta 1 with MusicKit and ApplicationMusicPlayer.
Heaviest stack for the main thread of the target process:
69 start + 2104 (dyld + 87288) [0x1b719b4f8]
69 ??? (Timed + 32864) [0x104ae8060]
69 ??? (SwiftUI + 980040) [0x19840a448]
69 ??? (SwiftUI + 1071088) [0x1984207f0]
69 ??? (SwiftUI + 1667804) [0x1984b22dc]
69 UIApplicationMain + 340 (UIKitCore + 3740336) [0x196c602b0]
69 -[UIApplication _run] + 888 (UIKitCore + 3741260) [0x196c6064c]
69 GSEventRunModal + 164 (GraphicsServices + 4644) [0x1d6199224]
69 CFRunLoopRunSpecific + 600 (CoreFoundation + 527792) [0x1947fedb0]
68 __CFRunLoopRun + 1996 (CoreFoundation + 509348) [0x1947fa5a4]
68 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CoreFoundation + 626340) [0x194816ea4]
68 _dispatch_main_queue_callback_4CF + 44 (libdispatch.dylib + 75296) [0x19c404620]
67 _dispatch_main_queue_drain + 744 (libdispatch.dylib + 76056) [0x19c404918]
67 swift_job_runImpl(swift::Job*, swift::ExecutorRef) + 72 (libswift_Concurrency.dylib + 274348) [0x19f58cfac]
67 swift::runJobInEstablishedExecutorContext(swift::Job*) + 416 (libswift_Concurrency.dylib + 269688) [0x19f58bd78]
66 ??? (MusicKit + 4857464) [0x208aabe78]
66 ??? (MusicKit + 4856108) [0x208aab92c]
66 -[MusicKit_SoftLinking_MPMusicPlayerController nowPlayingItem] + 24 (MusicKit + 157364) [0x2086306b4]
66 -[MPMusicPlayerController nowPlayingItem] + 24 (MediaPlayer + 1358540) [0x1a681bacc]
66 -[MPMusicPlayerController _nowPlaying] + 372 (MediaPlayer + 1329552) [0x1a6814990]
66 -[MPMusicPlayerController onServer:] + 52 (MediaPlayer + 1333428) [0x1a68158b4]
63 -[MPMusicPlayerApplicationController _establishConnectionIfNeeded] + 1768 (MediaPlayer + 1553848) [0x1a684b5b8]
63 _NSXPCDistantObjectSimpleMessageSend1 + 60 (Foundation + 208348) [0x1937daddc]
63 -[NSXPCConnection _sendSelector:withProxy:arg1:] + 116 (Foundation + 208548) [0x1937daea4]
62 -[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:] + 2160 (Foundation + 214664) [0x1937dc688]
62 __NSXPCCONNECTION_IS_WAITING_FOR_A_SYNCHRONOUS_REPLY__ + 16 (Foundation + 652944) [0x193847690]
62 xpc_connection_send_message_with_reply_sync + 264 (libxpc.dylib + 67488) [0x1fc00d7a0]
62 dispatch_mach_send_with_result_and_wait_for_reply + 60 (libdispatch.dylib + 127760) [0x19c411310]
62 _dispatch_mach_send_and_wait_for_reply + 540 (libdispatch.dylib + 126832) [0x19c410f70]
62 mach_msg + 24 (libsystem_kernel.dylib + 4692) [0x1da082254]
62 mach_msg_overwrite + 436 (libsystem_kernel.dylib + 83544) [0x1da095658]
62 mach_msg2_trap + 8 (libsystem_kernel.dylib + 3332) [0x1da081d04]
*62 ??? (<31E57057-A9A0-3BE5-90CB-5C08E9683B34> + 217132) [0xfffffff007e0102c]
Thank you.
CC @JoeKun