Communication
Communication copied to clipboard
[iOS] Hanging up a call via `UIApplicationWillTerminateNotification` triggers an exception
Describe the bug
I'm attempting to hang up a call after UIApplicationWillTerminateNotification
is posted so the user can be disconnected from an active call when they kill their app. However, the call to hangup:
is triggering an exception somewhere with the ACS SDK.
To Reproduce Steps to reproduce the behavior:
- Add notification observer for
UIApplicationWillTerminateNotification
- When this notification is posted, trigger
ACSCAall hangup:
- Observer exception
Expected behavior Hangup should be handled gracefully in this case.
Smartphone (please complete the following information):
- iPhone 11 Pro
- iOS 13.2.3
Note that, we are able to get it working by using semaphore to block the thread when getting this notification until the hangup callback is returned. But we are also exploring options
@terrychen1122 the logs you sent does not have any crash. Can you please send the correct log ? We will need the complete stack to know what the problem is. Meanwhile we will try to reproduce the issue with our test-app
@raosanat I think it's an exception instead of a fatal crash.
@ryanespiritu can you confirm? I think a screenshot of the stacktrace might be helpful.
Yes that will help.
Hey @raosanat, I'm wondering if the exception was not captured in the logs since it occurs during app termination. In either case, I've attached a few more log files during debug sessions where the crash occurred. acs_sdk_blogs.zip
Also here are the two stack traces I've seen for the crash: 1.
0 ??? 0x000000011181079c 0x0 + 4588636060,
1 LIConferencingSampleApp 0x0000000100c8a7dc main + 0,
2 libsystem_c.dylib 0x000000019d4caa74 abort + 104,
3 libc++abi.dylib 0x000000019d5e23c8 __cxa_bad_cast + 0,
4 libc++abi.dylib 0x000000019d5e25a8 BEF405AD-732A-3185-B18E-A53A1ED4246B + 5544,
5 libobjc.A.dylib 0x000000019d549318 9E6EF781-3ED7-3536-AB5A-2CECA74A129F + 25368,
6 libc++abi.dylib 0x000000019d5ef634 BEF405AD-732A-3185-B18E-A53A1ED4246B + 58932,
7 libc++abi.dylib 0x000000019d5eef58 __cxa_get_exception_ptr + 0,
8 libc++abi.dylib 0x000000019d5eef10 BEF405AD-732A-3185-B18E-A53A1ED4246B + 57104,
9 libc++.1.dylib 0x000000019d6af1dc _ZNSt3__120__throw_system_errorEiPKc + 92,
10 libc++.1.dylib 0x000000019d6a21dc _ZNSt3__115recursive_mutex6unlockEv + 0,
11 AzureCommunicationCalling 0x00000001035a536c MMPostMessage + 92,
12 AzureCommunicationCalling 0x00000001035ca634 _ZN19CRTCMediaController17StreamStateChangeEm14RtpStreamState12RtpDirection13RtpReasonCode + 316,
13 AzureCommunicationCalling 0x0000000103531530 _ZN29RtpMediaEventsConnectionPoint27RaiseStreamStateChangeEventEm14RtpStreamState12RtpDirection13RtpReasonCode + 216,
14 AzureCommunicationCalling 0x00000001035a06b4 _ZN9RtpStream10RaiseEventE14RtpStreamState12RtpDirection13RtpReasonCode + 204,
15 AzureCommunicationCalling 0x00000001034e9a2c _ZN10RtpChannel18HandleChannelEventERNSt3__110shared_ptrI12ChannelEventEE + 540,
16 AzureCommunicationCalling 0x0000000103566490 _ZN21RtpEventHandlerThread18HandleChannelEventERNSt3__110shared_ptrI12ChannelEventEE + 264,
17 AzureCommunicationCalling 0x0000000103565c7c _ZN21RtpEventHandlerThread22EventHandlerThreadProcEPv + 960,
18 AzureCommunicationCalling 0x0000000102b29cc0 _ZN12RtcPalThread10ThreadFuncEPv + 60,
19 libsystem_pthread.dylib 0x000000019d539d50 _pthread_start + 128,
20 libsystem_pthread.dylib 0x000000019d541c88 thread_start + 8
0 ??? 0x000000011359465c 0x0 + 4619585116,
1 LIConferencingSampleApp 0x0000000104a4e7dc main + 0,
2 AzureCommunicationCalling 0x0000000107092108 _ZNK2tc10icemachine27ConsentKeepAliveProcessImpl18MakeBindingRequestEv + 1016,
3 AzureCommunicationCalling 0x00000001070918c0 _ZN2tc10icemachine27ConsentKeepAliveProcessImpl7ProcessEj + 1140,
4 AzureCommunicationCalling 0x00000001071c7a9c _ZN2tc10Dispatcher7ProcessEj + 588,
5 AzureCommunicationCalling 0x00000001070b15c0 _ZN2tc10icemachine18SessionManagerImpl7ProcessEj + 56,
6 AzureCommunicationCalling 0x00000001071c7a9c _ZN2tc10Dispatcher7ProcessEj + 588,
7 AzureCommunicationCalling 0x00000001070cc334 _ZN23CTransportProviderVNext24ProcessTimerTickInternalEj + 292,
8 AzureCommunicationCalling 0x00000001070cc1b4 _ZN23CTransportProviderVNext16ProcessTimerTickEv + 108,
9 AzureCommunicationCalling 0x00000001071e12b0 _ZN34CTransportProviderLockingDecorator16ProcessTimerTickEv + 60,
10 AzureCommunicationCalling 0x0000000106cc0278 _ZN23CSlimConferenceInfoImpl16ProcessTransportEm + 116,
11 AzureCommunicationCalling 0x0000000106cc0418 _ZN23CSlimConferenceInfoImpl17ProcessConferenceEi + 316,
12 AzureCommunicationCalling 0x0000000106cf4dcc _ZN24CSlimStreamingEngineImpl16ProcessTimerTickEv + 836,
13 AzureCommunicationCalling 0x0000000106cc9c2c _ZN24CSlimStreamingEngineImpl15TimerThreadProcEPv + 616,
14 AzureCommunicationCalling 0x00000001068d5cc0 _ZN12RtcPalThread10ThreadFuncEPv + 60,
15 libsystem_pthread.dylib 0x000000019d539d50 _pthread_start + 128,
16 libsystem_pthread.dylib 0x000000019d541c88 thread_start + 8
0 ??? 0x000000011526079c 0x0 + 4649781148,
1 LIConferencingSampleApp 0x0000000104eda7dc main + 0,
2 libsystem_c.dylib 0x000000019d4caa74 abort + 104,
3 libc++abi.dylib 0x000000019d5e23c8 __cxa_bad_cast + 0,
4 libc++abi.dylib 0x000000019d5e25a8 BEF405AD-732A-3185-B18E-A53A1ED4246B + 5544,
5 libobjc.A.dylib 0x000000019d549318 9E6EF781-3ED7-3536-AB5A-2CECA74A129F + 25368,
6 libc++abi.dylib 0x000000019d5ef634 BEF405AD-732A-3185-B18E-A53A1ED4246B + 58932,
7 libc++abi.dylib 0x000000019d5eef58 __cxa_get_exception_ptr + 0,
8 libc++abi.dylib 0x000000019d5eef10 BEF405AD-732A-3185-B18E-A53A1ED4246B + 57104,
9 libc++.1.dylib 0x000000019d6af1dc _ZNSt3__120__throw_system_errorEiPKc + 92,
10 libc++.1.dylib 0x000000019d6a21dc _ZNSt3__115recursive_mutex6unlockEv + 0,
11 AzureCommunicationCalling 0x000000010782c1dc _ZN14CMediaFlowImpl18SetNotifyInterfaceENSt3__110shared_ptrI16IMediaFlowNotifyEE + 44,
12 AzureCommunicationCalling 0x000000010666275c _ZN2ma6MMConf13TerminateFlowEv + 440,
13 AzureCommunicationCalling 0x00000001066087a4 _ZN2ma10Conference9terminateENS_15TerminateReasonE + 1080,
14 AzureCommunicationCalling 0x00000001066e9394 _ZN3csa5CCall7cleanupEv + 252,
15 AzureCommunicationCalling 0x00000001069aa3bc _ZN3auf4priv13MRMWTransport11tryDispatchEPNS_11IDispatcherE + 136,
16 AzureCommunicationCalling 0x0000000106a095a0 _ZN3auf17StrandExecutorImp11tryDispatchEPNS_11IDispatcherE + 24,
17 AzureCommunicationCalling 0x0000000106a0941c _ZN3auf17StrandExecutorImp13depleteStrandEN2rt12IntrusivePtrIS0_EE + 84,
18 AzureCommunicationCalling 0x0000000106a09870 _ZN3auf8internal12async_method5applyIRNS_17StrandExecutorImpEMS3_FvN2rt12IntrusivePtrIS3_EEENSt3__15tupleIJS7_EEEJLm0EEEEDTcldsclsr3stdE7forwardIT_Efp_Efp0_spscNS0_19async_required_castIXT2_EN3spl8internal16inspect_callableIT0_E3get10args_tupleET1_E4typeEclsr3stdE3getIXT2_EEfp1_EEEOSD_SI_RSL_NSG_3seqIJXspT2_EEEE + 56,
19 AzureCommunicationCalling 0x0000000106a085b8 _ZN3auf24NativeThreadPoolExecutor20callFromNativeWorkerEPN3spl7VarBaseEPv + 56,
20 AzureCommunicationCalling 0x0000000106a08720 ___ZN3spl4priv23NativeThreadPoolManager8dispatchERKDnP16dispatch_queue_sPFvPNS_7VarBaseEPvES7_S8__block_invoke + 48,
21 libdispatch.dylib 0x0000000106299e1c _dispatch_call_block_and_release + 32,
22 libdispatch.dylib 0x000000010629b27c _dispatch_client_callout + 20,
23 libdispatch.dylib 0x000000010629daf0 _dispatch_queue_override_invoke + 924,
24 libdispatch.dylib 0x00000001062acaa0 _dispatch_root_queue_drain + 356,
25 libdispatch.dylib 0x00000001062ad40c _dispatch_worker_thread2 + 144,
26 libsystem_pthread.dylib 0x000000019d53ba54 _pthread_wqthread + 216,
27 libsystem_pthread.dylib 0x000000019d541c7c start_wqthread + 8
@ryanespiritu i was able to repro the issue at our end. This is definitely a bug on our side and we will look at this in more detail after GA. AB#2417857