Skip to content
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

Tentative fix of #1083 #1089

Merged
merged 5 commits into from
Jul 29, 2021
Merged

Tentative fix of #1083 #1089

merged 5 commits into from
Jul 29, 2021

Conversation

ricardopereira
Copy link
Contributor

@ricardopereira ricardopereira commented Nov 12, 2020

#1083

The eventHandler from ARTEventListener holds a weak reference and if that handler is released then the dispatch_after will receive a queue that is nil.

I forced that situation and the stack trace is similar to the issue:

Thread 13 Queue : io.ably.main (serial)
#0  0x00000001005375d5 in _dispatch_continuation_init_slow ()
#1  0x000000010054d77a in dispatch_after ()
#2  0x00000001003107a2 in artDispatchScheduled at /Users/ricardopereira/Repositories/Whitesmith/AblyMacDemo/Pods/Ably/Source/Private/ARTGCD.m:47
#3  0x0000000100309f99 in -[ARTEventListener startTimer] at /Users/ricardopereira/Repositories/Whitesmith/AblyMacDemo/Pods/Ably/Source/ARTEventEmitter.m:141
#4  0x0000000100342678 in -[ARTRealtimeInternal transition:withErrorInfo:] at /Users/ricardopereira/Repositories/Whitesmith/AblyMacDemo/Pods/Ably/Source/ARTRealtime.m:486
#5  0x0000000100342772 in -[ARTRealtimeInternal transitionToDisconnectedOrSuspendedWithError:] at /Users/ricardopereira/Repositories/Whitesmith/AblyMacDemo/Pods/Ably/Source/ARTRealtime.m:498
#6  0x0000000100344ca8 in __45-[ARTRealtimeInternal transitionSideEffects:]_block_invoke_2 at /Users/ricardopereira/Repositories/Whitesmith/AblyMacDemo/Pods/Ably/Source/ARTRealtime.m:578
#7  0x0000000100324f03 in __38-[ARTOSReachability internalCallback:]_block_invoke at /Users/ricardopereira/Repositories/Whitesmith/AblyMacDemo/Pods/Ably/Source/Private/ARTOSReachability.m:96
#8  0x0000000100532844 in _dispatch_call_block_and_release ()
#9  0x0000000100533826 in _dispatch_client_callout ()
#10 0x000000010053add7 in _dispatch_lane_serial_drain ()
#11 0x000000010053bb90 in _dispatch_lane_invoke ()
#12 0x0000000100548fe0 in _dispatch_workloop_worker_thread ()
#13 0x00000001005c1361 in _pthread_wqthread ()
#14 0x00000001005c049b in start_wqthread ()

… dispatch_after could be crashing because the queue is nil.
@lukasz-szyszkowski lukasz-szyszkowski merged commit 6994868 into main Jul 29, 2021
@lukasz-szyszkowski lukasz-szyszkowski deleted the fix/1083 branch July 29, 2021 11:05
maratal pushed a commit that referenced this pull request Jul 19, 2023
Spec: remove optional wording from idle timeout detection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants