Closed Bug 1407830 Opened 8 years ago Closed 8 years ago

RDM breaks after opening/closing a few times

Categories

(DevTools :: Responsive Design Mode, defect, P1)

x86_64
All
defect

Tracking

(firefox56 wontfix, firefox57 wontfix, firefox58 verified)

VERIFIED FIXED
Firefox 58
Tracking Status
firefox56 --- wontfix
firefox57 --- wontfix
firefox58 --- verified

People

(Reporter: Harald, Assigned: jryans)

References

Details

(Whiteboard: [designer-tools])

Attachments

(3 files)

Reproduced on both Google Slides & Google Docs. STR: - Open/close RDM with shortcut a few times (tried AR: - Tab content after a few refreshs the RDM viewport doesn't render. - Then disabling RDM again removes the RDM but the whole page stays white and doesn't react to anything (shortcuts, pressing refresh button). Focusing the awesomebar and hitting enter doesn't do anything. - RDM shortcut still works, switches back between RDM/No-RDM, always showing white content Browser console: TypeError: zoom is undefined[Learn More] viewZoomOverlay.js:47:5 TypeError: win.gBrowser is undefined[Learn More] ZoomUI.jsm:69:1 this.browser is null ext-tabs-base.js:298 TypeError: win.gBrowser is undefined[Learn More] ZoomUI.jsm:69:1 TypeError: zoom is undefined[Learn More] viewZoomOverlay.js:47:5 TypeError: win.gBrowser is undefined[Learn More] ZoomUI.jsm:69:1 this.browser is null ext-tabs-base.js:298 TypeError: win.gBrowser is undefined[Learn More] ZoomUI.jsm:69:1
Thanks for filing! Have you noticed this only on Windows, or other platforms too?
Flags: needinfo?(hkirschner)
Okay, I can reproduce on macOS as well. It's not necessary to use a complex web app. A static site like https://www.mozilla.org/en-US/ is fine as well. The strange part is that (for both macOS and Windows), I can only reproduce this with official builds. If I build locally (even from an artifact build), I _cannot_ reproduce. Still not sure what's going on yet, but at least there's a configuration that reproduces for me.
Assignee: nobody → jryans
Status: NEW → ASSIGNED
Flags: needinfo?(hkirschner)
OS: Windows 10 → All
Okay, I think I've got a fix for this issue. I believe the main difference between local vs. official builds is that I typically use `--enable-debug-js-modules` locally, which means the dev build of React (among other things). This appears to be slow enough that it's quite hard to trigger the problem. Removing that setting makes it more likely with a local build. (I have now triggered it locally on both Windows and macOS.)
Attachment #8918522 - Flags: review?(poirot.alex) → review+
Comment on attachment 8918523 [details] Bug 1407830 - Verify that RDM swaps take place. https://reviewboard.mozilla.org/r/189386/#review194782 ::: devtools/client/responsive.html/browser/swap.js:86 (Diff revision 1) > + // So, here we do our own check to verify that the swap actually did in fact take place, > + // making it much easier to track such errors when they happen. > + let swapBrowserDocShells = (ourTab, otherBrowser) => { > + // The verification step here assumes both browsers are remote. > + if (!ourTab.linkedBrowser.isRemoteBrowser || !otherBrowser.isRemoteBrowser) { > + throw new Error("Both browsers should be remote before swapping."); I thought everyting had to be remote anyway? Don't we check this before, or is it because it could be lazy? ::: devtools/client/responsive.html/browser/swap.js:92 (Diff revision 1) > + } > + let contentTabId = ourTab.linkedBrowser.frameLoader.tabParent.tabId; > + gBrowser._swapBrowserDocShells(ourTab, otherBrowser); > + if (otherBrowser.frameLoader.tabParent.tabId != contentTabId) { > + // Bug 1408602: Try to unwind to save tab content from being lost. > + throw new Error("Swapping tab content between browsers failed."); Do you still have STR to make it crash after you apply your third patch?
Attachment #8918523 - Flags: review?(poirot.alex) → review+
Comment on attachment 8918524 [details] Bug 1407830 - Wait for browser during RDM startup. https://reviewboard.mozilla.org/r/189388/#review194792 Crash tested and haven't seen anything wrong except this exception: TypeError: d.contentViewer is null content.js:147:11 Which leads to broken state where you can no longer switch RDM off. I reproduced this by toggling RDM during page reload. (or reloading while RDM while toggling, hard to say) But I also reproduce without this patch.
Attachment #8918524 - Flags: review?(poirot.alex) → review+
Comment on attachment 8918523 [details] Bug 1407830 - Verify that RDM swaps take place. https://reviewboard.mozilla.org/r/189386/#review194782 > I thought everyting had to be remote anyway? > Don't we check this before, or is it because it could be lazy? Yes, RDM already requires remote content in general, and that is checked at an earlier step. I just thought it was helpful to clearly assert that this function expects both browsers to be remote, since the swap process involves various browsers in remote and non-remote modes (the tool UI is loaded non-remote). Non-remote browsers won't have the `tabParent`, so even though they can be swapped in general, this function as written won't verify the swap correctly in that case. > Do you still have STR to make it crash after you apply your third patch? No, the third patch covers the only the failure case I know of. It seems like it would still be nice to unwind where possible, as a precaution against any new problems that might crop up, but not a requirement.
Comment on attachment 8918524 [details] Bug 1407830 - Wait for browser during RDM startup. https://reviewboard.mozilla.org/r/189388/#review194792 I can't seem to reproduce that issue locally, but it does seem like something separate. If you have a clear STR, please let me know / file a new bug!
Pushed by jryans@gmail.com: https://hg.mozilla.org/integration/autoland/rev/b8403c3cf71a Add diagnostics to RDM swap. r=ochameau https://hg.mozilla.org/integration/autoland/rev/4bb7df3fad2d Verify that RDM swaps take place. r=ochameau https://hg.mozilla.org/integration/autoland/rev/7c0cbd30ce36 Wait for browser during RDM startup. r=ochameau
:digitarald, can you please update to the latest Nightly and re-test to see if the issue is now resolved? If possible, please use the same machine and configuration as you did when you first noticed the issue since it can be timing dependent.
Flags: needinfo?(hkirschner)
WFM, could not break it on the same machine.
Flags: needinfo?(hkirschner)
Comment on attachment 8918524 [details] Bug 1407830 - Wait for browser during RDM startup. Approval Request Comment [Feature/Bug causing the regression]: Bug in new Responsive Design Mode, most likely since it's been around (52+) [User impact if declined]: If declined, it's possible for a tab opened in RDM to get wedged in a broken state, causing the tab to become non-responsive. User may have to close the browser window and start over. There is no risk of crash, but work may be lost when a tab / window becomes non-responsive. [Is this code covered by automated tests?]: Yes, this case now triggers an error will cause tests to fail. [Has the fix been verified in Nightly?]: Yes, reporter verified and another reporter also verified in duplicate bug 1307711. [Needs manual test from QE? If yes, steps to reproduce]: No [List of other uplifts needed for the feature/fix]: All patches in this bug. [Is the change risky?]: No [Why is the change risky/not risky?]: I believe it's low risk because it only impacts tabs opened in RDM, and the change is well contained. The change fixes a race condition by explicitly waiting for the RDM viewport to be ready. [String changes made/needed]: None
Attachment #8918524 - Flags: approval-mozilla-beta?
Comment on attachment 8918523 [details] Bug 1407830 - Verify that RDM swaps take place. Approval Request Comment See comment 18.
Attachment #8918523 - Flags: approval-mozilla-beta?
Comment on attachment 8918522 [details] Bug 1407830 - Add diagnostics to RDM swap. Approval Request Comment See comment 18.
Attachment #8918522 - Flags: approval-mozilla-beta?
Comment on attachment 8918522 [details] Bug 1407830 - Add diagnostics to RDM swap. It's not a new regression, not a common scenario, has a workaround (not ideal but better than none). I'd prefer to let this fix ride the 58 train.
Attachment #8918522 - Flags: approval-mozilla-beta? → approval-mozilla-beta-
Attachment #8918523 - Flags: approval-mozilla-beta? → approval-mozilla-beta-
Attachment #8918524 - Flags: approval-mozilla-beta? → approval-mozilla-beta-
Whiteboard: [designer-tools]
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: