gdavis / Mimir-Feedback

The place to report bugs and suggest improvements for the podcast app Mimir
https://mimirpodcasts.app
9 stars 0 forks source link

[Bug][iOS] Crash performing time update when audio engine is reconnecting nodes #76

Closed gdavis closed 2 years ago

gdavis commented 2 years ago

From the crash log below, it looks like the app had a configuration change and needed to restart the audio engine. A time update then occured and tried to access the last render time of the node before the engine was running. This crashes the app.

Add a fix to check to make sure the node's engine is up and running before attempting to access the last render time.

Incident Identifier: 761B5719-B091-49F7-BC52-FCAC1F725102
Hardware Model:      iPhone13,3
Process:             Mimir [50827]
Path:                /private/var/containers/Bundle/Application/04270E73-7979-4A4D-9D86-8E1198EC5F60/Mimir.app/Mimir
Identifier:          com.grantdavisinteractive.Mimir
Version:             1.0.0 (78)
AppStoreTools:       13E114
AppVariant:          1:iPhone13,3:15
Beta:                YES
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.grantdavisinteractive.Mimir [1982]

Date/Time:           2022-03-25 12:20:54.6759 +0100
Launch Time:         2022-03-25 12:16:06.9456 +0100
OS Version:          iPhone OS 15.4 (19E241)
Release Type:        User
Baseband Version:    2.53.01
Report Version:      104

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

Last Exception Backtrace:
0   CoreFoundation                  0x1ba695d78 __exceptionPreprocess + 220 (NSException.m:200)
1   libobjc.A.dylib                 0x1d32fa734 objc_exception_throw + 60 (objc-exception.mm:565)
2   CoreFoundation                  0x1ba76d050 +[NSException raise:format:arguments:] + 100 (NSException.m:147)
3   AVFAudio                        0x22dc37f1c AVAE_RaiseException(NSString*, ...) + 60 (AVAEInternal.h:69)
4   AVFAudio                        0x22dc38ab4 AVAudioNodeImpl::AVAE_CheckNodeHasEngine() const + 252 (AVAEInternal.h:77)
5   AVFAudio                        0x22dcf4c04 AVAudioNodeImplBase::CurrentTime() + 60 (AVAudioNode.mm:700)
6   AVFAudio                        0x22dcf2c94 -[AVAudioNode lastRenderTime] + 104 (AVAudioNode.mm:133)
7   MimirKitMobile                  0x104e9156c MimirPlayer.performTimeUpdate() + 56 (MimirPlayer.swift:897)
8   MimirKitMobile                  0x104e913ac closure #1 in MimirPlayer.startUpdatingTime() + 280 (MimirPlayer.swift:951)
9   Combine                         0x1d267c4b0 Subscribers.Sink.receive(_:) + 96 (Sink.swift:128)
10  Combine                         0x1d267bda8 protocol witness for Subscriber.receive(_:) in conformance Subscribers.Sink<A, B> + 24 (<compiler-generated>:0)
11  Combine                         0x1d26bb834 Publishers.Autoconnect.Inner.receive(_:) + 52 (Autoconnect.swift:142)
12  libswiftFoundation.dylib        0x1bed5b25c NSTimer.TimerPublisher.Inner.send(_:) + 744 (Publishers+Timer.swift:172)
13  libswiftFoundation.dylib        0x1bed4aa4c partial apply for implicit closure #2 in implicit closure #1 in NSTimer.TimerPublisher.Side.init<A>(_:) + 32 (Publishers+Timer.swift:52)
14  libswiftFoundation.dylib        0x1bed5a31c specialized NSTimer.TimerPublisher.fire(_:) + 204 (Publishers+Timer.swift:105)
15  libswiftFoundation.dylib        0x1bed4b558 thunk for @escaping @callee_guaranteed (@guaranteed NSTimer) -> () + 60 (<compiler-generated>:0)
16  Foundation                      0x1bbe1c0bc __NSFireTimer + 104 (NSTimer.m:280)
17  CoreFoundation                  0x1ba6ab168 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32 (CFRunLoop.c:1812)
18  CoreFoundation                  0x1ba62f144 __CFRunLoopDoTimer + 1064 (CFRunLoop.c:2420)
19  CoreFoundation                  0x1ba6298f0 __CFRunLoopDoTimers + 320 (CFRunLoop.c:2580)
20  CoreFoundation                  0x1ba607fa0 __CFRunLoopRun + 1936 (CFRunLoop.c:3116)
21  CoreFoundation                  0x1ba61b6b8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
22  GraphicsServices                0x1d66b5374 GSEventRunModal + 164 (GSEvent.c:2200)
23  UIKitCore                       0x1bcf80e88 -[UIApplication _run] + 1100 (UIApplication.m:3511)
24  UIKitCore                       0x1bcd025ec UIApplicationMain + 364 (UIApplication.m:5064)
25  Mimir                           0x1046dd238 main + 68 (CuratedListDetailCoordinator.swift:14)
26  dyld                            0x104b35ce4 start + 520 (dyldMain.cpp:879)

