Azure/azure-sdk-for-ios

[BUG] Crash 'ACSException' -> 'Unknown error: RequestCorrelationVector: . ResponseCorrelationVector' when creating a video stream view

Closed this issue · 5 comments

Describe the bug
Our app crashes on a new exception we have since upgrading from 2.3.0 to 2.8.0 of the ACS Calling iOS SDK. Our code has a do-catch block around the try newRenderer.createView(withOptions: CreateViewOptions(scalingMode: scalingMode)) code, however catching an NSException (which the ACSException is) is impossible within Swift code. So the app crashes.

Exception or Stack Trace
Firebase exception description:

Fatal Exception: ACSException
Failed (1). Unknown error. RequestCorrelationVector: . ResponseCorrelationVector:
Exception trace
Incident Identifier: 321A30AB-05F7-4829-91F6-0993429A21CE
Hardware Model:      iPhone11,2
Process:             AppName [18615]
Path:                /private/var/containers/Bundle/Application/C2638B2B-B8D4-4C44-9EE4-DF16BCC5ADCA/AppName.app/AppName
Identifier:          nl.AppName.chat
Version:             4.24.0 (5750)
AppStoreTools:       15E204
AppVariant:          1:iPhone11,2:15
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           nl.AppName.chat [1384]

Date/Time:           2024-04-18 14:02:51.6186 +0200
Launch Time:         2024-04-18 13:42:32.1824 +0200
OS Version:          iPhone OS 16.1.1 (20B101)
Release Type:        User
Baseband Version:    5.01.01
Report Version:      104

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

Last Exception Backtrace:
0   CoreFoundation                	0x193375e88 __exceptionPreprocess + 164 (NSException.m:202)
1   libobjc.A.dylib               	0x18c6af8d8 objc_exception_throw + 60 (objc-exception.mm:356)
2   CoreFoundation                	0x193465c58 +[NSException raise:format:] + 112 (NSException.m:0)
3   AzureCommunicationCalling     	0x10738b5bc check_status + 360
4   AzureCommunicationCalling     	0x1073df520 -[ACSRemoteVideoStreamRenderer startPreviewWithOptions:withError:] + 228
5   AzureCommunicationCalling     	0x1073e0360 -[ACSVideoStreamRenderer createViewWithOptions:withError:] + 280
6   AppName                 	0x104f74edc ParticipantView.updateRendering(newRenderer:scalingMode:) + 312 (ParticipantView.swift:153)
7   AppName                 	0x104f747c8 closure #1 in ParticipantView.updateVideoStream(remoteVideoStream:) + 1784 (ParticipantView.swift:105)
8   AppName                 	0x104f7ff40 thunk for @escaping @callee_guaranteed () -> () + 28 (<compiler-generated>:0)
9   libdispatch.dylib             	0x19a9444b4 _dispatch_call_block_and_release + 32 (init.c:1518)
10  libdispatch.dylib             	0x19a945fdc _dispatch_client_callout + 20 (object.m:560)
11  libdispatch.dylib             	0x19a9547f4 _dispatch_main_queue_drain + 928 (inline_internal.h:2632)
12  libdispatch.dylib             	0x19a954444 _dispatch_main_queue_callback_4CF + 44 (queue.c:7887)
13  CoreFoundation                	0x1934066f8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CFRunLoop.c:1780)
14  CoreFoundation                	0x1933e8058 __CFRunLoopRun + 2036 (CFRunLoop.c:3147)
15  CoreFoundation                	0x1933eced4 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418)
16  GraphicsServices              	0x1cc6ea368 GSEventRunModal + 164 (GSEvent.c:2196)
17  UIKitCore                     	0x1958cb3d0 -[UIApplication _run] + 888 (UIApplication.m:3745)
18  UIKitCore                     	0x1958cb034 UIApplicationMain + 340 (UIApplication.m:5335)
19  AppName                 	0x104eeb6e4 main + 60 (AppDelegate.swift:20)
20  dyld                          	0x1b1a54960 start + 2528 (dyldMain.cpp:1170)

