Cookies are all gone after Firefox crashes after experiencing a full disk

NEW
Unassigned

Status

()

Core
Networking: Cookies
P3
normal
2 years ago
4 months ago

People

(Reporter: timdream, Unassigned)

Tracking

44 Branch
x86_64
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [necko-backlog])

Happens on Firefox Mac 44.0b6, built from https://hg.mozilla.org/releases/mozilla-beta/rev/9ebad515bc39afdea1e656bf15218a0511a5d1e2

My disk space is running low and Firefox crashes when Mac shows the warning (the crash itself is another bug...), after restart all my cookies are gone and I have to re-login to all services.
OS: Unspecified → Mac OS X
Hardware: Unspecified → x86_64
Version: unspecified → 44 Branch

Updated

2 years ago
Component: Untriaged → Session Restore
It looks like that on any error, the cookie database tries to rebuild itself by nuking the DB and writing out all the cookies again.  (The cookies are all in memory all the time, so this is a thing that can be done.)
https://dxr.mozilla.org/mozilla-central/source/netwerk/cookie/nsCookieService.cpp#340

Unfortunately, if your disk is full and getting actively filled up by some other process, it's likely the following happens:
- SQLite generates a SQLITE_FULL error that gets mapped to an NS_ERROR_FILE_NO_DEVICE_SPACE
- The cookie service error handler tries to create the database anew
- Maybe Firefox crashes?
- It goes to create the database but SQLITE_FULL errors keep happening and so it keeps re-creating things or just gives up or whatever.  I didn't look into this too much.

When the disk is filling up/full, there aren't a lot of good options, but probably the safest one for the cookie service would be to handle the full event and treat it as an "oh well, there's nothing I can do but I definitely won't delete the cookie database".

Unfortunately I'm assuming your full disk scenario might have also resulted in there being no crash in about:crashes?

cc'ing :mak because full-disk crashes are an interesting mozStorage-related thing.
Component: Session Restore → Networking: Cookies
Product: Firefox → Core
Summary: Cookies are all gone after Firefox crashes → Cookies are all gone after Firefox crashes after experiencing a full disk
(In reply to Andrew Sutherland [:asuth] from comment #1)
> Unfortunately I'm assuming your full disk scenario might have also resulted
> in there being no crash in about:crashes?

That's right, no about:crashes :'(
This just happen to me again. Strangely, for the second time, Bugzilla cookie survives.
Whiteboard: [necko-backlog]
You need to log in before you can comment on or make changes to this bug.