Closed Bug 1544884 Opened 6 years ago Closed 5 years ago

Power failure causes irreparable corruption to Firefox localStorage

Categories

(Core :: Storage: localStorage & sessionStorage, defect, P2)

67 Branch
defect

Tracking

()

RESOLVED DUPLICATE of bug 1341070

People

(Reporter: Jamtlu, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:67.0) Gecko/20100101 Firefox/67.0

Steps to reproduce:

Used firefox. Power failure occurs while using.

Platform: macOS

Actual results:

localStorage-powered sites fail to load. Exception in console:
Exception { name: "NS_ERROR_FILE_CORRUPTED" }

For example: https://accounts.firefox.com/ says "Cookies are still disabled" when they are in fact enabled. Nothing happens when I press "Next" after entering my email on https://accounts.google.com.

Expected results:

localStorage-powered sites work. Recent writes to localStorage are deleted instead of the half-writes corrupting localStorage.

For example: https://accounts.firefox.com/ allows me to log in. Google allows me to sign in.

This has been an issue for many Firefox releases now, not just 67.0b10.

Workaround/Additional Information: Delete the localStorage entries of the sites with corrupted data and everything should return to normal.

Nevermind, this time I had to remove all of my site data to fix the issue.

Hi,
i'm not able to reproduce this behaviour using the latest nightly on Mac OS High Sierra. Is there any other particular that you can kindly provide and reach back to us? How did the power failure occured? Regards. David.

Flags: needinfo?(Jamtlu)
Component: Untriaged → DOM: Web Storage
Product: Firefox → Core

The power failure occurred with a not-working battery. As soon as the plug was pulled out of the laptop, the laptop immediately shut down and its fans slowed to a halt. I am using a Mid-2013 13" Macbook Air.

The first few times this occurred, the corruption was isolated enough that it only affected one or two sites. However the last time it happened, I had to clear all data to fix the issue.

Another detail is that almost every time this happens the "We're having trouble restoring your tabs" screen pops up.

As a side note, safari did not experience this issue when both browsers were alongside each other.

Flags: needinfo?(Jamtlu)

Thanks for the report! I wonder if it's improved with our new localStorage implementation. Jan, what do you think?

Blocks: 1540402
Flags: needinfo?(jvarga)
Priority: -- → P2

This looks like bug 1341070 and yes, new localStorage should handle it much better.

Flags: needinfo?(jvarga)
Depends on: 1539835

I'm duping over to the error handling bug, but this is perhaps suggestive that we should be thinking about ensuring we have telemetry tracking corruption in our SQLite databases and using it to inform whether we need to up the PRAGMA SYNC level for certain generations of Mac hardware/filesystems. Per https://support.apple.com/kb/SP678?locale=en_US the mid-2013 13" macbook air had flash, suggesting this is likely to be specific to the combination of filesystem and flash controller (and possibly also a factor of how full the disk was). Presumably newer hardware will exhibit different performance characteristics in terms of power loss.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
No longer blocks: 1540402
You need to log in before you can comment on or make changes to this bug.