Thread 0 name:
Thread 0 Crashed:
0   libsystem_kernel.dylib        	0x00000001cff70200 __pthread_kill + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001e03d21ac pthread_kill + 268 (pthread.c:1670)
2   libsystem_c.dylib             	0x000000019aa013e4 __abort + 128 (abort.c:155)
3   libsystem_c.dylib             	0x000000019a9a9c98 abort + 192 (abort.c:126)
4   libc++abi.dylib               	0x00000001e0312b8c abort_message + 132 (abort_message.cpp:78)
5   libc++abi.dylib               	0x00000001e0302a80 demangling_terminate_handler() + 336 (cxa_default_handlers.cpp:71)
6   libobjc.A.dylib               	0x000000018c6b5d3c _objc_terminate() + 144 (objc-exception.mm:498)
7   AppName                 	0x0000000105260bec FIRCLSTerminateHandler() + 340 (FIRCLSException.mm:452)
8   libc++abi.dylib               	0x00000001e0311f28 std::__terminate(void (*)()) + 20 (cxa_handlers.cpp:59)
9   libc++abi.dylib               	0x00000001e0311ec4 std::terminate() + 56 (cxa_handlers.cpp:88)
10  libdispatch.dylib             	0x000000019a945ff0 _dispatch_client_callout + 40 (object.m:563)
11  libdispatch.dylib             	0x000000019a9547f4 _dispatch_main_queue_drain + 928 (inline_internal.h:2632)
12  libdispatch.dylib             	0x000000019a954444 _dispatch_main_queue_callback_4CF + 44 (queue.c:7887)
13  CoreFoundation                	0x00000001934066f8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CFRunLoop.c:1780)
14  CoreFoundation                	0x00000001933e8058 __CFRunLoopRun + 2036 (CFRunLoop.c:3147)
15  CoreFoundation                	0x00000001933eced4 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418)
16  GraphicsServices              	0x00000001cc6ea368 GSEventRunModal + 164 (GSEvent.c:2196)
17  UIKitCore                     	0x00000001958cb3d0 -[UIApplication _run] + 888 (UIApplication.m:3745)
18  UIKitCore                     	0x00000001958cb034 UIApplicationMain + 340 (UIApplication.m:5335)
19  AppName                 	0x0000000104eeb6e4 main + 60 (AppDelegate.swift:20)
20  dyld                          	0x00000001b1a54960 start + 2528 (dyldMain.cpp:1170)

