apollo-ios icon indicating copy to clipboard operation
apollo-ios copied to clipboard

Crash in FoundationTransport.write

Open mcrakhman opened this issue 3 years ago • 7 comments

Bug report

When we used Apollo subscriptions we've encountered some strange crash which apparently happens in background when some users use our app for a long time.

Versions

  • apollo-ios SDK version: 0.43
  • Xcode version: 12.3 / 13 beta1
  • Swift version: Swift 5
  • Package manager: SPM

Steps to reproduce

Happens randomly in Background? Didn't find exact steps.

Further details

Detailed description please find here: https://github.com/daltoniam/Starscream/issues/921

mcrakhman avatar Sep 13 '21 08:09 mcrakhman

Hi @mcrakhman 👋🏻 - thanks for raising the issue. We found general instability with Starscream 4.0 and in apollo-ios release 0.47.0 we reverted back to Starscream 3.x to resolve these random crashes.

We've not heard of the issues recurring since so I believe the solution for your crashes would be to update to the latest release of apollo-ios.

calvincestari avatar Sep 13 '21 19:09 calvincestari

@mcrakhman, have you tried the latest release of apollo-ios - is this still an issue for you?

calvincestari avatar Sep 21 '21 18:09 calvincestari

Hi @calvincestari, I experience the same random crashes.

Versions

apollo-ios SDK version: 0.51.0 Xcode version: 13.3 Swift version: Swift 5 Package manager: SPM

Crash log

com.apollographql.websocket
0  libsystem_kernel.dylib         0x1a6c __semwait_signal + 8
1  libsystem_c.dylib              0x50dc nanosleep + 220
2  libsystem_c.dylib              0x5e0c usleep + 68
3  ShopmonkeyApp                  0x8c6290 closure #1 in FoundationStream.connect(url:port:timeout:ssl:completion:) + 130 (WebSocketStream.swift:130)
4  ShopmonkeyApp                  0x8c9930 thunk for @escaping @callee_guaranteed () -> () + 4374059312 (<compiler-generated>:4374059312)
5  libdispatch.dylib              0x1e68 _dispatch_call_block_and_release + 32
6  libdispatch.dylib              0x3a2c _dispatch_client_callout + 20
7  libdispatch.dylib              0xb124 _dispatch_lane_serial_drain + 668
8  libdispatch.dylib              0xbc80 _dispatch_lane_invoke + 392
9  libdispatch.dylib              0x16500 _dispatch_workloop_worker_thread + 648
10 libsystem_pthread.dylib        0x10bc _pthread_wqthread + 288
11 libsystem_pthread.dylib        0xe5c start_wqthread + 8

ykyivskyi avatar May 05 '22 07:05 ykyivskyi

Thanks @ykyivskyi - do you have any other details you could share about the crash? Foreground, background, etc. - I'm wondering if it's related to https://github.com/apollographql/apollo-ios/issues/2266.

calvincestari avatar May 11 '22 05:05 calvincestari

@calvincestari Crashlytics reports show that 20% of crashes happened in background.

ykyivskyi avatar May 11 '22 05:05 ykyivskyi

This is never happening while the app is in the foreground as far as you can tell though?

AnthonyMDev avatar May 17 '22 19:05 AnthonyMDev

@AnthonyMDev It happens either on background or foreground, but mostly on foreground.

ykyivskyi avatar Jun 06 '22 16:06 ykyivskyi