native-audio
native-audio copied to clipboard
plugin crashing iOS app while in background.
Describe the bug The app is running in testflight and users are complaining the app crashes while in the background. Please find below the crash report collected from app store connect.
To Reproduce Steps to reproduce the behavior: put the app in background for a while
Expected behavior app should not crash
Screenshots
Desktop (please complete the following information):
- OS: Monterey 12.5.1
- Browser: chrome
- Version:105.0.5195.102 (Official Build) (arm64)
Smartphone (please complete the following information):
- Device: iPhone 13 Pro
- OS: iOS 15.6.1
- Browser chrome
- Version 105.0.5195.102 (Official Build) (arm64)
Additional context
Relevant info towards the end of the report, I think
`Incident Identifier: A1BDC5C0-E03E-475C-AF37-02D903C915BA Hardware Model: iPhone14,2 Process: App [90770] Path: /private/var/containers/Bundle/Application/F1F6F711-8FBB-405D-BEA6-08A160A1F3AD/App.app/App Identifier: xxx.xxxxxxxx.xx Version: 4.0.0 (80) AppStoreTools: 13F100 AppVariant: 1:iPhone14,2:15 Beta: YES Code Type: ARM-64 (Native) Role: Non UI Parent Process: launchd [1] Coalition: xxx.xxxxxxxx.xx [2817]
Date/Time: 2022-09-03 09:52:36.8225 +0200 Launch Time: 2022-09-03 09:08:05.1605 +0200 OS Version: iPhone OS 15.6.1 (19G82) Release Type: User Baseband Version: 1.70.01 Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x8000000000000008 -> 0x0000000000000008 (possible pointer authentication failure)
Exception Codes: 0x0000000000000001, 0x8000000000000008
VM Region Info: 0x8 is not in any region. Bytes before following region: 4338827256
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
__TEXT 1029d4000-1029d8000 [ 16K] r-x/r-x SM=COW ...D/App.app/App
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [90770]
Triggered by Thread: 1
Thread 0 name:
Thread 0:
0 libsystem_kernel.dylib 0x00000001fbae34a0 mach_msg_trap + 8 (:-1)
1 libsystem_kernel.dylib 0x00000001fbae3ae4 mach_msg + 76 (mach_msg.c:119)
2 libdispatch.dylib 0x00000001c3b6f678 _dispatch_mach_send_and_wait_for_reply + 540 (mach.c:815)
3 libdispatch.dylib 0x00000001c3b6fa00 dispatch_mach_send_with_result_and_wait_for_reply + 60 (mach.c:1973)
4 libxpc.dylib 0x000000023587cf0c xpc_connection_send_message_with_reply_sync + 240 (connection.c:974)
5 Foundation 0x00000001c568bc4c NSXPCCONNECTION_IS_WAITING_FOR_A_SYNCHRONOUS_REPLY + 16 (NSXPCConnection.m:223)
6 Foundation 0x00000001c5691d1c -[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:] + 2540 (NSXPCConnection.m:1649)
7 Foundation 0x00000001c570dfe4 -[NSXPCConnection _sendSelector:withProxy:arg1:arg2:arg3:arg4:] + 160 (NSXPCConnection.m:1301)
8 Foundation 0x00000001c56d55ac _NSXPCDistantObjectSimpleMessageSend4 + 92 (NSXPCDistantObject.m:292)
9 CoreServices 0x00000001c42c80c0 +[UTTypeRecord typeRecordWithTag:ofClass:conformingToIdentifier:] + 308 (UTTypeRecord.mm:218)
10 CoreServices 0x00000001c42bd418 UTTypeCreatePreferredIdentifierForTag + 88 (UTExternal.mm:46)
11 Capacitor 0x0000000102e93280 0x102e5c000 + 225920 (WebViewAssetHandler.swift:88)
12 Capacitor 0x0000000102e93ba8 0x102e5c000 + 228264 (WebViewAssetHandler.swift:33)
13 Capacitor 0x0000000102e90d08 0x102e5c000 + 216328 (
Thread 1 name:
Thread 1 Crashed:
0 libswiftCore.dylib 0x00000001c8d01d08 swift_isUniquelyReferenced_nonNull_native + 0 (atomic:1010)
1 CapacitorCommunityNativeAudio 0x0000000102fcd1d0 specialized Dictionary.Variant.setValue(:forKey:) + 48 (
Thread 2 name:
Thread 2:
0 libsystem_kernel.dylib 0x00000001fbae4600 __psynch_mutexwait + 8 (:-1)
1 libsystem_pthread.dylib 0x00000002358563dc pthread_mutex_firstfit_lock_wait + 84 (pthread_mutex.c:1414)
2 libsystem_pthread.dylib 0x000000023585d52c pthread_mutex_firstfit_lock_slow + 248 (pthread_mutex.c:1490)
3 AVFAudio 0x000000023733edfc AVAudioPlayerCpp::disposeQueue(bool) + 212 (AVAudioPlayerCpp.mm:161)
4 AVFAudio 0x000000023733f774 AVAudioPlayerCpp::prepareToPlayQueue() + 448 (AVAudioPlayerCpp.mm:888)
5 AVFAudio 0x000000023733f0ec AVAudioPlayerCpp::DoAction(unsigned int, unsigned long, void const*) + 300 (AVAudioPlayerCpp.mm:626)
6 AVFAudio 0x00000002372e7f0c -[AVAudioPlayer prepareToPlay] + 40 (AVAudioPlayer.mm:531)
7 CapacitorCommunityNativeAudio 0x0000000102fc9608 specialized AudioAsset.init(owner:withAssetId:withPath:withChannels:withVolume:withFadeDelay:) + 856 (AudioAsset.swift:39)
8 CapacitorCommunityNativeAudio 0x0000000102fcc800 closure #1 in NativeAudio.preloadAsset(:isComplex:) + 1528 (Plugin.swift:0)
9 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(:isComplex:) + 76 (
Thread 3 name:
Thread 3:
0 libsystem_kernel.dylib 0x00000001fbae4600 __psynch_mutexwait + 8 (:-1)
1 libsystem_pthread.dylib 0x00000002358563dc pthread_mutex_firstfit_lock_wait + 84 (pthread_mutex.c:1414)
2 libsystem_pthread.dylib 0x000000023585d52c pthread_mutex_firstfit_lock_slow + 248 (pthread_mutex.c:1490)
3 AVFAudio 0x000000023733edfc AVAudioPlayerCpp::disposeQueue(bool) + 212 (AVAudioPlayerCpp.mm:161)
4 AVFAudio 0x000000023733f774 AVAudioPlayerCpp::prepareToPlayQueue() + 448 (AVAudioPlayerCpp.mm:888)
5 AVFAudio 0x000000023733f0ec AVAudioPlayerCpp::DoAction(unsigned int, unsigned long, void const*) + 300 (AVAudioPlayerCpp.mm:626)
6 AVFAudio 0x00000002372e7f0c -[AVAudioPlayer prepareToPlay] + 40 (AVAudioPlayer.mm:531)
7 CapacitorCommunityNativeAudio 0x0000000102fc9608 specialized AudioAsset.init(owner:withAssetId:withPath:withChannels:withVolume:withFadeDelay:) + 856 (AudioAsset.swift:39)
8 CapacitorCommunityNativeAudio 0x0000000102fcc800 closure #1 in NativeAudio.preloadAsset(:isComplex:) + 1528 (Plugin.swift:0)
9 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(:isComplex:) + 76 (
Thread 4 name:
Thread 4:
0 libsystem_kernel.dylib 0x00000001fbae4600 __psynch_mutexwait + 8 (:-1)
1 libsystem_pthread.dylib 0x00000002358563dc pthread_mutex_firstfit_lock_wait + 84 (pthread_mutex.c:1414)
2 libsystem_pthread.dylib 0x000000023585d52c pthread_mutex_firstfit_lock_slow + 248 (pthread_mutex.c:1490)
3 AVFAudio 0x000000023733edfc AVAudioPlayerCpp::disposeQueue(bool) + 212 (AVAudioPlayerCpp.mm:161)
4 AVFAudio 0x000000023733f774 AVAudioPlayerCpp::prepareToPlayQueue() + 448 (AVAudioPlayerCpp.mm:888)
5 AVFAudio 0x000000023733f0ec AVAudioPlayerCpp::DoAction(unsigned int, unsigned long, void const*) + 300 (AVAudioPlayerCpp.mm:626)
6 AVFAudio 0x00000002372e7f0c -[AVAudioPlayer prepareToPlay] + 40 (AVAudioPlayer.mm:531)
7 CapacitorCommunityNativeAudio 0x0000000102fc9608 specialized AudioAsset.init(owner:withAssetId:withPath:withChannels:withVolume:withFadeDelay:) + 856 (AudioAsset.swift:39)
8 CapacitorCommunityNativeAudio 0x0000000102fcc800 closure #1 in NativeAudio.preloadAsset(:isComplex:) + 1528 (Plugin.swift:0)
9 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(:isComplex:) + 76 (
Thread 5 name:
Thread 5:
0 libsystem_kernel.dylib 0x00000001fbae34a0 mach_msg_trap + 8 (:-1)
1 libsystem_kernel.dylib 0x00000001fbae3ae4 mach_msg + 76 (mach_msg.c:119)
2 AudioToolbox 0x00000001ced05d00 AudioQueueDispose + 544 (AudioQueueIPCUser.c:641)
3 AVFAudio 0x000000023733edf0 AVAudioPlayerCpp::disposeQueue(bool) + 200 (AVAudioPlayerCpp.mm:1706)
4 AVFAudio 0x000000023733f774 AVAudioPlayerCpp::prepareToPlayQueue() + 448 (AVAudioPlayerCpp.mm:888)
5 AVFAudio 0x000000023733f0ec AVAudioPlayerCpp::DoAction(unsigned int, unsigned long, void const*) + 300 (AVAudioPlayerCpp.mm:626)
6 AVFAudio 0x00000002372e7f0c -[AVAudioPlayer prepareToPlay] + 40 (AVAudioPlayer.mm:531)
7 CapacitorCommunityNativeAudio 0x0000000102fc9608 specialized AudioAsset.init(owner:withAssetId:withPath:withChannels:withVolume:withFadeDelay:) + 856 (AudioAsset.swift:39)
8 CapacitorCommunityNativeAudio 0x0000000102fcc800 closure #1 in NativeAudio.preloadAsset(:isComplex:) + 1528 (Plugin.swift:0)
9 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(:isComplex:) + 76 (
Thread 6 name: Thread 6: 0 libsystem_kernel.dylib 0x00000001fbae34a0 mach_msg_trap + 8 (:-1) 1 libsystem_kernel.dylib 0x00000001fbae3ae4 mach_msg + 76 (mach_msg.c:119) 2 CoreFoundation 0x00000001c3e5ad30 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646) 3 CoreFoundation 0x00000001c3e5f1bc __CFRunLoopRun + 1180 (CFRunLoop.c:3000) 4 CoreFoundation 0x00000001c3e72bc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268) 5 Foundation 0x00000001c5665444 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 236 (NSRunLoop.m:373) 6 Foundation 0x00000001c56a6e0c -[NSRunLoop(NSRunLoop) runUntilDate:] + 92 (NSRunLoop.m:420) 7 UIKitCore 0x00000001c6760cc4 -[UIEventFetcher threadMain] + 524 (UIEventFetcher.m:1167) 8 Foundation 0x00000001c56b541c NSThread__start + 808 (NSThread.m:972) 9 libsystem_pthread.dylib 0x00000002358559ac _pthread_start + 148 (pthread.c:891) 10 libsystem_pthread.dylib 0x0000000235854e68 thread_start + 8 (:-1)
Thread 7 name:
Thread 7:
0 libsystem_kernel.dylib 0x00000001fbae4600 __psynch_mutexwait + 8 (:-1)
1 libsystem_pthread.dylib 0x00000002358563dc pthread_mutex_firstfit_lock_wait + 84 (pthread_mutex.c:1414)
2 libsystem_pthread.dylib 0x000000023585d52c pthread_mutex_firstfit_lock_slow + 248 (pthread_mutex.c:1490)
3 AVFAudio 0x000000023733edfc AVAudioPlayerCpp::disposeQueue(bool) + 212 (AVAudioPlayerCpp.mm:161)
4 AVFAudio 0x000000023733f774 AVAudioPlayerCpp::prepareToPlayQueue() + 448 (AVAudioPlayerCpp.mm:888)
5 AVFAudio 0x000000023733f0ec AVAudioPlayerCpp::DoAction(unsigned int, unsigned long, void const*) + 300 (AVAudioPlayerCpp.mm:626)
6 AVFAudio 0x00000002372e7f0c -[AVAudioPlayer prepareToPlay] + 40 (AVAudioPlayer.mm:531)
7 CapacitorCommunityNativeAudio 0x0000000102fc9608 specialized AudioAsset.init(owner:withAssetId:withPath:withChannels:withVolume:withFadeDelay:) + 856 (AudioAsset.swift:39)
8 CapacitorCommunityNativeAudio 0x0000000102fcc800 closure #1 in NativeAudio.preloadAsset(:isComplex:) + 1528 (Plugin.swift:0)
9 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(:isComplex:) + 76 (
Thread 8 name:
Thread 8:
0 libsystem_kernel.dylib 0x00000001fbae4600 __psynch_mutexwait + 8 (:-1)
1 libsystem_pthread.dylib 0x00000002358563dc pthread_mutex_firstfit_lock_wait + 84 (pthread_mutex.c:1414)
2 libsystem_pthread.dylib 0x000000023585d52c pthread_mutex_firstfit_lock_slow + 248 (pthread_mutex.c:1490)
3 AVFAudio 0x000000023733edfc AVAudioPlayerCpp::disposeQueue(bool) + 212 (AVAudioPlayerCpp.mm:161)
4 AVFAudio 0x000000023733f774 AVAudioPlayerCpp::prepareToPlayQueue() + 448 (AVAudioPlayerCpp.mm:888)
5 AVFAudio 0x000000023733f0ec AVAudioPlayerCpp::DoAction(unsigned int, unsigned long, void const*) + 300 (AVAudioPlayerCpp.mm:626)
6 AVFAudio 0x00000002372e7f0c -[AVAudioPlayer prepareToPlay] + 40 (AVAudioPlayer.mm:531)
7 CapacitorCommunityNativeAudio 0x0000000102fc9608 specialized AudioAsset.init(owner:withAssetId:withPath:withChannels:withVolume:withFadeDelay:) + 856 (AudioAsset.swift:39)
8 CapacitorCommunityNativeAudio 0x0000000102fcc800 closure #1 in NativeAudio.preloadAsset(:isComplex:) + 1528 (Plugin.swift:0)
9 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(:isComplex:) + 76 (
Thread 9 name:
Thread 9:
0 libsystem_blocks.dylib 0x00000002357d171c Block_copy + 300 (runtime.cpp:58)
1 libsystem_blocks.dylib 0x00000002357d1850 -[NSMallocBlock retain] + 24 (data.m:56)
2 Capacitor 0x0000000102e804b8 0x102e5c000 + 148664
3 CapacitorCommunityNativeAudio 0x0000000102fcc8a4 closure #1 in NativeAudio.preloadAsset(:isComplex:) + 1692 (Plugin.swift:243)
4 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(_:isComplex:) + 76 (
Thread 10 name: Thread 10: 0 libobjc.A.dylib 0x00000001dcc0c1f8 objc_destructInstance + 148 (objc-object.h:552) 1 libobjc.A.dylib 0x00000001dcc0c1c4 objc_destructInstance + 96 (objc-runtime-new.mm:8232) 2 libsystem_blocks.dylib 0x00000002357d1814 _Block_release + 208 (runtime.cpp:330) 3 Capacitor 0x0000000102e64f24 -[CAPPluginCall .cxx_destruct] + 28 (CAPPluginCall.m:4) 4 libobjc.A.dylib 0x00000001dcc0f380 object_cxxDestructFromClass(objc_object*, objc_class*) + 116 (objc-class.mm:455) 5 libobjc.A.dylib 0x00000001dcc0c1b4 objc_destructInstance + 80 (objc-class.mm:469) 6 libobjc.A.dylib 0x00000001dcc15a00 _objc_rootDealloc + 80 (objc-runtime-new.mm:8250) 7 CapacitorCommunityNativeAudio 0x0000000102fcdd60 0x102fc4000 + 40288 8 libswiftCore.dylib 0x00000001c8cc1424 _swift_release_dealloc + 56 (HeapObject.cpp:703) 9 libsystem_blocks.dylib 0x00000002357d1804 _Block_release + 192 (runtime.cpp:176) 10 libdispatch.dylib 0x00000001c3b54a30 _dispatch_client_callout + 20 (object.m:560) 11 libdispatch.dylib 0x00000001c3b5c124 _dispatch_lane_serial_drain + 668 (inline_internal.h:2622) 12 libdispatch.dylib 0x00000001c3b5cc80 _dispatch_lane_invoke + 392 (queue.c:3944) 13 libdispatch.dylib 0x00000001c3b67500 _dispatch_workloop_worker_thread + 648 (queue.c:6732) 14 libsystem_pthread.dylib 0x00000002358550bc _pthread_wqthread + 288 (pthread.c:2599) 15 libsystem_pthread.dylib 0x0000000235854e5c start_wqthread + 8 (:-1)
Thread 11 name:
Thread 11:
0 libsystem_kernel.dylib 0x00000001fbae4600 __psynch_mutexwait + 8 (:-1)
1 libsystem_pthread.dylib 0x00000002358563dc pthread_mutex_firstfit_lock_wait + 84 (pthread_mutex.c:1414)
2 libsystem_pthread.dylib 0x000000023585d52c pthread_mutex_firstfit_lock_slow + 248 (pthread_mutex.c:1490)
3 AVFAudio 0x000000023733edfc AVAudioPlayerCpp::disposeQueue(bool) + 212 (AVAudioPlayerCpp.mm:161)
4 AVFAudio 0x000000023733f774 AVAudioPlayerCpp::prepareToPlayQueue() + 448 (AVAudioPlayerCpp.mm:888)
5 AVFAudio 0x000000023733f0ec AVAudioPlayerCpp::DoAction(unsigned int, unsigned long, void const*) + 300 (AVAudioPlayerCpp.mm:626)
6 AVFAudio 0x00000002372e7f0c -[AVAudioPlayer prepareToPlay] + 40 (AVAudioPlayer.mm:531)
7 CapacitorCommunityNativeAudio 0x0000000102fc9608 specialized AudioAsset.init(owner:withAssetId:withPath:withChannels:withVolume:withFadeDelay:) + 856 (AudioAsset.swift:39)
8 CapacitorCommunityNativeAudio 0x0000000102fcc800 closure #1 in NativeAudio.preloadAsset(:isComplex:) + 1528 (Plugin.swift:0)
9 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(:isComplex:) + 76 (
Thread 12 name: Thread 12: 0 libsystem_kernel.dylib 0x00000001fbae3f24 __psynch_cvwait + 8 (:-1) 1 libsystem_pthread.dylib 0x000000023585c298 _pthread_cond_wait + 1236 (pthread_cond.c:636) 2 JavaScriptCore 0x00000001cf1a2148 scavenger_thread_main + 1232 (pas_scavenger.c:135) 3 libsystem_pthread.dylib 0x00000002358559ac _pthread_start + 148 (pthread.c:891) 4 libsystem_pthread.dylib 0x0000000235854e68 thread_start + 8 (:-1)
Thread 13 name: Thread 13: 0 libsystem_kernel.dylib 0x00000001fbae34a0 mach_msg_trap + 8 (:-1) 1 libsystem_kernel.dylib 0x00000001fbae3ae4 mach_msg + 76 (mach_msg.c:119) 2 CoreFoundation 0x00000001c3e5ad30 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646) 3 CoreFoundation 0x00000001c3e5f1bc __CFRunLoopRun + 1180 (CFRunLoop.c:3000) 4 CoreFoundation 0x00000001c3e72bc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268) 5 CoreFoundation 0x00000001c3ef3da8 CFRunLoopRun + 64 (CFRunLoop.c:3293) 6 CoreMotion 0x00000001d1311a9c CLMotionCore::runMotionThread(void*) + 1208 (CLMotionCore.mm:370) 7 libsystem_pthread.dylib 0x00000002358559ac _pthread_start + 148 (pthread.c:891) 8 libsystem_pthread.dylib 0x0000000235854e68 thread_start + 8 (:-1)
Thread 14 name: Thread 14: 0 libsystem_kernel.dylib 0x00000001fbae34a0 mach_msg_trap + 8 (:-1) 1 libsystem_kernel.dylib 0x00000001fbae3ae4 mach_msg + 76 (mach_msg.c:119) 2 CoreFoundation 0x00000001c3e5ad30 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646) 3 CoreFoundation 0x00000001c3e5f1bc __CFRunLoopRun + 1180 (CFRunLoop.c:3000) 4 CoreFoundation 0x00000001c3e72bc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268) 5 AudioSession 0x00000001cd487f04 CADeprecated::GenericRunLoopThread::Entry(void*) + 164 (GenericRunLoopThread.h:95) 6 AudioSession 0x00000001cd4918f0 CADeprecated::CAPThread::Entry(CADeprecated::CAPThread*) + 92 (CAPThread.cpp:324) 7 libsystem_pthread.dylib 0x00000002358559ac _pthread_start + 148 (pthread.c:891) 8 libsystem_pthread.dylib 0x0000000235854e68 thread_start + 8 (:-1)
Thread 15 name: Thread 15: 0 libsystem_kernel.dylib 0x00000001fbae34a0 mach_msg_trap + 8 (:-1) 1 libsystem_kernel.dylib 0x00000001fbae3ae4 mach_msg + 76 (mach_msg.c:119) 2 CoreFoundation 0x00000001c3e5ad30 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646) 3 CoreFoundation 0x00000001c3e5f1bc __CFRunLoopRun + 1180 (CFRunLoop.c:3000) 4 CoreFoundation 0x00000001c3e72bc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268) 5 CFNetwork 0x00000001c48ef1dc +[__CFN_CoreSchedulingSetRunnable _run:] + 472 (CoreSchedulingSet.mm:1372) 6 Foundation 0x00000001c56b541c NSThread__start + 808 (NSThread.m:972) 7 libsystem_pthread.dylib 0x00000002358559ac _pthread_start + 148 (pthread.c:891) 8 libsystem_pthread.dylib 0x0000000235854e68 thread_start + 8 (:-1)
Thread 16 name:
Thread 16:
0 libsystem_kernel.dylib 0x00000001fbae4600 __psynch_mutexwait + 8 (:-1)
1 libsystem_pthread.dylib 0x00000002358563dc pthread_mutex_firstfit_lock_wait + 84 (pthread_mutex.c:1414)
2 libsystem_pthread.dylib 0x000000023585d52c pthread_mutex_firstfit_lock_slow + 248 (pthread_mutex.c:1490)
3 AVFAudio 0x000000023733edfc AVAudioPlayerCpp::disposeQueue(bool) + 212 (AVAudioPlayerCpp.mm:161)
4 AVFAudio 0x000000023733f774 AVAudioPlayerCpp::prepareToPlayQueue() + 448 (AVAudioPlayerCpp.mm:888)
5 AVFAudio 0x000000023733f0ec AVAudioPlayerCpp::DoAction(unsigned int, unsigned long, void const*) + 300 (AVAudioPlayerCpp.mm:626)
6 AVFAudio 0x00000002372e7f0c -[AVAudioPlayer prepareToPlay] + 40 (AVAudioPlayer.mm:531)
7 CapacitorCommunityNativeAudio 0x0000000102fc9608 specialized AudioAsset.init(owner:withAssetId:withPath:withChannels:withVolume:withFadeDelay:) + 856 (AudioAsset.swift:39)
8 CapacitorCommunityNativeAudio 0x0000000102fcc800 closure #1 in NativeAudio.preloadAsset(:isComplex:) + 1528 (Plugin.swift:0)
9 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(:isComplex:) + 76 (
Thread 17 name: Thread 17: 0 Capacitor 0x0000000102e6f7d0 0x102e5c000 + 79824 1 libswiftCore.dylib 0x00000001c8cc1424 _swift_release_dealloc + 56 (HeapObject.cpp:703) 2 Capacitor 0x0000000102e6fd24 0x102e5c000 + 81188 3 libswiftCore.dylib 0x00000001c8cc1424 _swift_release_dealloc + 56 (HeapObject.cpp:703) 4 libsystem_blocks.dylib 0x00000002357d1804 _Block_release + 192 (runtime.cpp:176) 5 Capacitor 0x0000000102e64f30 -[CAPPluginCall .cxx_destruct] + 40 (CAPPluginCall.m:4) 6 libobjc.A.dylib 0x00000001dcc0f380 object_cxxDestructFromClass(objc_object*, objc_class*) + 116 (objc-class.mm:455) 7 libobjc.A.dylib 0x00000001dcc0c1b4 objc_destructInstance + 80 (objc-class.mm:469) 8 libobjc.A.dylib 0x00000001dcc15a00 _objc_rootDealloc + 80 (objc-runtime-new.mm:8250) 9 CapacitorCommunityNativeAudio 0x0000000102fcdd60 0x102fc4000 + 40288 10 libswiftCore.dylib 0x00000001c8cc1424 _swift_release_dealloc + 56 (HeapObject.cpp:703) 11 libsystem_blocks.dylib 0x00000002357d1804 _Block_release + 192 (runtime.cpp:176) 12 libdispatch.dylib 0x00000001c3b54a30 _dispatch_client_callout + 20 (object.m:560) 13 libdispatch.dylib 0x00000001c3b5c124 _dispatch_lane_serial_drain + 668 (inline_internal.h:2622) 14 libdispatch.dylib 0x00000001c3b5cc80 _dispatch_lane_invoke + 392 (queue.c:3944) 15 libdispatch.dylib 0x00000001c3b67500 _dispatch_workloop_worker_thread + 648 (queue.c:6732) 16 libsystem_pthread.dylib 0x00000002358550bc _pthread_wqthread + 288 (pthread.c:2599) 17 libsystem_pthread.dylib 0x0000000235854e5c start_wqthread + 8 (:-1)
Thread 18 name:
Thread 18:
0 libsystem_kernel.dylib 0x00000001fbae4600 __psynch_mutexwait + 8 (:-1)
1 libsystem_pthread.dylib 0x00000002358563dc pthread_mutex_firstfit_lock_wait + 84 (pthread_mutex.c:1414)
2 libsystem_pthread.dylib 0x000000023585d52c pthread_mutex_firstfit_lock_slow + 248 (pthread_mutex.c:1490)
3 AVFAudio 0x000000023733edfc AVAudioPlayerCpp::disposeQueue(bool) + 212 (AVAudioPlayerCpp.mm:161)
4 AVFAudio 0x000000023733f774 AVAudioPlayerCpp::prepareToPlayQueue() + 448 (AVAudioPlayerCpp.mm:888)
5 AVFAudio 0x000000023733f0ec AVAudioPlayerCpp::DoAction(unsigned int, unsigned long, void const*) + 300 (AVAudioPlayerCpp.mm:626)
6 AVFAudio 0x00000002372e7f0c -[AVAudioPlayer prepareToPlay] + 40 (AVAudioPlayer.mm:531)
7 CapacitorCommunityNativeAudio 0x0000000102fc9608 specialized AudioAsset.init(owner:withAssetId:withPath:withChannels:withVolume:withFadeDelay:) + 856 (AudioAsset.swift:39)
8 CapacitorCommunityNativeAudio 0x0000000102fcc800 closure #1 in NativeAudio.preloadAsset(:isComplex:) + 1528 (Plugin.swift:0)
9 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(:isComplex:) + 76 (
Thread 19 name:
Thread 19:
0 libsystem_kernel.dylib 0x00000001fbae4600 __psynch_mutexwait + 8 (:-1)
1 libsystem_pthread.dylib 0x00000002358563dc pthread_mutex_firstfit_lock_wait + 84 (pthread_mutex.c:1414)
2 libsystem_pthread.dylib 0x000000023585d52c pthread_mutex_firstfit_lock_slow + 248 (pthread_mutex.c:1490)
3 AVFAudio 0x000000023733edfc AVAudioPlayerCpp::disposeQueue(bool) + 212 (AVAudioPlayerCpp.mm:161)
4 AVFAudio 0x000000023733f774 AVAudioPlayerCpp::prepareToPlayQueue() + 448 (AVAudioPlayerCpp.mm:888)
5 AVFAudio 0x000000023733f0ec AVAudioPlayerCpp::DoAction(unsigned int, unsigned long, void const*) + 300 (AVAudioPlayerCpp.mm:626)
6 AVFAudio 0x00000002372e7f0c -[AVAudioPlayer prepareToPlay] + 40 (AVAudioPlayer.mm:531)
7 CapacitorCommunityNativeAudio 0x0000000102fc9608 specialized AudioAsset.init(owner:withAssetId:withPath:withChannels:withVolume:withFadeDelay:) + 856 (AudioAsset.swift:39)
8 CapacitorCommunityNativeAudio 0x0000000102fcc800 closure #1 in NativeAudio.preloadAsset(:isComplex:) + 1528 (Plugin.swift:0)
9 CapacitorCommunityNativeAudio 0x0000000102fcddf0 partial apply for closure #1 in NativeAudio.preloadAsset(:isComplex:) + 76 (
Thread 20: 0 libsystem_pthread.dylib 0x0000000235854e54 start_wqthread + 0 (:-1)
Thread 21 name: Thread 21: 0 libsystem_kernel.dylib 0x00000001fbae34a0 mach_msg_trap + 8 (:-1) 1 libsystem_kernel.dylib 0x00000001fbae3ae4 mach_msg + 76 (mach_msg.c:119) 2 CoreFoundation 0x00000001c3e5ad30 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646) 3 CoreFoundation 0x00000001c3e5f1bc __CFRunLoopRun + 1180 (CFRunLoop.c:3000) 4 CoreFoundation 0x00000001c3e72bc8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268) 5 AudioToolbox 0x00000001ced05568 CADeprecated::GenericRunLoopThread::Entry(void*) + 164 (GenericRunLoopThread.h:95) 6 libAudioToolboxUtility.dylib 0x00000001dd5dd078 CADeprecated::CAPThread::Entry(CADeprecated::CAPThread*) + 92 (CAPThread.cpp:324) 7 libsystem_pthread.dylib 0x00000002358559ac _pthread_start + 148 (pthread.c:891) 8 libsystem_pthread.dylib 0x0000000235854e68 thread_start + 8 (:-1)
Thread 22: 0 libsystem_pthread.dylib 0x0000000235854e54 start_wqthread + 0 (:-1)
Thread 23: 0 libsystem_pthread.dylib 0x0000000235854e54 start_wqthread + 0 (:-1)
Thread 24: 0 libsystem_pthread.dylib 0x0000000235854e54 start_wqthread + 0 (:-1)
Thread 1 crashed with ARM Thread State (64-bit): x0: 0x8000000000000000 x1: 0xc00000000000000d x2: 0x4000000283ce4840 x3: 0x000000021e7955b0 x4: 0x0000000000000021 x5: 0x0000000102d0e410 x6: 0x0000000283bfd9a0 x7: 0x0000000000000720 x8: 0x0000000000000000 x9: 0x00000001c8cd8d1c x10: 0x000000050000078c x11: 0x0000000283ce4848 x12: 0x000000040000078c x13: 0x000000011603bab0 x14: 0x0000000001800000 x15: 0x000000021d6a8450 x16: 0x00000001c8d01d08 x17: 0xa0d100021e795588 x18: 0x0000000000000000 x19: 0x0000000281fe4b30 x20: 0x000000016d4b26c0 x21: 0x4000000283ce4840 x22: 0xc00000000000000d x23: 0x4000000283ce4840 x24: 0xc00000000000000d x25: 0x0000000281fe4af0 x26: 0x98165d60ade83fb8 x27: 0x98165d60ade83fb8 x28: 0x00000002832ccf00 fp: 0x000000016d4b26b0 lr: 0x0000000102fcd1d0 sp: 0x000000016d4b2630 pc: 0x00000001c8d01d08 cpsr: 0x20001400 esr: 0x92000006 (Data Abort) byte read Translation fault
Binary Images:
0x1029d4000 - 0x102b2ffff App arm64 <2bd4240d9e2e358896152ea40bd57f3a> /private/var/containers/Bundle/Application/F1F6F711-8FBB-405D-BEA6-08A160A1F3AD/App.app/App
0x102cb4000 - 0x102d0bfff dyld arm64e <66e1fb2668f8379ba052eb8b8291b5e1> /usr/lib/dyld
0x102e5c000 - 0x102eabfff Capacitor arm64 <092ea80615b13722ab9f0db28c0a56c8> /private/var/containers/Bundle/Application/F1F6F711-8FBB-405D-BEA6-08A160A1F3AD/App.app/Frameworks/Capacitor.framework/Capacitor
0x102fc4000 - 0x102fcffff CapacitorCommunityNativeAudio arm64 <1e709ef024f93939ac47d9d458241bc2> /private/var/containers/Bundle/Application/F1F6F711-8FBB-405D-BEA6-08A160A1F3AD/App.app/Frameworks/CapacitorCommunityNativeAudio.framework/CapacitorCommunityNativeAudio
0x1c3b51000 - 0x1c3b96fff libdispatch.dylib arm64e
EOF `
Seems to be happening also with plugin v.4.0.0.-0 :(
Same issue here!
can you try https://github.com/Cap-go/native-audio and tell me if that fix ?
Same issue happening for me.
can you try https://github.com/Cap-go/native-audio and tell me if that fix ?
@riderx - I tried with your fork version 6.0.18 and get the same issue.
same issue
Hi,
We're experiencing the same issue. The stack trace is similar, although we're not sure if it occurs specifically when the app is in the background.
Are there any updates on this? @bazuka5801
In the meantime, here are two suggestions to potentially resolve the issue (in the preloadAsset function):
Ensure Thread Safety: Use a serial queue or synchronization mechanism (e.g., DispatchQueue.sync, NSLock, or @synchronized) when accessing and modifying audioList to prevent race conditions:
DispatchQueue.main.sync {
self.audioList[audioId] = NSNumber(value: Int32(soundId))
}
- Avoid Force Unwrapping: Replace force unwraps with optional binding to prevent crashes:
if let url = URL(string: assetPath) {
basePath = url.path
} else {
call.reject("Invalid URL: \(assetPath)")
return
}
if let soundFileUrl = CFBridgingRetain(pathUrl) as? CFURL {
AudioServicesCreateSystemSoundID(soundFileUrl, &soundId)
} else {
call.reject("Failed to create sound file URL")
return
}
Thanks!