Thread 1 name:
Thread 1:
0   libsystem_kernel.dylib        	0x00000001cff69b48 mach_msg2_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001cff7c008 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001cff7c248 mach_msg_overwrite + 388 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001cff6a08c mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                	0x00000001933e6af0 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2622)
5   CoreFoundation                	0x00000001933e7d34 __CFRunLoopRun + 1232 (CFRunLoop.c:3005)
6   CoreFoundation                	0x00000001933eced4 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418)
7   Foundation                    	0x000000018d79a334 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212 (NSRunLoop.m:373)
8   Foundation                    	0x000000018d79a21c -[NSRunLoop(NSRunLoop) runUntilDate:] + 64 (NSRunLoop.m:420)
9   UIKitCore                     	0x0000000195a0033c -[UIEventFetcher threadMain] + 436 (UIEventFetcher.m:1377)
10  Foundation                    	0x000000018d7b3808 __NSThread__start__ + 716 (NSThread.m:963)
11  libsystem_pthread.dylib       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
12  libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 2 name:
Thread 2:
0   libsystem_kernel.dylib        	0x00000001cff69b48 mach_msg2_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001cff7c008 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001cff7c248 mach_msg_overwrite + 388 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001cff6a08c mach_msg + 24 (mach_msg.c:323)
4   AppName                 	0x0000000105262730 FIRCLSMachExceptionReadMessage + 56 (FIRCLSMachException.c:192)
5   AppName                 	0x0000000105262730 FIRCLSMachExceptionServer + 104 (FIRCLSMachException.c:168)
6   libsystem_pthread.dylib       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
7   libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 3 name:
Thread 3:
0   libsystem_kernel.dylib        	0x00000001cff69b48 mach_msg2_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001cff7c008 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001cff7c248 mach_msg_overwrite + 388 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001cff6a08c mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                	0x00000001933e6af0 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2622)
5   CoreFoundation                	0x00000001933e7d34 __CFRunLoopRun + 1232 (CFRunLoop.c:3005)
6   CoreFoundation                	0x00000001933eced4 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418)
7   CFNetwork                     	0x00000001947445a8 +[__CFN_CoreSchedulingSetRunnable _run:] + 392 (CoreSchedulingSet.mm:1372)
8   Foundation                    	0x000000018d7b3808 __NSThread__start__ + 716 (NSThread.m:963)
9   libsystem_pthread.dylib       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
10  libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 4 name:
Thread 4:
0   libsystem_kernel.dylib        	0x00000001cff69b48 mach_msg2_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001cff7c008 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001cff7c248 mach_msg_overwrite + 388 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001cff6a08c mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                	0x00000001933e6af0 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2622)
5   CoreFoundation                	0x00000001933e7d34 __CFRunLoopRun + 1232 (CFRunLoop.c:3005)
6   CoreFoundation                	0x00000001933eced4 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418)
7   CFNetwork                     	0x00000001947445a8 +[__CFN_CoreSchedulingSetRunnable _run:] + 392 (CoreSchedulingSet.mm:1372)
8   Foundation                    	0x000000018d7b3808 __NSThread__start__ + 716 (NSThread.m:963)
9   libsystem_pthread.dylib       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
10  libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 5 name:
Thread 5:
0   libsystem_kernel.dylib        	0x00000001cff69b48 mach_msg2_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001cff7c008 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001cff7c248 mach_msg_overwrite + 388 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001cff6a08c mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                	0x00000001933e6af0 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2622)
5   CoreFoundation                	0x00000001933e7d34 __CFRunLoopRun + 1232 (CFRunLoop.c:3005)
6   CoreFoundation                	0x00000001933eced4 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418)
7   WebCore                       	0x00000001a414ebe8 RunWebThread(void*) + 756 (WebCoreThread.mm:682)
8   libsystem_pthread.dylib       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
9   libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 6:
0   libsystem_kernel.dylib        	0x00000001cff69ac4 semaphore_wait_trap + 8 (:-1)
1   libdispatch.dylib             	0x000000019a946578 _dispatch_sema4_wait + 28 (lock.c:139)
2   libdispatch.dylib             	0x000000019a946c2c _dispatch_semaphore_wait_slow + 132 (semaphore.c:132)
3   AzureCommunicationCalling     	0x0000000107081e98 spl::semaWait(spl::EventGCD*&) + 24
4   AzureCommunicationCalling     	0x00000001070fd458 auf::tpManagerThreadTrampoline(SplOpaqueUpperLayerThread*) + 68
5   AzureCommunicationCalling     	0x00000001070875a8 spl::threadPosixEntry(void*) + 280
6   libsystem_pthread.dylib       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
7   libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 7:
0   libsystem_kernel.dylib        	0x00000001cff69ac4 semaphore_wait_trap + 8 (:-1)
1   libdispatch.dylib             	0x000000019a946578 _dispatch_sema4_wait + 28 (lock.c:139)
2   libdispatch.dylib             	0x000000019a946c2c _dispatch_semaphore_wait_slow + 132 (semaphore.c:132)
3   AzureCommunicationCalling     	0x0000000107081c6c spl::eventWait(spl::EventGCD*&, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000l>>) + 80
4   AzureCommunicationCalling     	0x00000001070f970c SplOpaqueUpperLayerThread::wait(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000l>>) + 44
5   AzureCommunicationCalling     	0x00000001070a0d40 auf::Dispatcher::runLoopCore(bool, auf::IDispatcher*) + 356
6   AzureCommunicationCalling     	0x00000001070a1320 auf::Dispatcher::runUntilQuit(bool, auf::IDispatcher*) + 96
7   AzureCommunicationCalling     	0x00000001070b9b8c auf::AsyncTraceThread::dispatchLoop(bool) + 232
8   AzureCommunicationCalling     	0x00000001070f937c SplOpaqueUpperLayerThread::run() + 152
9   AzureCommunicationCalling     	0x0000000107105830 auf::priv::MRMWTransport::dispatch(void*, auf::IDispatcher*) + 108
10  AzureCommunicationCalling     	0x00000001070fceac auf::ThreadPoolExecutorImp::workLoop(auf::Worker*, SplOpaqueUpperLayerThread*) + 600
11  AzureCommunicationCalling     	0x00000001070fcc20 auf::tpImpThreadTrampoline(SplOpaqueUpperLayerThread*) + 56
12  AzureCommunicationCalling     	0x00000001070875a8 spl::threadPosixEntry(void*) + 280
13  libsystem_pthread.dylib       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
14  libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 8:
0   libsystem_kernel.dylib        	0x00000001cff69adc semaphore_timedwait_trap + 8 (:-1)
1   libdispatch.dylib             	0x000000019a9465f4 _dispatch_sema4_timedwait + 64 (lock.c:154)
2   libdispatch.dylib             	0x000000019a946bf4 _dispatch_semaphore_wait_slow + 76 (semaphore.c:116)
3   AzureCommunicationCalling     	0x0000000107081cac spl::eventWait(spl::EventGCD*&, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000l>>) + 144
4   AzureCommunicationCalling     	0x0000000106bc2fc0 callback::SleepCounter::GoSleep(unsigned int) + 204
5   AzureCommunicationCalling     	0x0000000106bbb940 callback::manager::GoSleep() + 132
6   AzureCommunicationCalling     	0x0000000106bb3f08 Backbone::Run() + 364
7   AzureCommunicationCalling     	0x00000001070f937c SplOpaqueUpperLayerThread::run() + 152
8   AzureCommunicationCalling     	0x0000000107105830 auf::priv::MRMWTransport::dispatch(void*, auf::IDispatcher*) + 108
9   AzureCommunicationCalling     	0x00000001070fceac auf::ThreadPoolExecutorImp::workLoop(auf::Worker*, SplOpaqueUpperLayerThread*) + 600
10  AzureCommunicationCalling     	0x00000001070fcc20 auf::tpImpThreadTrampoline(SplOpaqueUpperLayerThread*) + 56
11  AzureCommunicationCalling     	0x00000001070875a8 spl::threadPosixEntry(void*) + 280
12  libsystem_pthread.dylib       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
13  libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 9:
0   libsystem_kernel.dylib        	0x00000001cff6b480 kevent + 8 (:-1)
1   AzureCommunicationCalling     	0x00000001071076bc apal::ReactorImp::eventLoop(rt::IntrusivePtr<apal::ReactorImp> const&) + 628
2   AzureCommunicationCalling     	0x00000001070f937c SplOpaqueUpperLayerThread::run() + 152
3   AzureCommunicationCalling     	0x0000000107105830 auf::priv::MRMWTransport::dispatch(void*, auf::IDispatcher*) + 108
4   AzureCommunicationCalling     	0x00000001070fceac auf::ThreadPoolExecutorImp::workLoop(auf::Worker*, SplOpaqueUpperLayerThread*) + 600
5   AzureCommunicationCalling     	0x00000001070fcc20 auf::tpImpThreadTrampoline(SplOpaqueUpperLayerThread*) + 56
6   AzureCommunicationCalling     	0x00000001070875a8 spl::threadPosixEntry(void*) + 280
7   libsystem_pthread.dylib       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
8   libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 10:
0   libsystem_kernel.dylib        	0x00000001cff69adc semaphore_timedwait_trap + 8 (:-1)
1   libdispatch.dylib             	0x000000019a9465f4 _dispatch_sema4_timedwait + 64 (lock.c:154)
2   libdispatch.dylib             	0x000000019a946bf4 _dispatch_semaphore_wait_slow + 76 (semaphore.c:116)
3   AzureCommunicationCalling     	0x0000000107081e6c spl::semaWait(spl::EventGCD*&, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000l>>) + 92
4   AzureCommunicationCalling     	0x0000000107101428 auf::TimerHandler::timerWorkLoop() + 164
5   AzureCommunicationCalling     	0x00000001070f937c SplOpaqueUpperLayerThread::run() + 152
6   AzureCommunicationCalling     	0x0000000107105830 auf::priv::MRMWTransport::dispatch(void*, auf::IDispatcher*) + 108
7   AzureCommunicationCalling     	0x00000001070fceac auf::ThreadPoolExecutorImp::workLoop(auf::Worker*, SplOpaqueUpperLayerThread*) + 600
8   AzureCommunicationCalling     	0x00000001070fcc20 auf::tpImpThreadTrampoline(SplOpaqueUpperLayerThread*) + 56
9   AzureCommunicationCalling     	0x00000001070875a8 spl::threadPosixEntry(void*) + 280
10  libsystem_pthread.dylib       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
11  libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 11:
0   libsystem_kernel.dylib        	0x00000001cff6a41c __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001e03d306c _pthread_cond_wait + 1232 (pthread_cond.c:636)
2   AzureCommunicationCalling     	0x0000000105d55f64 RtcPalThreadWaitContext::WaitAny(unsigned int, RtcPalSemaphore* const*, unsigned int) + 348
3   AzureCommunicationCalling     	0x0000000105d55cc8 RtcPalWaitForSingleObject + 68
4   AzureCommunicationCalling     	0x000000010695307c CMMTaskDispatcher::DispatcherThreadFunc() + 172
5   AzureCommunicationCalling     	0x0000000106953474 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, CMMTaskDispatcher::Initialize()::$_0>>(void*) + 44
6   libsystem_pthread.dylib       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
7   libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 12:
0   libsystem_kernel.dylib        	0x00000001cff6a41c __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001e03d306c _pthread_cond_wait + 1232 (pthread_cond.c:636)
2   AzureCommunicationCalling     	0x0000000105d55f64 RtcPalThreadWaitContext::WaitAny(unsigned int, RtcPalSemaphore* const*, unsigned int) + 348
3   AzureCommunicationCalling     	0x0000000105d55cc8 RtcPalWaitForSingleObject + 68
4   AzureCommunicationCalling     	0x000000010695307c CMMTaskDispatcher::DispatcherThreadFunc() + 172
5   AzureCommunicationCalling     	0x0000000106953474 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, CMMTaskDispatcher::Initialize()::$_0>>(void*) + 44
6   libsystem_pthread.dylib       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
7   libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 13:
0   libsystem_kernel.dylib        	0x00000001cff6a41c __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001e03d306c _pthread_cond_wait + 1232 (pthread_cond.c:636)
2   AzureCommunicationCalling     	0x0000000105d55f64 RtcPalThreadWaitContext::WaitAny(unsigned int, RtcPalSemaphore* const*, unsigned int) + 348
3   AzureCommunicationCalling     	0x0000000105d55cc8 RtcPalWaitForSingleObject + 68
4   AzureCommunicationCalling     	0x0000000106863024 MMGetMessage + 208
5   AzureCommunicationCalling     	0x000000010691386c CMediaPlatformImpl::MessagePumpFunc() + 160
6   AzureCommunicationCalling     	0x00000001069137c0 CMediaPlatformImpl::MessagePumpThreadProc(void*) + 12
7   AzureCommunicationCalling     	0x0000000105d5582c RtcPalThread::ThreadFunc(void*) + 60
8   libsystem_pthread.dylib       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
9   libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 14:
0   libsystem_kernel.dylib        	0x00000001cff6b480 kevent + 8 (:-1)
1   AzureCommunicationCalling     	0x0000000105d5a108 RtcPalIOCP::ProcessIO(_LIST_ENTRY*) + 164
2   AzureCommunicationCalling     	0x0000000105d59bb4 RtcPalIOCP::GetQueuedCompletionStatus(RtcPalOverlappedEntry*, unsigned int, unsigned int*) + 160
3   AzureCommunicationCalling     	0x00000001066ce96c CTransportManagerImpl::TransportWorkerThread(CTransportManagerImpl*, RtcPalIOCP*) + 244
4   AzureCommunicationCalling     	0x00000001066ce5ec CTransportManagerImpl::TransportWorkerThreadProc(void*) + 192
5   AzureCommunicationCalling     	0x0000000105d5582c RtcPalThread::ThreadFunc(void*) + 60
6   libsystem_pthread.dylib       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
7   libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 15:
0   libsystem_kernel.dylib        	0x00000001cff6a41c __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001e03d306c _pthread_cond_wait + 1232 (pthread_cond.c:636)
2   AzureCommunicationCalling     	0x0000000105d549fc RTCPAL_TASK_QUEUE::Dequeue(RTCPAL_TASK_QUEUE_ITEM*, unsigned int, unsigned int*, unsigned int) + 548
3   AzureCommunicationCalling     	0x00000001060beef4 CSlimStreamingEngineImpl::EngineWorkerThread(CSlimStreamingEngineImpl*) + 192
4   AzureCommunicationCalling     	0x00000001060be320 CSlimStreamingEngineImpl::EngineWorkerThreadProc(void*) + 12
5   AzureCommunicationCalling     	0x0000000105d5582c RtcPalThread::ThreadFunc(void*) + 60
6   libsystem_pthread.dylib       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
7   libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 16:
0   libsystem_kernel.dylib        	0x00000001cff6a41c __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001e03d306c _pthread_cond_wait + 1232 (pthread_cond.c:636)
2   AzureCommunicationCalling     	0x0000000105d55f64 RtcPalThreadWaitContext::WaitAny(unsigned int, RtcPalSemaphore* const*, unsigned int) + 348
3   AzureCommunicationCalling     	0x0000000105d561cc RtcPalWaitForAnyObject + 76
4   AzureCommunicationCalling     	0x00000001060be420 CSlimStreamingEngineImpl::TimerThreadProc(void*) + 244
5   AzureCommunicationCalling     	0x0000000105d5582c RtcPalThread::ThreadFunc(void*) + 60
6   libsystem_pthread.dylib       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
7   libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 17:
0   libsystem_kernel.dylib        	0x00000001cff6a41c __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001e03d306c _pthread_cond_wait + 1232 (pthread_cond.c:636)
2   AzureCommunicationCalling     	0x0000000105d55f64 RtcPalThreadWaitContext::WaitAny(unsigned int, RtcPalSemaphore* const*, unsigned int) + 348
3   AzureCommunicationCalling     	0x0000000105d55cc8 RtcPalWaitForSingleObject + 68
4   AzureCommunicationCalling     	0x00000001067d8478 RtpEventHandlerThread::EventHandlerThreadProc(void*) + 140
5   AzureCommunicationCalling     	0x0000000105d5582c RtcPalThread::ThreadFunc(void*) + 60
6   libsystem_pthread.dylib       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
7   libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 18:
0   libsystem_pthread.dylib       	0x00000001e03cbb90 start_wqthread + 0 (:-1)

