-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crashing at -[SRWebSocket stream:handleEvent:] (SRWebSocket.m:1405) #156
Comments
@marianoabdala hi there Mariano, We're seeing crashlogs similar to the one you posted. May i ask you if you found anything that might be causing this? Thanks in advance!, |
Hi @jleandroperez, sadly we didn't. I was hoping for a reply from the repo's author but didn't get one. |
@marianoabdala thanks for the quick reply!. I'll dig further, and will keep you posted! |
@jleandroperez I appreciate it. |
@marianoabdala i've just sent a Pull Request with a potential fix for this crash. Please, let me know if it helps!. I've been unable to directly trigger this crash, so far. |
Doing some housekeeping. Please reopen if still relevant |
@mikelikespie i'm afraid this is still relevant. Thanks in advance! |
@mikelikespie thanks for reopening sir 😄 |
I have continued to see these crashes, as well as other related issues. I believe I have a solution that should avoid all such issues. I previously closed by
What this means is that the socket will start to close but by the time it is finished ARC will have released the object so Rather than trying to add lots of safety checks, I suggest that a better solution is to eliminate the race condition entirely. i.e. Make sure your socket is strongly referenced until it fully closes. I have put together a gist with a class that will patiently wait for your Now my socket closing looks like this:
I feel like this behaviour isn't something that could be built into SocketRocket but I would love to hear anyone's thoughts on it. Perhaps the best course of action is to clearly document that |
I'm also seeing this crash many times a day. |
Issue #156: Prevents crash in handleEvent method
I meet the same problem, sometimes, it crashed at while ([_runLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]) {
} |
Firebase
Intercom
|
@anxiaoyi @siberianisaev Are you seeing this crash on 0.5.0? I believe it should have been fixed in #169. |
@siberianisaev If you're having an issue with Intercom, it'd be great if you could add details here: https://github.com/intercom/intercom-ios/issues/124. |
Pure awesomeness!! glad to hear that @michaelkirk !!! :hug: |
Glad to hear this. Indeed there was a lot of fixes in the recent month. Anyone still experiencing crashes - please make sure you are running latest master and open a new issue. |
so this fix is not in cocoapods 0.5.1? can not find this in 0.5.1 |
I have got this crash a lot of time in 0.5.1 version. |
Same here |
Issue facebookincubator#156: Prevents crash in handleEvent method
I saw the code of the fix for this crash: I think the crash can still happen this way we make sure that the last request in the run loop is just releasing the selfRetain, after all possible stream events occurred. |
I have the same issues, do you know how to fix? |
Hi, I'm getting random but continuos (~10-15 a day) crashes on a desktop app I'm working on presently but I couldn't reproduce it myself and it's working for the vast majority of the users.
So I was wondering if somebody else is seeing this before. I'm using SRWebSocket through libPusher, in case that makes a difference.
We are using the latest (at least on CocoaPods):
pod 'SocketRocket', '0.3.1-beta2'
Thanks in advance for any help you can provide.
Crash report:
Exception Type: SIGSEGV
Exception Codes: SEGV_NOOP at 0x0
Crashed Thread: 6
Thread 6 Crashed:
0 libobjc.A.dylib 0x00007fff8d6c57a2 objc_retain + 18
1 libsystem_blocks.dylib 0x00007fff90313580 _Block_copy_internal + 308
2 libdispatch.dylib 0x00007fff90cee546 _dispatch_Block_copy + 43
3 libdispatch.dylib 0x00007fff90cf413f dispatch_async + 17
4 [MYAPP] 0x000000010ac84303 -SRWebSocket stream:handleEvent:
5 CoreFoundation 0x00007fff8d9a4d51 _signalEventSync + 385
6 CoreFoundation 0x00007fff8d9a4b98 _cfstream_solo_signalEventSync + 328
7 CoreFoundation 0x00007fff8d9a4a0f _CFStreamSignalEvent + 623
8 CFNetwork 0x00007fff8a86327e _ZN30CoreWriteStreamCFStreamSupport20coreStreamWriteEventEP17__CoreWriteStreamm + 102
9 CFNetwork 0x00007fff8a8631ed _ZN21CoreWriteStreamClient25coreStreamEventsAvailableEm + 53
10 CFNetwork 0x00007fff8a9969c5 _ZN14CoreStreamBase14_callClientNowEP16CoreStreamClient + 53
11 CFNetwork 0x00007fff8a88c678 ___ZN14CoreStreamBase34_streamSetEventAndScheduleDeliveryEmh_block_invoke + 33
12 CFNetwork 0x00007fff8a87c40c ___ZNK17CoreSchedulingSet13_performAsyncEPKcU13block_pointerFvvE_block_invoke + 25
13 CoreFoundation 0x00007fff8d92fcd4 CFArrayApplyFunction + 68
14 CFNetwork 0x00007fff8a87c2eb _ZN19RunloopBlockContext7performEv + 115
15 CFNetwork 0x00007fff8a87c193 _ZN17MultiplexerSource7performEv + 269
16 CFNetwork 0x00007fff8a87bfc2 _ZN17MultiplexerSource8_performEPv + 72
17 CoreFoundation 0x00007fff8d964731 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
18 CoreFoundation 0x00007fff8d955ea2 CFRunLoopDoSources0 + 242
19 CoreFoundation 0x00007fff8d95562f __CFRunLoopRun + 831
20 CoreFoundation 0x00007fff8d9550b5 CFRunLoopRunSpecific + 309
21 Foundation 0x00007fff8ca68adc -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 253
22 [MYAPP] 0x000000010ac8546c -_SRRunLoopThread main
23 Foundation 0x00007fff8ca6676b __NSThread__main + 1318
24 libsystem_pthread.dylib 0x00007fff8a43b899 _pthread_body + 138
25 libsystem_pthread.dylib 0x00007fff8a43b72a _pthread_struct_init + 0
The text was updated successfully, but these errors were encountered: