Last Comment Bug 702556 - JS exception "aTabs[0].linkedBrowser is null" in nsSessionStore.js
: JS exception "aTabs[0].linkedBrowser is null" in nsSessionStore.js
Status: RESOLVED FIXED
:
Product: Firefox
Classification: Client Software
Component: Session Restore (show other bugs)
: Trunk
: All All
: -- normal (vote)
: Firefox 11
Assigned To: Paul O'Shannessy [:zpao] (not reading much bugmail, email directly)
:
Mentors:
Depends on:
Blocks: 698565 703176 886116
  Show dependency treegraph
 
Reported: 2011-11-15 02:54 PST by Cameron McCormack (:heycam)
Modified: 2013-06-23 06:17 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v0.1 (1.41 KB, patch)
2011-11-15 17:09 PST, Paul O'Shannessy [:zpao] (not reading much bugmail, email directly)
dietrich: review+
Details | Diff | Splinter Review

Description Cameron McCormack (:heycam) 2011-11-15 02:54:12 PST
During a few browser chrome mochitests, we get messages like the following in the log:

TEST-INFO | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser/browser_588426.js | Console message: [JavaScript Error: "aTabs[0].linkedBrowser is null" {file: "resource:///components/nsSessionStore.js" line: 2982}]

(This is currently not reported as a test failure, although some local patches I have cause it to be.)
Comment 1 Paul O'Shannessy [:zpao] (not reading much bugmail, email directly) 2011-11-15 16:39:16 PST
I see what the problem is there... Fallout from changing the way we store some data. In this case __SS_tabStillLoading is now on the tab's browser instead of put into tabData so we're checking a less safe place (which in this case doesn't exist).
Comment 2 Paul O'Shannessy [:zpao] (not reading much bugmail, email directly) 2011-11-15 17:09:00 PST
Created attachment 574745 [details] [diff] [review]
Patch v0.1

I think I got that logic right...
Comment 3 Cameron McCormack (:heycam) 2011-11-17 15:12:52 PST
Confirmed in https://tbpl.mozilla.org/?tree=Try&rev=f031662ebeb9 that this avoids the JS error.
Comment 4 Dietrich Ayala (:dietrich) 2011-11-18 22:50:45 PST
Comment on attachment 574745 [details] [diff] [review]
Patch v0.1

Review of attachment 574745 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/components/sessionstore/src/nsSessionStore.js
@@ +2982,5 @@
>      function sss_restoreHistory(aWindow, aTabs, aTabData, aIdMap, aDocIdentMap) {
>      var _this = this;
> +    // if the tab got removed before being completely restored, then skip it
> +    while (aTabs.length > 0 && (!aTabs[0].parentNode || !aTabs[0].linkedBrowser ||
> +                                !aTabs[0].linkedBrowser.__SS_tabStillLoading)) {

can you bust this out into a isFullyRestored (or whatever it makes sense to call it) helper? that would be far more explicit and readable. r=me with that change.
Comment 5 Paul O'Shannessy [:zpao] (not reading much bugmail, email directly) 2011-11-28 13:12:50 PST
https://hg.mozilla.org/integration/fx-team/rev/b71dae458e87
Comment 6 Tim Taubert [:ttaubert] 2011-11-29 21:58:45 PST
https://hg.mozilla.org/mozilla-central/rev/b71dae458e87

Note You need to log in before you can comment on or make changes to this bug.