Thread 19:
0   libsystem_pthread.dylib       	0x00000001e03cbb90 start_wqthread + 0 (:-1)

Thread 20:
0   libsystem_kernel.dylib        	0x00000001cff6a41c __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001e03d306c _pthread_cond_wait + 1232 (pthread_cond.c:636)
2   AzureCommunicationCalling     	0x0000000105d5605c RtcPalThreadWaitContext::WaitAny(unsigned int, RtcPalSemaphore* const*, unsigned int) + 596
3   AzureCommunicationCalling     	0x0000000105d55cc8 RtcPalWaitForSingleObject + 68
4   AzureCommunicationCalling     	0x0000000106862bd8 CMMMsgTimer::ThreadFunction() + 476
5   AzureCommunicationCalling     	0x0000000106862958 MMMsgTimerThreadFunction(void*) + 12
6   AzureCommunicationCalling     	0x0000000105d5582c RtcPalThread::ThreadFunc(void*) + 60
7   libsystem_pthread.dylib       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
8   libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 21:
0   libsystem_kernel.dylib        	0x00000001cff69ac4 semaphore_wait_trap + 8 (:-1)
1   libdispatch.dylib             	0x000000019a946578 _dispatch_sema4_wait + 28 (lock.c:139)
2   libdispatch.dylib             	0x000000019a946c2c _dispatch_semaphore_wait_slow + 132 (semaphore.c:132)
3   AzureCommunicationCalling     	0x0000000107081d20 spl::eventWait(spl::EventGCD*&) + 44
4   AzureCommunicationCalling     	0x00000001070fe024 auf::SingleThreadExecutorImp::dispatchCallsUntilDone(bool*) + 464
5   AzureCommunicationCalling     	0x00000001070fe1b0 auf::sttptThreadTrampoline(SplOpaqueUpperLayerThread*) + 44
6   AzureCommunicationCalling     	0x00000001070875a8 spl::threadPosixEntry(void*) + 280
7   libsystem_pthread.dylib       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
8   libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 22:
0   libsystem_kernel.dylib        	0x00000001cff69adc semaphore_timedwait_trap + 8 (:-1)
1   libdispatch.dylib             	0x000000019a9465f4 _dispatch_sema4_timedwait + 64 (lock.c:154)
2   libdispatch.dylib             	0x000000019a946bf4 _dispatch_semaphore_wait_slow + 76 (semaphore.c:116)
3   AzureCommunicationCalling     	0x0000000107081cac spl::eventWait(spl::EventGCD*&, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000l>>) + 144
4   AzureCommunicationCalling     	0x00000001070fcf60 auf::ThreadPoolExecutorImp::workLoop(auf::Worker*, SplOpaqueUpperLayerThread*) + 780
5   AzureCommunicationCalling     	0x00000001070fcc20 auf::tpImpThreadTrampoline(SplOpaqueUpperLayerThread*) + 56
6   AzureCommunicationCalling     	0x00000001070875a8 spl::threadPosixEntry(void*) + 280
7   libsystem_pthread.dylib       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
8   libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 23 name:
Thread 23:
0   libsystem_kernel.dylib        	0x00000001cff69ac4 semaphore_wait_trap + 8 (:-1)
1   caulk                         	0x00000001e1d56888 caulk::mach::semaphore::wait_or_error() + 28 (mach_semaphore.cpp:131)
2   caulk                         	0x00000001e1d56fc0 caulk::concurrent::details::worker_thread::run() + 56 (semaphore.cpp:98)
3   caulk                         	0x00000001e1d57788 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       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
5   libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 24:
0   libsystem_kernel.dylib        	0x00000001cff69adc semaphore_timedwait_trap + 8 (:-1)
1   libdispatch.dylib             	0x000000019a9465f4 _dispatch_sema4_timedwait + 64 (lock.c:154)
2   libdispatch.dylib             	0x000000019a946bf4 _dispatch_semaphore_wait_slow + 76 (semaphore.c:116)
3   AzureCommunicationCalling     	0x0000000107081cac spl::eventWait(spl::EventGCD*&, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000l>>) + 144
4   AzureCommunicationCalling     	0x00000001070fcf60 auf::ThreadPoolExecutorImp::workLoop(auf::Worker*, SplOpaqueUpperLayerThread*) + 780
5   AzureCommunicationCalling     	0x00000001070fcc20 auf::tpImpThreadTrampoline(SplOpaqueUpperLayerThread*) + 56
6   AzureCommunicationCalling     	0x00000001070875a8 spl::threadPosixEntry(void*) + 280
7   libsystem_pthread.dylib       	0x00000001e03cc6cc _pthread_start + 148 (pthread.c:893)
8   libsystem_pthread.dylib       	0x00000001e03cbba4 thread_start + 8 (:-1)

