Session tab replaced with about:newtab if session manually restored too early after startup
Categories
(Firefox :: Session Restore, defect, P2)
Tracking
()
Fission Milestone | M5 |
Tracking | Status | |
---|---|---|
firefox-esr60 | --- | unaffected |
People
(Reporter: alice0775, Assigned: mconley)
References
Details
(Keywords: regression)
Attachments
(1 file)
78.92 KB,
text/plain
|
Details |
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Reporter | ||
Comment 3•6 years ago
|
||
Reporter | ||
Comment 4•6 years ago
|
||
Reporter | ||
Comment 6•6 years ago
|
||
Reporter | ||
Comment 7•6 years ago
|
||
Reporter | ||
Comment 9•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Reporter | ||
Comment 11•6 years ago
|
||
Updated•6 years ago
|
Reporter | ||
Updated•6 years ago
|
Assignee | ||
Comment 12•6 years ago
|
||
I'm having quite a bit of difficulty reproducing this, even on my slower Windows machine.
Alice, if you have a second, can you show me a screen capture of you hitting the bug?
Reporter | ||
Comment 13•6 years ago
|
||
(In reply to Mike Conley (:mconley) (:⚙️) from comment #12)
I'm having quite a bit of difficulty reproducing this, even on my slower
Windows machine.Alice, if you have a second, can you show me a screen capture of you hitting
the bug?
I can still reproduce the issue easily on Nightl66.0a1.
However, It is not reproduce when screen capture software is running. So, I cannot attach screen cast.
Reporter | ||
Comment 14•6 years ago
|
||
okay, I got screen capture, but it is low quality.
Screencast: https://youtu.be/FYdmMFyi4e4
Assignee | ||
Comment 15•6 years ago
|
||
(In reply to Alice0775 White from comment #14)
okay, I got screen capture, but it is low quality.
Screencast: https://youtu.be/FYdmMFyi4e4
Thanks! I'll start working on this tomorrow.
Reporter | ||
Comment 16•6 years ago
|
||
The problem seems to be no longer reproducible in normal use.
It just happens if Nightly updated when browser startup. Because, in that case, it takes longer time to display the default Home Tab.
Assignee | ||
Comment 18•6 years ago
|
||
I'm having no luck reproducing this still.
Alice, if you're able to reproduce this semi-reliably, the next time this happens, can you please open the Browser Console, and copy the output message from this command:
SessionStore.getWindowState(window);
and then paste it here in a new comment?
Reporter | ||
Comment 19•6 years ago
|
||
The following error is shown in Browser console Before execution the |SessionStore.getWindowState(window);| :
Must reset tab before calling restoreTab. SessionStore.jsm:3821
restoreTab resource:///modules/sessionstore/SessionStore.jsm:3821
restoreTabs resource:///modules/sessionstore/SessionStore.jsm:3805
ssi_restoreWindow resource:///modules/sessionstore/SessionStore.jsm:3599
_restoreWindowsFeaturesAndTabs resource:///modules/sessionstore/SessionStore.jsm:3679
_restoreWindowsInReversedZOrder resource:///modules/sessionstore/SessionStore.jsm:3696
ssi_restoreLastSession resource:///modules/sessionstore/SessionStore.jsm:2918
And result of |SessionStore.getWindowState(window);|:
SessionStore.getWindowState(window);
"{"windows":[{"tabs":[{"entries":[{"url":"http://archive.mozilla.org/pub/firefox/candidates/","title":"Directory Listing: /pub/firefox/candidates/","cacheKey":0,"ID":0,"docshellUUID":"{9ea5a670-9513-4083-93a7-26221a46db7b}","originalURI":"http://archive.mozilla.org/pub/firefox/candidates/","resultPrincipalURI":null,"principalToInherit_base64":"vQZuXxRvRHKDMXv9BbHtkAAAAAAAAAAAwAAAAAAAAEYAAAA4bW96LW51bGxwcmluY2lwYWw6e2ExMzE5Y2Y5LTgzNTUtNGMwNy04ZDA4LTFkYTEyMzZlYjJkN30AAAAA","triggeringPrincipal_base64":"SmIS26zLEdO3ZQBgsLbOywAAAAAAAAAAwAAAAAAAAEY=","docIdentifier":0,"persist":true}],"lastAccessed":1548114080213,"hidden":false,"attributes":{},"index":1,"userContextId":0,"userTypedValue":"","userTypedClear":0,"image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAVFBMVEUAAAAEBAQzAAAMDAxmAAAWFhaAAACZAAAiIiKZADMAMwDMAADMADMzMwAzMzP/AABmMzOZMwDMMwBVVVX/MwBmZmZ3d3eGhoagoKTAwMDx8fH///++0uXOAAAAAXRSTlMAQObYZgAAAIpJREFUGBl1wdESATEMBdCbNJIS9rJLq/b//5Mxs8YD5+CnXnXqA5vHpBlpqgNvd7Ewv7rVgjcRY87hx6UGXqRLkG5zkGkDWIvODJIeSUaF9CCdpJaFzDPWqkF10lXbOQwyijPpznRrhxtWKUEyd7q0/ekOSB/qZGrDpinpl4qPMQVTF3wZ7uWGP57dswcg5Jr0LgAAAABJRU5ErkJggg=="},{"entries":[{"url":"about:home","title":"New Tab","cacheKey":0,"ID":0,"docshellUUID":"{fda9c30e-4b7c-47ab-9311-70e70ea4d85c}","resultPrincipalURI":null,"principalToInherit_base64":"vQZuXxRvRHKDMXv9BbHtkAAAAAAAAAAAwAAAAAAAAEYAAAA4bW96LW51bGxwcmluY2lwYWw6ezY4ZDNkYjVlLWUxMGYtNGMzZC04Yzc5LWFjZTE3MWQzYjhmZn0AAAAA","triggeringPrincipal_base64":"SmIS26zLEdO3ZQBgsLbOywAAAAAAAAAAwAAAAAAAAEY=","docIdentifier":0,"persist":true}],"lastAccessed":1548114143243,"hidden":false,"attributes":{},"userContextId":0,"index":1,"userTypedValue":"","userTypedClear":0,"image":"chrome://branding/content/icon32.png"}],"selected":2,"_closedTabs":[{"state":{"entries":[{"url":"about:home","title":"New Tab","cacheKey":0,"ID":0,"docshellUUID":"{5597a6e4-2470-4707-8c72-ea026be28c4c}","resultPrincipalURI":null,"principalToInherit_base64":"vQZuXxRvRHKDMXv9BbHtkAAAAAAAAAAAwAAAAAAAAEYAAAA4bW96LW51bGxwcmluY2lwYWw6ezBlNmFmNGM5LWYwZDEtNGJhMy1hMmY4LWM1MWQ3MTg2YzllYX0AAAAA","triggeringPrincipal_base64":"SmIS26zLEdO3ZQBgsLbOywAAAAAAAAAAwAAAAAAAAEY=","docIdentifier":0,"persist":true}],"lastAccessed":1548114076836,"hidden":false,"attributes":{},"userContextId":0,"index":1,"userTypedValue":"","userTypedClear":0,"image":"chrome://branding/content/icon32.png"},"title":"New Tab","image":"chrome://branding/content/icon32.png","pos":0,"closedAt":1548114078832,"closedId":0}],"busy":false,"width":1526,"height":955,"screenX":246,"screenY":64,"sizemode":"maximized","zIndex":1}]}"
Assignee | ||
Comment 20•6 years ago
|
||
Hm, that's interesting... okay, thanks Alice, I have one more diagnostic thing for you to try.
After you restart the browser, but before you restore the session, can you run:
SessionStore.getCurrentState();
Right-click on the result, choose "Copy Object", and paste it in a comment here?
Reporter | ||
Comment 21•6 years ago
|
||
Reporter | ||
Updated•6 years ago
|
Assignee | ||
Comment 22•6 years ago
|
||
Assignee | ||
Comment 23•6 years ago
|
||
Okay, after a bit of study and experimentation, I think I've been able to induce the symptoms of this bug out on my development machine.
Here's what I think is going on:
We have some code who’s job it is to figure out what the homepage should be. That’s _handleURIToLoad in _delayedStartup. It passes a function to _callWithURIToLoad that either calls that function immediately, or (in the bad case), waits for the gBrowserInit.uriToLoadPromise to resolve.
uriToLoadPromise waits for SessionStartup.willOverrideHomepage to resolve, and that only resolves once we both have a session, and have ensured that the CrashMonitor.previousCheckpoints Promise has resolved.
If, in SessionStartup.jsm, this._initialState is set in willOverrideHomepage, that function will return a Promise that only resolves once uriToLoadPromise resolves.
That leaves a window of time where the user can restore the session, but uriToLoadPromise hasn't yet fired. If the user restores the session in that window of time, it gets overwritten by the homepage stuff once uriToLoadPromise resolves.
I have a trypush up with a workaround for Alice to try, just to see if I'm on the right track here. I'll message with build links once I have them.
Assignee | ||
Comment 24•6 years ago
|
||
Hi Alice, I know you said you were having more difficulty reproducing this lately, so I'm not sure if this experiment will work, but is there any chance you could try reproducing the bug with these two builds? I have a fix in there that I think addresses it.
Reporter | ||
Comment 25•6 years ago
|
||
I can syill reproduce. And an error in Browser console.
Must reset tab before calling restoreTab. SessionStore.jsm:3821
restoreTab resource:///modules/sessionstore/SessionStore.jsm:3821
restoreTabs resource:///modules/sessionstore/SessionStore.jsm:3805
ssi_restoreWindow resource:///modules/sessionstore/SessionStore.jsm:3599
_restoreWindowsFeaturesAndTabs resource:///modules/sessionstore/SessionStore.jsm:3679
_restoreWindowsInReversedZOrder resource:///modules/sessionstore/SessionStore.jsm:3696
ssi_restoreLastSession resource:///modules/sessionstore/SessionStore.jsm:2918
And I found a reliable STR.
-
Start the previous m-i build with new profile
-
Enable Menubar
-
Restart the browser.
-
If default browser dialog pops up, disable it.
-
Open http://ftp.mozilla.org/pub/firefox/nightly/ in tab 1
-
Load http://ftp.mozilla.org/pub/firefox/nightly/ in the tab 2
-
Wait for page loading and then wait another 15 seconds
-
Quit the browser
-
Start a new m-i build
-
When Menubar is ready, Click History –> Restore Previous Session
Assignee | ||
Comment 27•6 years ago
|
||
Fwiw, I do think this error message is the key to the mystery:
restoreTab resource:///modules/sessionstore/SessionStore.jsm:3821
restoreTabs resource:///modules/sessionstore/SessionStore.jsm:3805
ssi_restoreWindow resource:///modules/sessionstore/SessionStore.jsm:3599
_restoreWindowsFeaturesAndTabs resource:///modules/sessionstore/SessionStore.jsm:3679
_restoreWindowsInReversedZOrder resource:///modules/sessionstore/SessionStore.jsm:3696
ssi_restoreLastSession resource:///modules/sessionstore/SessionStore.jsm:2918
We're failing to restore the second tab because it's in a weird state. I'm still trying to figure out how else it can get into that state. :/
Assignee | ||
Comment 28•6 years ago
•
|
||
(In reply to Mike Conley (:mconley) (:⚙️) from comment #27)
We're failing to restore the second tab because it's in a weird state. I'm still trying to figure out how else it can get into that state. :/
Okay, I think I see it.
That error message happens because of this:
if (TAB_STATE_FOR_BROWSER.has(browser)) {
Cu.reportError("Must reset tab before calling restoreTab.");
return;
}
So in what cases can TAB_STATE_FOR_BROWSER have that initial browser in there during start-up?
- We’re already restoring that tab via
restoreTab
- We’re in the midst of restoring that tab via a
navigateAndRestore
- We’ve marked that tab via
markTabAsRestoring
, so we’re restoring that tab...
So, I have a new theory:
onLoad
for the initial window fires, and it goes into_setupInitialBrowserAndTab
.- We get the
gBrowserInit.uriToLoadPromise
, and if it’s actually a Promise, because SessionStore is still getting its act together, we make the initial tab the default remoteness type. - So we’ve got an initial tab with a default web content process. Then, SessionStore start-up finishes, and
_callWithURIToLoad
decides to load “about:home”, which causes anavigateAndRestore
. - That
navigateAndRestore
setsTAB_STATE_FOR_BROWSER
for the browser. While we’re waiting for thenavigateAndRestore
to complete is when attempting to restore the last session will fail, because that tab is still in the process of navigating and restoring. That means that the about:home load will continue. - So, ultimately, there’s a slow
navigateAndRestore
going on, and then if a restore last session occurs during that window, it’ll get ignored for the tabs stillnavigateAndRestore
-ing.
Fixes:
- Short-term fix is to make the initial tab start with the remoteness of about:home if
uriToLoadPromise
is in fact a Promise. - Longer-term fix is to make session restoration blow away state such that any
navigateAndRestore
’s are cancelled.
I'll put together a try-build for (1), and if that works, try to get that landed, and then file a follow-up for (2).
Assignee | ||
Comment 29•6 years ago
|
||
Assignee | ||
Comment 30•6 years ago
|
||
Hi Alice, I have a new build for you to try:
Are you able to reproduce the issue with this one?
Reporter | ||
Comment 31•6 years ago
|
||
The try build works as expected with STR comment#25.
I can no longer reproduce the issue :)
https://hg.mozilla.org/try/rev/62dad6ffcb269f90e615ce75ce533409601b2e59
Assignee | ||
Comment 32•6 years ago
|
||
This bug relies on the privileged content process, which is held to Nightly right now. Dropping the 66 tracking flag.
Reporter | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Reporter | ||
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•5 years ago
|
Comment 33•5 years ago
|
||
Mike, can you confirm that this is disabled in 68 and still a nightly-only bug? Thanks
Assignee | ||
Comment 34•5 years ago
|
||
This is still held to Nightly-only, and is still a Nightly-only bug.
Comment 35•5 years ago
|
||
Roll some unfixed bugs from Fission Milestone M4 to M5
0ee3c76a-bc79-4eb2-8d12-05dc0b68e732
Assignee | ||
Comment 36•5 years ago
|
||
Hi Alice0775 White,
I'm hoping to try turning on browser.tabs.remote.separatePrivilegedContentProcess
again soon. If you flip that preference in Nightly and restart the browser, are you still able to reproduce this bug?
Reporter | ||
Comment 37•5 years ago
|
||
(In reply to Mike Conley (:mconley) (:⚙️) from comment #36)
Hi Alice0775 White,
I'm hoping to try turning on
browser.tabs.remote.separatePrivilegedContentProcess
again soon. If you flip that preference in Nightly and restart the browser, are you still able to reproduce this bug?
@Mike,
Sorry, I forgot to pay attention to this bug.
In recent builds, there is a delay (1-2 seconds) for the menu"Restore Previous Session" to be enabled from disable state.
So, this bug can no longer be reproduced with default settings...
I should change bug status to WORKSFORME.
Assignee | ||
Comment 38•5 years ago
|
||
Hi Alice0775 White,
Thank you. We've recently re-enabled the separate privileged about content process in Nightly. If you end up seeing this bug again now that it's enabled, please re-open.
Thank you!