Closed Bug 1218830 Opened 10 years ago Closed 10 years ago

SendTo: Crash with unowned profile in BrowserSyncManager.onFinishedSyncing

Categories

(Firefox for iOS :: General, defect)

All
iOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
fxios 1.2+ ---
fxios-v1.0 --- affected
fxios-v1.1 --- affected

People

(Reporter: rnewman, Assigned: rnewman)

Details

(Keywords: crash)

We have an unowned reference to our profile to avoid a retain cycle. But we use notifications to hear when a sync is finished, and those notifications call: @objc func onFinishSyncing(notification: NSNotification) { profile.prefs.setTimestamp(NSDate.now(), forKey: PrefsKeys.KeyLastSyncFinishTime) } We have a crash in 1.0.1 that indicates that this notification can be processed after the profile has already been deallocated. Based on code reading, this bug will affect 1.1. Thread 7 Crashed: 0 libswiftCore.dylib 0x00a3b8a0 swift_retainUnowned + 40 (Debug.h:39) 1 SendTo 0x000e8f9c @objc SendTo.BrowserProfile.BrowserSyncManager.onFinishSyncing (SendTo.BrowserProfile.BrowserSyncManager)(ObjectiveC.NSNotification) -> () + 48 (<unknown>:0) 2 CoreFoundation 0x23d5fffc __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12 (CFNotificationCenter.c:676) 3 CoreFoundation 0x23d5fa0a _CFXRegistrationPost + 398 (CFNotificationCenter.c:172) 4 CoreFoundation 0x23d5f7e0 ___CFXNotificationPost_block_invoke + 40 (CFNotificationCenter.c:1017) 5 CoreFoundation 0x23db3ac2 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1334 (CFXNotificationRegistrar.m:164) 6 CoreFoundation 0x23cc104a _CFXNotificationPost + 486 (CFNotificationCenter.c:1037) 7 SendTo 0x00107680 SendTo.BrowserProfile.BrowserSyncManager.((withSyncInputs in _8B55E06CDD7E68DC6BC252D6F91FAD70) (SendTo.BrowserProfile.BrowserSyncManager) -> <A>(label : Swift.String?, function : (Sync.SyncDelegate, Shared.Prefs, Sync.Ready) -> Shared.Deferred<Shared.Result<A>>) -> Shared.Deferred<Shared.Result<A>>?).(closure #2) + 360 (Profile.swift:604) 8 Shared 0x006bd560 reabstraction thunk helper <T_0_0> from @callee_owned (@in T_0_0) -> (@unowned ()) to @callee_owned (@in T_0_0) -> (@out ()) + 32 (<unknown>:0) 9 Shared 0x006b78a4 partial apply forwarder for reabstraction thunk helper <T_0_0> from @callee_owned (@in T_0_0) -> (@unowned ()) to @callee_owned (@in T_0_0) -> (@out ()) with unmangled suffix "249 + 100 (<unknown>:0) 10 Shared 0x006be138 reabstraction thunk helper <T_0_0> from @callee_owned (@in T_0_0) -> (@out ()) to @callee_owned (@in T_0_0) -> (@unowned ()) + 44 (<unknown>:0) 11 Shared 0x006c4f20 0x660000 + 413472 12 Shared 0x006b74a8 partial apply forwarder for Shared.Deferred.((_fill in _64863D17A065AD747F9AFBDCF9C2ED6A) <A>(Shared.Deferred<A>) -> (A, assertIfFilled : Swift.Bool) -> ()).(closure #2) + 120 (<unknown>:0) 13 Shared 0x006b9340 reabstraction thunk helper from @callee_owned () -> (@unowned ()) to @callee_unowned @objc_block () -> (@unowned ()) + 56 (<unknown>:0) 14 libdispatch.dylib 0x35baced6 _dispatch_call_block_and_release + 10 (init.c:761) 15 libdispatch.dylib 0x35bb8870 _dispatch_root_queue_drain + 1572 (inline_internal.h:1063) 16 libdispatch.dylib 0x35bb824a _dispatch_worker_thread3 + 94 (queue.c:4250) 17 libsystem_pthread.dylib 0x35d41e28 _pthread_wqthread + 1024 (pthread.c:1990) 18 libsystem_pthread.dylib 0x35d41a18 start_wqthread + 8 (pthread_asm.s:151)
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
97fe50b
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.