Thread 25:
0   libsystem_pthread.dylib       	0x00000001e03cbb90 start_wqthread + 0 (:-1)

Thread 26:
0   libsystem_pthread.dylib       	0x00000001e03cbb90 start_wqthread + 0 (:-1)

Thread 27:
0   libsystem_pthread.dylib       	0x00000001e03cbb90 start_wqthread + 0 (:-1)

Thread 28:
0   libsystem_pthread.dylib       	0x00000001e03cbb90 start_wqthread + 0 (:-1)

Thread 29:
0   libsystem_pthread.dylib       	0x00000001e03cbb90 start_wqthread + 0 (:-1)

Thread 30:
0   libsystem_pthread.dylib       	0x00000001e03cbb90 start_wqthread + 0 (:-1)

Thread 31:
0   libsystem_pthread.dylib       	0x00000001e03cbb90 start_wqthread + 0 (:-1)


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x0000000000000000   x3: 0x0000000000000000
    x4: 0x0000000000000000   x5: 0x0000000000989680   x6: 0x000000000000006e   x7: 0xffffffff04617800
    x8: 0x4197677a9a113aa3   x9: 0x4197677b738ce3a3  x10: 0x00000000000003e8  x11: 0x000000000000000b
   x12: 0x000000000000000b  x13: 0x00000000001ff800  x14: 0x00000000000007fb  x15: 0x00000000ae20c073
   x16: 0x0000000000000148  x17: 0x00000001e99dd900  x18: 0x0000000000000000  x19: 0x0000000000000006
   x20: 0x0000000000000103  x21: 0x00000001e99dd9e0  x22: 0x0000000000000007  x23: 0x000000010547fa87
   x24: 0x0000000000000000  x25: 0x00000001e99dd9e0  x26: 0x00000002803cebc0  x27: 0x000000000000000f
   x28: 0x0000000000000000   fp: 0x000000016af26120   lr: 0x00000001e03d21ac
    sp: 0x000000016af26100   pc: 0x00000001cff70200 cpsr: 0x40000000
   esr: 0x56000080  Address size fault


