Closed Bug 1353490 Opened 8 years ago Closed 8 years ago

Crash in Client TabManager.getTabForURL after Handoff to Mac

Categories

(Firefox for iOS :: General, defect, P1)

Other
iOS
defect

Tracking

()

VERIFIED FIXED
Iteration:
1.22
Tracking Status
fxios 8.0+ ---
fxios-v7.0 --- affected
fxios-v8.0 --- verified

People

(Reporter: aaronmt, Assigned: st3fan)

Details

(Keywords: crash, reproducible, Whiteboard: [MobileCore])

Attachments

(1 file)

assertion failed: file /Users/aaronmt/Mozilla/firefox-ios/Client/Frontend/Browser/TabManager.swift, line 513 2017-04-04 14:42:14.070737-0400 Client[618:155144] assertion failed: file /Users/aaronmt/Mozilla/firefox-ios/Client/Frontend/Browser/TabManager.swift, line 513 (lldb) bt * thread #32, queue = 'com.apple.root.default-qos', stop reason = EXC_BREAKPOINT (code=1, subcode=0x102ba3300) * frame #0: 0x0000000102ba3300 libswiftCore.dylib`function signature specialization <preserving fragile attribute, Arg[1] = Exploded> of Swift._assertionFailure (Swift.StaticString, Swift.String, file : Swift.StaticString, line : Swift.UInt, flags : Swift.UInt32) -> Swift.Never + 164 frame #1: 0x00000001003947a4 Client`TabManager.getTabForURL(url="https://github.com/mozilla-mobile/focus-android/issues/377", self=0x000000017011e720) -> Tab? at TabManager.swift:513 frame #2: 0x000000010040aff4 Client`BrowserViewController.switchToTabForURLOrOpen(url="https://github.com/mozilla-mobile/focus-android/issues/377", isPrivate=false, isPrivileged=true, self=0x000000010e096200) -> () at BrowserViewController.swift:1051 frame #3: 0x000000010041e24c Client`BrowserViewController.(url="https://github.com/mozilla-mobile/focus-android/issues/377", self=0x000000010e096200) -> ()).(closure #1) at BrowserViewController.swift:1855 frame #4: 0x000000010026dde0 Client`SpotlightHelper.userActivityWasContinued(userActivity=0x0000000170037280, self=0x0000000170472a80) -> () at SpotlightHelper.swift:112 frame #5: 0x000000010026de48 Client`@objc SpotlightHelper.userActivityWasContinued(NSUserActivity) -> () at SpotlightHelper.swift:0 frame #6: 0x000000019aa98d2c UserActivity`__54-[UAUserActivity(Internal) didSynchronizeUserActivity]_block_invoke + 640 frame #7: 0x0000000103385a50 libdispatch.dylib`_dispatch_call_block_and_release + 24 frame #8: 0x0000000103385a10 libdispatch.dylib`_dispatch_client_callout + 16 frame #9: 0x00000001033957dc libdispatch.dylib`_dispatch_root_queue_drain + 980 frame #10: 0x000000010339539c libdispatch.dylib`_dispatch_worker_thread3 + 140 frame #11: 0x0000000187fdb1d0 libsystem_pthread.dylib`_pthread_wqthread + 1096 frame #12: 0x0000000187fdad7c libsystem_pthread.dylib`start_wqthread + 4 extension SpotlightHelper: NSUserActivityDelegate { @objc func userActivityWasContinued(_ userActivity: NSUserActivity) { if let url = userActivity.webpageURL { createNewTab?(url) } } }
Pretty sure this crashes when a user attempts to AirDrop a URL to desktop .... checking
Yep. On activating an AirDropped tab (tap Safari on your dock on the far left) on desktop we crash. 2017-04-04 14:56:36.455112-0400 Client[675:161098] -canOpenURL: failed for URL: "org-appextension-feature-password-management://" - error: "The operation couldn’t be completed. (OSStatus error -10814.)" assertion failed: file /Users/aaronmt/Mozilla/firefox-ios/Client/Frontend/Browser/TabManager.swift, line 513 2017-04-04 14:56:54.725840-0400 Client[675:161250] assertion failed: file /Users/aaronmt/Mozilla/firefox-ios/Client/Frontend/Browser/TabManager.swift, line 513 => Visit a site => Share | AirDrop to your Mac => Activate tab on your Mac
Summary: Crash in Client TabManager.getTabForURL → Crash in Client TabManager.getTabForURL (via AirDrop tab activation on Mac)
Priority: -- → P1
Summary: Crash in Client TabManager.getTabForURL (via AirDrop tab activation on Mac) → Crash in Client TabManager.getTabForURL (via Handoff tab activation on Mac)
This crashed for me on Beta 7.2 as well.
I also managed to reproduce this issue on latest master 19e2316c9 when sending tabs via Handoff from iOS device to MacBook or when sending tabs via Handoff between two iOS devices.
Blocks: 1109806
This is not 'handoff'. This is about Air Drop. We should fix this, but this is separate for the handoff story. So I am removing this bug from the handoff bug 1109806
No longer blocks: 1109806
Summary: Crash in Client TabManager.getTabForURL (via Handoff tab activation on Mac) → Crash in Client TabManager.getTabForURL when using Air Drop to send tab to Mac
Aaron, can you explain the STR in a bit more detail? I can't reproduce this crash. What exactly does 'Activate tab on your Mac' mean? What browser? What do you do? I'm asking because this works for me, I see the following happening: - Share current tab to my Mac. I am logged in with the same account on both - On my Mac Nightly is the default browser - When Nightly is in the foreground, it immediately receives the tab and opens it - When Nightly is in the background, it comes to the foreground and opens a new tab What do you mean with 'Activate tab on your Mac' ?
Flags: needinfo?(aaron.train)
I also tried sending this to my personal Mac, which uses another AppleID. There the tabs do not automatically open. I get a notification with Decline and Accept options. Both work as expected with no crashes. Is it possible that something changed in iOS 10.3.2 or macOS 10.12.5 recently that fixed this crash?
Ok this bug is really confusing. The stack trace is for Handoff, but the STR in comment #2 is for Air Drop. Actually, I don't know what the STR is for. It sounds like both Handoff and Air Drop are part of the STR, which makes no sense since they are different things.
Summary: Crash in Client TabManager.getTabForURL when using Air Drop to send tab to Mac → Crash in Client TabManager.getTabForURL after Handoff to Mac
This patch fixes a crash that happens after you Handoff a page to Desktop. The crash is in the`userActivityWasContinued` delegate method because that is called from a non-Main thread and we have an assertion in there to check for that. But that is not actually the real problem here. The description of this delegate method says: > Notifies the delegate that the user activity was continued on another device. We don't care about that, there is nothing actionable for us to do. We actually try to open the URL that was transferred to Desktop. That makes no sense, since we provided it, it is already open in the last tab that you saw. So I simply removed the whole delegate because I don't think we need it.
Assignee: nobody → sarentz
Attachment #8871715 - Flags: review?(jhugman)
Iteration: --- → 1.22
Whiteboard: [MobileCore][needsuplift]
Here is a proper STR: - Have your iOS and macOS device setup with iCloud and the same AppleID. Must be on same WiFi and possibly have Bluetooth enabled on both. - Open some random page - Lock your device - On your Mac, open the page via Handoff (leftmost icon on your Dock) Expected: Safari :-( opens the page. No crash after the attached PR. This is unrelated to Air Drop.
Status: NEW → ASSIGNED
Flags: needinfo?(aaron.train)
Landed after r+ from sdaswani on Github. Also uplifted to v8.x
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Whiteboard: [MobileCore][needsuplift] → [MobileCore]
Verifying as fix on master 1e402a610.
Verifying as fix on 8.0b3672. Firefox no longer crashes when using handoff.
Status: RESOLVED → VERIFIED
Comment on attachment 8871715 [details] [review] Link to Github pull-request: https://github.com/mozilla-mobile/firefox-ios/pull/2859 r+d by :sdaswani
Attachment #8871715 - Attachment description: PR https://github.com/mozilla-mobile/firefox-ios/pull/2768 → Link to Github pull-request: https://github.com/mozilla-mobile/firefox-ios/pull/2859
Attachment #8871715 - Flags: review?(jhugman)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: