Closed Bug 1028717 Opened 10 years ago Closed 3 years ago

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

Categories

(Firefox :: Session Restore, defect)

31 Branch
x86_64
Windows 8.1
defect
Not set
critical

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: edchick, Unassigned, NeedInfo)

References

Details

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.
Component: Untriaged → Session Restore
start with the bad sessionstore.js, and what do you see in the error console, ctrl+shift+J ??
Severity: normal → critical
Flags: needinfo?(edchick)
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)
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.
Dup of bug 1015753?
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.
If any Mozilla Dev need the file i can send it over via email.
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.
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
See Also: → 1015753
See Also: → 668359

Marking this as Resolved > Incomplete as the reporter cannot be contacted for a confirmation of the issue.
If anyone can still repro the issue please re-open it or file a new bug.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.