azure-sdk-for-ios icon indicating copy to clipboard operation
azure-sdk-for-ios copied to clipboard

[BUG] During multiple leave/join actions on Teams meeting it crashes

Open dudeck opened this issue 2 years ago • 4 comments

Describe the bug When User leaves and joins Teams meeting multiple times app crashes.

Exception or Stack Trace

* thread #72, queue = 'com.apple.root.user-initiated-qos', stop reason = EXC_BAD_ACCESS (code=1, address=0x3938303531304065)
frame #0: 0x000000010349edb8 AzureCommunicationCalling`SkyLib::Video::Stop(GI::String const&) + 264
AzureCommunicationCalling`SkyLib::Video::Stop:
-> 0x10349edb8 <+264>: ldr x8, [x21]
0x10349edbc <+268>: ldr x8, [x8, #0x70]
0x10349edc0 <+272>: mov x0, x21
0x10349edc4 <+276>: mov x1, x20
Target 0: (Runner) stopped.

To Reproduce Steps to reproduce the behaviour:

  1. Join Teams meeting to Lobby.
  2. Leave Teams Lobby.
  3. Repeat it even 50 times.
  4. App crashes.

Code Snippet This is our code to leave meeting action:

    func dispose() {
        preview.dispose()
        previewRenderer.delegate = nil
        previewRenderer.dispose()
        acsCall = nil
        callAgent?.delegate = nil
        deviceManager?.delegate = nil
        deviceManager = nil
        // Some cleanup tasks take too long, so we do it in another thread to not block the UI
        DispatchQueue.global().async { [weak self] in
            self?.callAgent?.dispose()
            self?.callAgent = nil
            self?.callClient?.dispose()
            self?.callClient = nil
        }
    }

We moved disposing callAgent and callClient to separate thread according to your advice from: https://issuemode.com/issues/Azure/Communication/1395533#answer-1822504

Expected behavior App shouldn't crash.

Setup (please complete the following information):

  • OS: iOS 14.7.1 iPhone 6s Plus
  • IDE : XCode
  • Version of the Library used: AzureCommunicationCalling (2.0.0)
PODS:
    AzureCommunicationCalling (2.0.0):
        AzureCommunicationCommon (~> 1.0.2)
    AzureCommunicationCommon (1.0.3)

dudeck avatar May 09 '22 12:05 dudeck

@raosanat can you transfer this to your repo for action?

tjprescott avatar May 09 '22 16:05 tjprescott

Unfortuanatelly, it still occurs on ACS v.2.2.0. This issue is more reproducible when during beeing in Lobby app goes to background and then is moved back to foreground. Then when finishing call app crashes. Moreover, we are calling ACSCall.stopVideo() method before hangUp() method, but it doesn't help.

dudeck avatar Jul 05 '22 09:07 dudeck

@dudeck I'm not able to repro currently. What is the business scenario for this? What's the situation for needing to continually join/leave lobby?

DaybreakQuip avatar Aug 10 '22 23:08 DaybreakQuip

@DaybreakQuip, I'm on the same team as @dudeck.

It's not a business scenario, it's an edge case discovered in exploratory testing. It's concerning though since it might point to a problem that can manifest in scenarios yet untested.

Is there any way we can assist you to repro?

zolhu avatar Aug 11 '22 07:08 zolhu

@zolhu Since Ze can't repro the issue, I'm going to close the bug as no repro. If you are still able to repro on your end, can you please attach a video of the 50 tries and crash at the end.

gaobob-msft avatar Sep 05 '22 17:09 gaobob-msft

Tested on 2.4.0-alpha.1 and couldn't reproduce.

dudeck avatar Sep 21 '22 13:09 dudeck