Binary Images:
        0x104ed8000 -         0x10555ffff AppName arm64  <782bbd1c5c83316e8085296540bac135> /private/var/containers/Bundle/Application/C2638B2B-B8D4-4C44-9EE4-DF16BCC5ADCA/AppName.app/AppName
        0x105b00000 -         0x10775bfff AzureCommunicationCalling arm64  <c2c499b5bf613863a5932e066bd71d87> /private/var/containers/Bundle/Application/C2638B2B-B8D4-4C44-9EE4-DF16BCC5ADCA/AppName.app/Frameworks/AzureCommunicationCalling.framework/AzureCommunicationCalling
        0x18c698000 -         0x18c6dbe1f libobjc.A.dylib arm64e  <ab79707faf643ba588993b711c6cff5c> /usr/lib/libobjc.A.dylib
        0x18d758000 -         0x18e0a1fff Foundation arm64e  <c431acb6fe043d28b6774de6e1c7d81f> /System/Library/Frameworks/Foundation.framework/Foundation
        0x19336c000 -         0x193751fff CoreFoundation arm64e  <5cdc5d9ae5063740b64ebb30867b4f1b> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
        0x1944ee000 -         0x1948b5fff CFNetwork arm64e  <edb0559fc996327f9b3a6616e316f24d> /System/Library/Frameworks/CFNetwork.framework/CFNetwork
        0x195529000 -         0x196d06fff UIKitCore arm64e  <179501b60fc2344ab969b4e3961ebe10> /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
        0x19a942000 -         0x19a988fff libdispatch.dylib arm64e  <fea36690a0003c55b7009120b05aa69b> /usr/lib/system/libdispatch.dylib
        0x19a989000 -         0x19aa08ff7 libsystem_c.dylib arm64e  <dad0ce088f353ff4899e43dc44eb65a7> /usr/lib/system/libsystem_c.dylib
        0x1a3592000 -         0x1a5c2cfff WebCore arm64e  <d243ecf0fbc236959b5a6f661caae5c0> /System/Library/PrivateFrameworks/WebCore.framework/WebCore
        0x1b1a3f000 -         0x1b1ac200f dyld arm64e  <cb3ff411476234d286a4eca13f9fb6c3> /usr/lib/dyld
        0x1cc6e9000 -         0x1cc6f1fff GraphicsServices arm64e  <a633a095122639428f413877660185ee> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
        0x1cff69000 -         0x1cff9fffb libsystem_kernel.dylib arm64e  <ff27fc8f90ba3332ab7ac5bc2d9ca7b1> /usr/lib/system/libsystem_kernel.dylib
        0x1e0301000 -         0x1e0318ffb libc++abi.dylib arm64e  <fa871417be083e90b33ca6aa89813f3b> /usr/lib/libc++abi.dylib
        0x1e03cb000 -         0x1e03d6fff libsystem_pthread.dylib arm64e  <1aa3a4b6f9e730568c8b4e4dd81312a4> /usr/lib/system/libsystem_pthread.dylib
        0x1e1d54000 -         0x1e1d7dfff caulk arm64e  <c51b94f3ad8c3e39afe4fcac0752806a> /System/Library/PrivateFrameworks/caulk.framework/caulk

