robbiehanson / CocoaAsyncSocket

Asynchronous socket networking library for Mac and iOS
Other
12.45k stars 3k forks source link

GCDAsyncSocket EXC_GUARD 0x08fd4dbfade2dead #794

Closed funct7 closed 1 year ago

funct7 commented 2 years ago

Environment: iOS 14, 15 Version: 7.6.3

We are getting reports from Crashlytics with the heading: GCDAsyncSocket EXC_GUARD 0x08fd4dbfade2dead

Stacktrace:

Crashed: GCDAsyncSocket
0  libsystem_kernel.dylib         0x27c4 close + 8
1  libdispatch.dylib              0x1e6c _dispatch_call_block_and_release + 32
2  libdispatch.dylib              0x3a30 _dispatch_client_callout + 20
3  libdispatch.dylib              0x6eec _dispatch_continuation_pop + 500
4  libdispatch.dylib              0x1ab48 _dispatch_source_cancel_callout + 204
5  libdispatch.dylib              0x19fa0 _dispatch_source_invoke + 1184
6  libdispatch.dylib              0xb000 _dispatch_lane_serial_drain + 376
7  libdispatch.dylib              0xbc80 _dispatch_lane_invoke + 392
8  libdispatch.dylib              0x16500 _dispatch_workloop_worker_thread + 648
9  libsystem_pthread.dylib        0x10bc _pthread_wqthread + 288
10 libsystem_pthread.dylib        0xe5c start_wqthread + 8

It seems to happen only intermittently, and we didn't have this issue before the update where we changed the code that disconnects and reconnects at a certain interval repeatedly. We haven't updated CocoaAsyncSocket, so I'm thinking there might be some undesirable side effects that are taking place in the new disconnect/reconnect sequence.

EXC_GUARD 0x08fd4dbfade2dead seems to be related to using a released file descriptor according to some pages (curl Github page, Apple dev forum).

Since we're not hearing from customers about this issue, I'm guessing it might be happening while the app is in the background/suspended state, or when it's closing.

If there are any cautions to take when reconnecting, or any method call sequence that could trigger the issue, please let me know.

Thank you!

qasimsqm commented 2 years ago

Getting same issue

ankitagarwal007 commented 2 years ago

@qasimsqm @funct7 Were you able to find any possible solution to this crash.

funct7 commented 2 years ago

@ankitagarwal007 We found that the call to our reconnect method was not being throttled like we wanted, and the number of calls was increasing exponentially. I wasn't actually able to reproduce the crash, but ever since we fixed the throttling timer, we haven't had this issue.

github-actions[bot] commented 2 years ago

This issue has been marked as stale, it will be closed automatically if there is no further activity.