Kernel Triage:
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage

Thread 0 name:
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x00000001f215eb78 __pthread_kill + 8
1   libsystem_pthread.dylib         0x000000022bdd03bc pthread_kill + 268 (pthread.c:1668)
2   libsystem_c.dylib               0x00000001c577851c abort + 168 (abort.c:118)
3   libc++abi.dylib                 0x00000001d3405b7c abort_message + 132 (abort_message.cpp:78)
4   libc++abi.dylib                 0x00000001d33f59c4 demangling_terminate_handler() + 336 (cxa_default_handlers.cpp:71)
5   libobjc.A.dylib                 0x00000001d3300c88 _objc_terminate() + 144 (objc-exception.mm:701)
6   libc++abi.dylib                 0x00000001d3404f18 std::__terminate(void (*)()) + 20 (cxa_handlers.cpp:59)
7   libc++abi.dylib                 0x00000001d3407ebc __cxa_rethrow + 148 (cxa_exception.cpp:616)
8   libobjc.A.dylib                 0x00000001d32fc6b0 objc_exception_rethrow + 44 (objc-exception.mm:604)
9   CoreFoundation                  0x00000001ba61b7a4 CFRunLoopRunSpecific + 836 (CFRunLoop.c:3283)
10  GraphicsServices                0x00000001d66b5374 GSEventRunModal + 164 (GSEvent.c:2200)
11  UIKitCore                       0x00000001bcf80e88 -[UIApplication _run] + 1100 (UIApplication.m:3511)
12  UIKitCore                       0x00000001bcd025ec UIApplicationMain + 364 (UIApplication.m:5064)
13  Mimir                           0x00000001046dd238 main + 68 (CuratedListDetailCoordinator.swift:14)
14  dyld                            0x0000000104b35ce4 start + 520 (dyldMain.cpp:879)

Thread 1 name:
Thread 1:
0   libsystem_kernel.dylib          0x00000001f21584e0 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x00000001f2158b24 mach_msg + 76 (mach_msg.c:119)
2   CoreFoundation                  0x00000001ba603820 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3   CoreFoundation                  0x00000001ba607cac __CFRunLoopRun + 1180 (CFRunLoop.c:3000)
4   CoreFoundation                  0x00000001ba61b6b8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5   Foundation                      0x00000001bbe02414 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 236 (NSRunLoop.m:373)
6   Foundation                      0x00000001bbe43cac -[NSRunLoop(NSRunLoop) runUntilDate:] + 92 (NSRunLoop.m:420)
7   UIKitCore                       0x00000001bcefafb0 -[UIEventFetcher threadMain] + 524 (UIEventFetcher.m:1167)
8   Foundation                      0x00000001bbe5255c __NSThread__start__ + 808 (NSThread.m:972)
9   libsystem_pthread.dylib         0x000000022bdca9ac _pthread_start + 148 (pthread.c:891)
10  libsystem_pthread.dylib         0x000000022bdc9e68 thread_start + 8

Thread 2 name:
Thread 2:
0   libsystem_kernel.dylib          0x00000001f21584e0 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x00000001f2158b24 mach_msg + 76 (mach_msg.c:119)
2   CoreFoundation                  0x00000001ba603820 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3   CoreFoundation                  0x00000001ba607cac __CFRunLoopRun + 1180 (CFRunLoop.c:3000)
4   CoreFoundation                  0x00000001ba61b6b8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5   AudioSession                    0x00000001c3c04f04 CADeprecated::GenericRunLoopThread::Entry(void*) + 164 (GenericRunLoopThread.h:95)
6   AudioSession                    0x00000001c3c0e8f0 CADeprecated::CAPThread::Entry(CADeprecated::CAPThread*) + 92 (CAPThread.cpp:324)
7   libsystem_pthread.dylib         0x000000022bdca9ac _pthread_start + 148 (pthread.c:891)
8   libsystem_pthread.dylib         0x000000022bdc9e68 thread_start + 8

