Session Restore Not working with corrupted sessionstore file - SessionStartup: ... un-parse-able JSON: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

UNCONFIRMED
Unassigned
(NeedInfo from)

Status

()

Firefox
Session Restore
--
critical
UNCONFIRMED
4 years ago
2 years ago

People

(Reporter: Ksec, Unassigned, NeedInfo)

Tracking

31 Branch
x86_64
Windows 8.1
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0 (Beta/Release)
Build ID: 20140616143923

Steps to reproduce:

Firefox Improper Shutdown, Crashes, etc sometimes lost the session restore. This has happen not only on the latest branch but on all previous branch as well. I have had this issues for over 6 months with well over a dozen of this incident. I tried replacing sessionrestore.js with its .bak and it doesn't work either. 

I have the sessionrestore.bak file if it helps, but i am skeptical of uploading publicly here because it may contains personal information.
(Reporter)

Updated

4 years ago
Component: Untriaged → Session Restore

Comment 1

4 years ago
start with the bad sessionstore.js, and what do you see in the error console, ctrl+shift+J ??
Severity: normal → critical
Flags: needinfo?(edchick)
(Reporter)

Comment 2

4 years ago
Arh, I didn't know the JS Console shows the error message.

SessionStartup: The session file contained un-parse-able JSON: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

Turns out the file was corrupted ( Should that happened? ). Tried using both Windows Built in Editor and Sublime Text, it was either all blank or showing all zeros on Sublime Text.

Tried another sessionstore.bak with a timestamp at the end. Renamed it as sessionstore.js. It only shows the Pinned Tab. Turns out I had to click Restore Previous Session on the about:homepage for it to load.
Flags: needinfo?(edchick)
(Reporter)

Comment 3

4 years ago
Here it is again. This time the sessionstore.bak clearly has all the info. I renamed its extention to .js and Firefox does not start the session restore nor does it even give me the option to Restore Previous Sessions.

Error Console message below.

Could not read chrome manifest 'file:///C:/Program%20Files%20(x86)/Mozilla%20Firefox/chrome.manifest'.
mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create Preferences.jsm:378
Could not read chrome manifest 'file:///C:/Program%20Files%20(x86)/Mozilla%20Firefox/browser/extensions/%7B972ce4c6-7e08-4474-a285-3208198ce6fd%7D/chrome.manifest'.
Key event not available on some keyboard layouts: key="c" modifiers="accel,alt" browser.xul
mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create sync.js:112
1406710976351	Sync.Tracker.Addons	WARN	Changed IDs file addons contains non-object value.
1406710977643	Services.HealthReport.HealthReporter	WARN	No prefs data found.

Comment 4

4 years ago
Dup of bug 1015753?
(Reporter)

Comment 5

4 years ago
No, Bug 1015753 is different. Although i have encountered it a few times over the years.

Although the bug did give me hints to manually go to about:sessionrestore myself. But i just tried, even the file was properly in place, about:sessionrestore doesn't shown anything.
(Reporter)

Comment 6

4 years ago
If any Mozilla Dev need the file i can send it over via email.
(Reporter)

Comment 7

4 years ago
After a lot of digging, Basically it turns out to be two problems. 

When Firefox crash, hang, or you force close it, the sessionrestore.js get corrupted either with
1. The whole js files are full of empty strings or zeros, I have had two instance of this happened. 
2. Looking back at all my previous saved sessionrestore backup files, all of them had 

{"windows":[],"selectedWindow":0,"_closedWindows":[

At the start of the file. Which is what caused the empty sessionrestore window.

A search on google and Mozillazine shows similar problem date back as early as 2010.      

I think a lot of the sessionrestore problem reported are basically what i reported here. But i have no idea why it was corrupted or the code was misplaced.

Comment 8

2 years ago
Ksec, have you seen this problem in the past year, or have the means to reproduce?
Flags: needinfo?(edchick)
Summary: Session Restore Not working → Session Restore Not working with corrupted sessionstore file - SessionStartup: ... un-parse-able JSON: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

Updated

2 years ago
See Also: → bug 1015753

Updated

2 years ago
See Also: → bug 668359
You need to log in before you can comment on or make changes to this bug.