aws-amplify / aws-sdk-ios

AWS SDK for iOS. For more information, see our web site:
https://aws-amplify.github.io/docs
Other
1.67k stars 876 forks source link

Crash on [cleanUpWebsocketOutputStream] function #5322

Open ZouhirASSAIB opened 1 week ago

ZouhirASSAIB commented 1 week ago

Describe the bug Our major crash is coming from AWS SDK and specially the function 'cleanUpWebsocketOutputStream'. The crash occurs 100% of the time in background on every devices running iOS "17". Unfortunately, we are not able to reproduce the crash on our side...

Stack Trace

Crashed: com.apple.root.default-qos
0  CoreFoundation                 0x7038 CF_IS_OBJC + 24
1  CoreFoundation                 0x13378 CFArrayGetCount + 32
2  CoreFoundation                 0xdd1c _CFStreamClose + 264
3  AWSIoT                         0x78fc -[AWSIoTMQTTClient cleanUpWebsocketOutputStream] + 702 (AWSIoTMQTTClient.m:702)
4  AWSIoT                         0xaba0 -[AWSIoTMQTTClient webSocket:didCloseWithCode:reason:wasClean:] + 1291 (AWSIoTMQTTClient.m:1291)
5  AWSIoT                         0x8293c __41-[AWSSRWebSocket safeHandleEvent:stream:]_block_invoke_2 + 1595 (AWSSRWebSocket.m:1595)
6  libdispatch.dylib              0x213c _dispatch_call_block_and_release + 32
7  libdispatch.dylib              0x3dd4 _dispatch_client_callout + 20
8  libdispatch.dylib              0x6f6c _dispatch_queue_override_invoke + 928
9  libdispatch.dylib              0x15894 _dispatch_root_queue_drain + 392
10 libdispatch.dylib              0x1609c _dispatch_worker_thread2 + 156
11 libsystem_pthread.dylib        0x1ee4 _pthread_wqthread + 228
12 libsystem_pthread.dylib        0x1fc0 start_wqthread + 8

Unique Configuration Since the crash occurs 100% of the time in background, it may be link to the fact we force the disconnection to the iOT when the app didEnterBackground. We made this to reduce other crashs on the SDK when the user was returning to the application. Maybe an asynchronous process end up after the disconnection and cause the crash...

Areas of the SDK you are using (AWSMobileClient, Cognito, Pinpoint, IoT, etc)? AWSCognito.framework AWSCognitoAuth.framework AWSCognitoIdentityProvider.framework AWSCognitoIdentityProviderASF.framework AWSCore.framework

Environment(please complete the following information):

Device Information (please complete the following information):

Thank you for your help on this. Our crash-free is very impacted by this one !

ruisebas commented 1 week ago

Hi @ZouhirASSAIB, thanks for opening this issue.

The team will take a look and post updates here. In the meantime, would you mind sharing:

Thanks!

ZouhirASSAIB commented 1 week ago

Hi @ZouhirASSAIB, thanks for opening this issue.

The team will take a look and post updates here. In the meantime, would you mind sharing:

  • The full symbolicated crashlog
  • Code snippets on how you're interacting with the AWSIoT APIs
  • Whether this issue happens exclusively on iOS 17, or in previous versions as well.

Thanks!

You're welcome @ruisebas 😊

Here is the full symbolicate crash log :

com.groupeseb.aspi-robot_issue_625efd37ea145feb6a8857d3ab58a6f7_crash_session_64d813839c0f439eaa99700d1f0fe0ed_DNE_0_v2_stacktrace.txt

Unfortunately, we can't send code snippets on how we're interacting with the AWSIoT APIs (corporate code).

And yes for now we have events that concerns only iOS 17.

thisisabhash commented 1 day ago

Thank you - our team will investigate and post updates here.