Thread 3 name:
Thread 3:
0   libsystem_kernel.dylib          0x00000001f215851c semaphore_wait_trap + 8
1   caulk                           0x0000000226a5b380 caulk::mach::semaphore::wait_or_error() + 28 (mach_semaphore.cpp:131)
2   caulk                           0x0000000226a5c078 caulk::concurrent::details::worker_thread::run() + 56 (semaphore.cpp:85)
3   caulk                           0x0000000226a5cab4 void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::*)(), std::__1::tuple<caulk::concurrent::details::worker_thread*> > >(void*) + 96 (type_traits:3866)
4   libsystem_pthread.dylib         0x000000022bdca9ac _pthread_start + 148 (pthread.c:891)
5   libsystem_pthread.dylib         0x000000022bdc9e68 thread_start + 8

Thread 4:
0   libsystem_kernel.dylib          0x00000001f215851c semaphore_wait_trap + 8
1   caulk                           0x0000000226a5b380 caulk::mach::semaphore::wait_or_error() + 28 (mach_semaphore.cpp:131)
2   caulk                           0x0000000226a5c078 caulk::concurrent::details::worker_thread::run() + 56 (semaphore.cpp:85)
3   caulk                           0x0000000226a5cab4 void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::*)(), std::__1::tuple<caulk::concurrent::details::worker_thread*> > >(void*) + 96 (type_traits:3866)
4   libsystem_pthread.dylib         0x000000022bdca9ac _pthread_start + 148 (pthread.c:891)
5   libsystem_pthread.dylib         0x000000022bdc9e68 thread_start + 8

Thread 5 name:
Thread 5:
0   libsystem_kernel.dylib          0x00000001f21591a4 select$DARWIN_EXTSN + 8
1   CoreFoundation                  0x00000001ba6a7658 __CFSocketManager + 644 (CFSocket.c:1343)
2   libsystem_pthread.dylib         0x000000022bdca9ac _pthread_start + 148 (pthread.c:891)
3   libsystem_pthread.dylib         0x000000022bdc9e68 thread_start + 8

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

