Open Bug 619249 Opened 10 years ago Updated 8 years ago

The session file is invalid: TypeError:[0] is undefined


(Firefox :: Session Restore, defect)

9 Branch
Not set





(Reporter: trappmanrhett, Unassigned)



(3 files, 1 obsolete file)

8.94 KB, application/octet-stream
21.62 KB, application/x-javascript
110 bytes, application/x-javascript
User-Agent:       Mozilla/5.0 (Windows NT 6.0; rv:2.0b8pre) Gecko/20101119 Firefox/4.0b8pre
Build Identifier: Mozilla/5.0 (Windows NT 6.0; rv:2.0b8pre) Gecko/20101119 Firefox/4.0b8pre

Upon launching Firefox, I get "SessionStore: The session file is invalid: TypeError:[0] is undefined" in the Error Console.

Reproducible: Sometimes

No apparent data loss.
Version: unspecified → Trunk
I've seen something like this before - It means that somehow you had a session file get saved that had no windows in it.

Do you remember what your state was like when quitting?
Related to bug 401030 maybe?
(In reply to comment #2)
> Related to bug 401030 maybe?

Shouldn't be. That was the result of an incompatible extension.
I had several tabs open, but I closed it like I normally do...
Rhett, could you please elaborate on what "closed it like I normally do" means?  Specifically, can you please provide detailed steps you follow to reproduce this bug?

Also, it might help if we can get a copy of your sessionstore.js file.
Summary: SessionStore: The session file is invalid: TypeError:[0] is undefined → The session file is invalid: TypeError:[0] is undefined
>Rhett, could you please elaborate on what "closed it like I normally do" means?
I used the Red "X" at the top right of Firefox.

I'll upload the sessionstore.js file shortly...
Attached file sessionstore.bak
Attached file Session Store.bak (obsolete) —
Attachment #498446 - Attachment is obsolete: true
Attachment #498445 - Attachment description: Session Store → sessionstore.bak
Attached file sessionstore.js
It appears that both the backup and the current sessionstore.js are valid.
The valid one must have overwritten it since the time of the error.
I'm leaning toward resolving this INCOMPLETE for the time being.  Since the general scenario this would occur in is a window-less session, and a window-less session is extremely hard to create in Windows, this one is going to be hard for most users to stumble upon.

Rhett, please reopen if you can reproduce this bug and attach your broken sessionstore.js.

Closed: 10 years ago
Resolution: --- → INCOMPLETE
Attached file "Empty" session
I'm been getting this lately in Firefox 6 on multiple machines.  Looking at the sessionstore.js file, it ends up blank which technically isn't invalid, there's just no windows since the last closed window was blank.  I'm not sure how it ends up in such a state though. 

I'll mention that when this error occurs, SessionStore does not send out the "sessionstore-windows-restored" or "sessionstore-browser-state-restored" notifications since there is an this._initialState variable so it won't get sent in onLoad, but there's no restored session so it won't get sent in _sendRestoreCompletedNotifications either.  Since my add-on looks for this to indicate the window load has completed, to kick off my secondary processing and it never arrives, my add-on never completes the startup processing.
Ever confirmed: true
Resolution: INCOMPLETE → ---
@morac, is this reproducible on Firefox 9.0a1?
Yes, I can reproduce it in 9.0a1 by using the sessionstore.js file I attached, but generating that isn't reproducible.   I managed to do it once by closing the browser window when there are no open tabs (i.e. only about:blank), but when trying to repeat this I ended up with an "about:blank" element in the windows object.  There might be some kind of timing element or something.

In any case the reason the error occurs with the attached sessionstore.js file is fairly obvious since there is no entry 0 in the windows array as the length is 0.  A check for windows.length > 0 would work around the problem.  It doesn't explain how the sessionstore.js file is generated in the first place though.

On a side note, it looks like the "sessionstore-windows-restored" notification is sent when this error occurs in Firefox 3.6 and 9.0a1, but not in 6.0.2.
Right, I think the root of this bug is that[0] should never be undefined. I will defer to the developers on this one though. Thanks for the added information.
Version: Trunk → 9 Branch
I encountered this today but could save my work by the workaround described in 495123 comment 31.
You need to log in before you can comment on or make changes to this bug.