To Reproduce
No idea yet. It happens a lot for our calling app in Firebase (it's our most occurring crash at the moment), however it doesn't happen often per user, as the amount of unique users with this crash is equal to the amount of crashes.

Code Snippet

    private func updateRendering(newRenderer: VideoStreamRenderer, scalingMode: ScalingMode = .crop) throws {
        print("ACS UpdateVideoStream remoteVideoStream Create renderView")
        let newRendererView: RendererView = try newRenderer.createView(withOptions: CreateViewOptions(scalingMode: scalingMode))

        print("ACS UpdateVideoStream remoteVideoStream attachRenderview")
        attachRendererView(rendererView: newRendererView)

        print("ACS UpdateVideoStream remoteVideoStream setRenderer and view")
        renderer = newRenderer
        rendererView = newRendererView
    }

Expected behavior
No crash.

Setup (please complete the following information):

  • OS: According to Firebase it's happening on all iOS 16, iOS 17, iPadOS 16, iPadOS 17 versions
  • IDE : Xcode
  • Version of the Library used: 2.8.0

Additional context
The code is called both when joining a call (initialising the stream after the first participant joined and didUpdateVideoStreams is called) and when the call didChangeState to .connected when there are already participants available in the call.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added

@raosanat can you take a look at this? @Svantulden have you tried using the latest version of the library?

@Svantulden have you tried using the latest version of the library?

Not yet, as I didn't see any bug/crashfixes between the newest version and 2.8.0 in the releasenotes and we want to revert to our previous version because of this crash for our users.

If you have any tips for us on how to more consistently reproduce this issue, based on the exception message, let me know. Or if we can provide anything else to debug this.

Hi @Svantulden

Not yet, as I didn't see any bug/crashfixes between the newest version and 2.8.0 in the releasenotes and we want to revert to our previous version because of this crash for our users.

We didn't add the entry to our release note, sorry for that but there was a few bug fixes and crashes related to stream in the latest 2 releases so it should be worth giving it a try.

If you have any tips for us on how to more consistently reproduce this issue, based on the exception message, let me know. Or if we can provide anything else to debug this.

From the point of the crash looks like an issue that can be reproduced by adding and removing remote participants with video in the call or the participant on other side turning on-off the camera. It feels like some either stream or view renderer is in unexpected state (more likely stream).

Can you share if you dispose the renderer and if you do in which method, and when updateRendering is called in your application? That information should be a good start for us to begin investigation.

We didn't add the entry to our release note, sorry for that but there was a few bug fixes and crashes related to stream in the latest 2 releases so it should be worth giving it a try.

Thanks @lucianopa-msft . I've just now upgraded to the latest version of the SDK (2.10.1), but the exception also happens on that version.

From the point of the crash looks like an issue that can be reproduced by adding and removing remote participants with video in the call or the participant on other side turning on-off the camera. It feels like some either stream or view renderer is in unexpected state (more likely stream).

I've now got a solid reproduction scenario:

  1. Join a Teams call (via TeamsMeetingLinkLocator)
  2. At the 'other end' (not in the app), leave the call, then two delegate methods get called at same time (i & ii)
    1. didUpdateVideoStreams from RemoteParticipantDelegate gets called
      1. The last of the .videoStreams from the RemoteParticipant will be used to (re-)create the RendererView and VideoStreamRenderer. This means calling .dispose() on the previous RendererView and VideoStreamRenderer if there was already one and then creating new ones, ending in the code snippet of my original post
      2. ⚠️ Here the NSException from the SDK triggers in newer versions of the SDK -> let newRendererView: RendererView = try newRenderer.createView(withOptions: CreateViewOptions(scalingMode: scalingMode))
    2. didUpdateRemoteParticipant from CallDelegate gets called
      1. Check if there are participants left, if no participants left, go to step b.
      2. call.hangUp() called
      3. .dispose() called on the RendererView views and on VideoStreamRenderer for both local & remote
      4. .dispose() called on the CallAgent

Can you share if you dispose the renderer and if you do in which method, and when updateRendering is called in your application? That information should be a good start for us to begin investigation.

See the reproduction scenario above. I suspect the didUpdateVideoStreams in previous SDK versions didn't trigger for a participant stream if they leave the call or it didn't trigger the exception when recreating the view & renderer?

Now that we've got a consistent reproduction scenario, the issue becomes more clear. I've added a check for stream state to be .available or .started before (re-)creating the view and renderer in 2.i.a from the steps above, which seems to fix the exception. If you got any tips or comments, let me know, but I think we can close this issue.

@Svantulden, thank you for the detailed info.

See the reproduction scenario above. I suspect the didUpdateVideoStreams in previous SDK versions didn't trigger for a participant stream if they leave the call or it didn't trigger the exception when recreating the view & renderer?

Hard to say given that I am not sure which exception that is, but is more likely we didn't raise exception.

Now that we've got a consistent reproduction scenario, the issue becomes more clear. I've added a check for stream state to be .available or .started before (re-)creating the view and renderer in 2.i.a from the steps above, which seems to fix the exception. If you got any tips or comments, let me know, but I think we can close this issue.

Sounds good, this maybe down to attempt to create a view but the stream is in a state (maybe due to dispose) where it will not work, so we raise the error. Your check looks reasonable fix so I think we can close.

Thank you :)