Thread 7 name:
Thread 7:
0   libsystem_kernel.dylib          0x00000001f21584e0 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x00000001f2158b24 mach_msg + 76 (mach_msg.c:119)
2   libEmbeddedSystemAUs.dylib      0x00000001f6f608b8 AURemoteIO::AURemoteIO(OpaqueAudioComponentInstance*, EIOPersonality) + 1468 (AURemoteIOIPCUser.c:458)
3   libEmbeddedSystemAUs.dylib      0x00000001f6f5f054 ausdk::ComponentBase::AP_Open(void*, OpaqueAudioComponentInstance*) + 60 (ComponentBase.cpp:48)
4   AudioToolboxCore                0x00000001cd99b560 APComponent::newInstance(unsigned int, bool, void (OpaqueAudioComponentInstance*, int) block_pointer) + 1828 (APComponent.mm:322)
5   AudioToolboxCore                0x00000001cd98937c __AudioComponentInstanceNew_block_invoke + 120 (AudioComponentAPI.cpp:286)
6   AudioToolboxCore                0x00000001cd995634 Synchronously + 132 (Synchronously.cpp:20)
7   AudioToolboxCore                0x00000001cd98bebc AudioComponentInstanceNew + 328 (AudioComponentAPI.cpp:294)
8   AVFAudio                        0x000000022dc32448 AUInterfaceBaseV3::AUInterfaceBaseV3(AudioComponentDescription const&, OpaqueAudioComponentInstance*) + 364 (AUInterface.mm:468)
9   AVFAudio                        0x000000022dc31218 AVAudioIOUnit::Create(AVAudioEngineImpl&, bool, bool) + 348 (AUInterface.h:347)
10  AVFAudio                        0x000000022dc32fc8 AVAudioEngineImpl::GetIOUnit(bool) + 288 (AVAudioEngine.mm:494)
11  AVFAudio                        0x000000022dc30868 AVAudioEngineImpl::UpdateOutputNode(bool) + 112 (AVAudioEngine.mm:572)
12  AVFAudio                        0x000000022dd0d4a4 AVAudioEngineImpl::GetOutputNode() + 76 (AVAudioEngine.mm:503)
13  AVFAudio                        0x000000022dd0f0f4 -[AVAudioEngine mainMixerNode] + 80 (AVAudioEngine.mm:523)
14  MimirKitMobile                  0x0000000104e84f58 MimirPlayer.connectNodes() + 1216 (MimirPlayer.swift:709)
15  MimirKitMobile                  0x0000000104e7f554 MimirPlayer.rebuildEngine() + 400 (MimirPlayer+ConfigurationChange.swift:77)
16  MimirKitMobile                  0x0000000104e7ef08 MimirPlayer.rebuildEngineForConfigurationChange() + 512 (MimirPlayer+ConfigurationChange.swift:38)
17  MimirKitMobile                  0x0000000104e7ec88 closure #1 in MimirPlayer.setupEngineConfigurationChangeSubscriber() + 260 (MimirPlayer+ConfigurationChange.swift:23)
18  Combine                         0x00000001d267c4b0 Subscribers.Sink.receive(_:) + 96 (Sink.swift:128)
19  Combine                         0x00000001d267bda8 protocol witness for Subscriber.receive(_:) in conformance Subscribers.Sink<A, B> + 24 (<compiler-generated>:0)
20  Combine                         0x00000001d26839fc closure #1 in Publishers.ReceiveOn.Inner.receive(_:) + 288 (ReceiveOn.swift:169)
21  libswiftDispatch.dylib          0x00000001d4170c04 thunk for @escaping @callee_guaranteed () -> () + 36 (<compiler-generated>:0)
22  libdispatch.dylib               0x00000001ba2fae68 _dispatch_call_block_and_release + 32 (init.c:1517)
23  libdispatch.dylib               0x00000001ba2fca2c _dispatch_client_callout + 20 (object.m:560)
24  libdispatch.dylib               0x00000001ba304124 _dispatch_lane_serial_drain + 668 (inline_internal.h:2622)
25  libdispatch.dylib               0x00000001ba304c80 _dispatch_lane_invoke + 392 (queue.c:3944)
26  libdispatch.dylib               0x00000001ba30f500 _dispatch_workloop_worker_thread + 648 (queue.c:6732)
27  libsystem_pthread.dylib         0x000000022bdca0bc _pthread_wqthread + 288 (pthread.c:2599)
28  libsystem_pthread.dylib         0x000000022bdc9e5c start_wqthread + 8

Thread 8:
0   libsystem_pthread.dylib         0x000000022bdc9e54 start_wqthread + 0

Thread 9:
0   libsystem_pthread.dylib         0x000000022bdc9e54 start_wqthread + 0

Thread 10:
0   libsystem_pthread.dylib         0x000000022bdc9e54 start_wqthread + 0

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x0000000000000000   x3: 0x0000000000000000
    x4: 0x00000001d34090f5   x5: 0x000000016b727260   x6: 0x000000000000006e   x7: 0x0000000000000700
    x8: 0xaba666b5d7119782   x9: 0xaba666b4d3a91202  x10: 0x0000000000000200  x11: 0x000000000000000b
   x12: 0x000000000000000b  x13: 0x00000001ba9d2aff  x14: 0x00000001d340911b  x15: 0x0000000000000000
   x16: 0x0000000000000148  x17: 0x0000000104b88580  x18: 0x0000000000000000  x19: 0x0000000000000006
   x20: 0x0000000000000103  x21: 0x0000000104b88660  x22: 0x0000000000000001  x23: 0x00000002815800e0
   x24: 0x0000000000000000  x25: 0x0000000000000001  x26: 0x0000000eb1e31100  x27: 0x0000000213e8f000
   x28: 0x0000000000000001   fp: 0x000000016b7271d0   lr: 0x000000022bdd03bc
    sp: 0x000000016b7271b0   pc: 0x00000001f215eb78 cpsr: 0x40001000
   esr: 0x56000080  Address size fault

Binary Images:
0x1046d8000 - 0x104933fff Mimir arm64  <192fce5b198d364b9c0a42b6b8bd1121> /private/var/containers/Bundle/Application/04270E73-7979-4A4D-9D86-8E1198EC5F60/Mimir.app/Mimir
0x104b1c000 - 0x104b73fff dyld arm64e  <d16b72c0d6193e4892622c10a1d3066f> /usr/lib/dyld
0x104bc4000 - 0x1050a3fff MimirKitMobile arm64  <1d1d38c8112a34e6aab14c93845ffe2b> /private/var/containers/Bundle/Application/04270E73-7979-4A4D-9D86-8E1198EC5F60/Mimir.app/Frameworks/MimirKitMobile.framework/MimirKitMobile
0x1ba2f9000 - 0x1ba33efff libdispatch.dylib arm64e  <69dac9c7ddaf318eb068be596d142a2f> /usr/lib/system/libdispatch.dylib
0x1ba5fc000 - 0x1baa51fff CoreFoundation arm64e  <d2716f2f688b3d51ba8b17e6553b209e> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x1bbdea000 - 0x1bc0f2fff Foundation arm64e  <feeef9b1b0e63561adfa3ef0302d23f8> /System/Library/Frameworks/Foundation.framework/Foundation
0x1bca6d000 - 0x1be307fff UIKitCore arm64e  <e6e89bb5b5863725bf8f4c85dcd443bd> /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
0x1bed45000 - 0x1bf0b7fff libswiftFoundation.dylib arm64e  <cf9cfc72357b388b9db8f686f1baf3f0> /usr/lib/swift/libswiftFoundation.dylib
0x1c3bfe000 - 0x1c3c28fff AudioSession arm64e  <37d438b9289d39b08b671b38de65305f> /System/Library/PrivateFrameworks/AudioSession.framework/AudioSession
0x1c5758000 - 0x1c57d7fff libsystem_c.dylib arm64e  <b0793d31ed1b3549b86192a10841bf68> /usr/lib/system/libsystem_c.dylib
0x1cd974000 - 0x1cdc14fff AudioToolboxCore arm64e  <0372fe3a2a6b370788ccbc84f6870bc9> /System/Library/PrivateFrameworks/AudioToolboxCore.framework/AudioToolboxCore
0x1d2671000 - 0x1d27befff Combine arm64e  <2df8f9844d5d365ea497c9942d2ec5ef> /System/Library/Frameworks/Combine.framework/Combine
0x1d32e4000 - 0x1d3320fff libobjc.A.dylib arm64e  <a196a0f6cadb325bbc1f5965e670f9b6> /usr/lib/libobjc.A.dylib
0x1d33f4000 - 0x1d340bfff libc++abi.dylib arm64e  <fe24cee611ec3951aa1832594f98ef0d> /usr/lib/libc++abi.dylib
0x1d416f000 - 0x1d4187fff libswiftDispatch.dylib arm64e  <c9d681c8c4cc387bb2f213171a3ad124> /usr/lib/swift/libswiftDispatch.dylib
0x1d66b4000 - 0x1d66bcfff GraphicsServices arm64e  <75a910dc87a43b3a8c0ea868b945f5d4> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
0x1f2157000 - 0x1f218cfff libsystem_kernel.dylib arm64e  <c2fcc05874803c14b4790064a3f843e3> /usr/lib/system/libsystem_kernel.dylib
0x1f6f52000 - 0x1f705dfff libEmbeddedSystemAUs.dylib arm64e  <705d79cc33b830529e06808424ac0326> /System/Library/Frameworks/AudioToolbox.framework/libEmbeddedSystemAUs.dylib
0x226a58000 - 0x226a7efff caulk arm64e  <052d398b097e383fab9c2a69bfb434c4> /System/Library/PrivateFrameworks/caulk.framework/caulk
0x22bdc9000 - 0x22bdd4fff libsystem_pthread.dylib arm64e  <b48efcbed4f7308ba3fa172e0ea78e33> /usr/lib/system/libsystem_pthread.dylib
0x22dc2e000 - 0x22dd57fff AVFAudio arm64e  <e0f6b0232b0a39979abf1c27ec4035f0> /System/Library/Frameworks/AVFAudio.framework/AVFAudio

EOF