Closed Bug 1398804 Opened 7 years ago Closed 6 years ago

Profile corruption when running out of disk space. prefs.js is 0 bytes

Categories

(Thunderbird :: Untriaged, defect)

52 Branch
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 597329

People

(Reporter: aheinlein, Unassigned)

Details

(Keywords: dataloss)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
Build ID: 20170808215255

Steps to reproduce:

We have several clients on a network that mount /home via NFS. While several clients were working with thunderbird, someone managed to fill up the entire /home partition.

On another occassion, a client managed to reach his hard quota by downloading something while he had thunderbird open.


Actual results:

Thunderbird freezed, after restarting the profile could not be loaded. The prefs.js inside the profile had 0 bytes. 


Expected results:

Thunderbird should have warned that settings could not be saved because of lack of disk space. prefs.js should have been kept intact with the previous settings.
Unfortunately, bug 597329
Severity: normal → critical
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Keywords: dataloss
Resolution: --- → DUPLICATE
Andreas, was the only file affected prefs.js ?
Flags: needinfo?(aheinlein)
Summary: Profile corruption when running out of disk space → Profile corruption when running out of disk space. prefs.js is 0 bytes
(In reply to Andreas Heinlein from comment #0)
> User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
> Firefox/52.0
> Build ID: 20170808215255
> 
> Steps to reproduce:
> 
> We have several clients on a network that mount /home via NFS. While several
> clients were working with thunderbird, someone managed to fill up the entire
> /home partition.
> 
> On another occassion, a client managed to reach his hard quota by
> downloading something while he had thunderbird open.
> 
> 
> Actual results:
> 
> Thunderbird freezed, after restarting the profile could not be loaded. The
> prefs.js inside the profile had 0 bytes. 
> 
> 
> Expected results:
> 
> Thunderbird should have warned that settings could not be saved because of
> lack of disk space. prefs.js should have been kept intact with the previous
> settings.

This sounds very much like the problems caused by the
lack of checks of return code from low-level I/O routines :-(
I am not sure if my pending patches addresses this pref.js issue.
(I have been more or concerned with the message and attachment writing failures: it certainly tried to detect this filled-up file storage, even for local file system. But I am not sure if I have tested prefs.js problem. It could be written in a different path.)
(In reply to Wayne Mery (:wsmwk) from comment #2)
> Andreas, was the only file affected prefs.js ?

I can't say for sure. Since the profile was damaged anyway, I restored from backup and didn't care about other files. I would have to reproduce the problem to see.
Flags: needinfo?(aheinlein)
> This sounds very much like the problems caused by the
> lack of checks of return code from low-level I/O routines :-(
> I am not sure if my pending patches addresses this pref.js issue.
> (I have been more or concerned with the message and attachment writing
> failures: it certainly tried to detect this filled-up file storage, even for
> local file system. But I am not sure if I have tested prefs.js problem. It
> could be written in a different path.)

It is probably difficult to detect this case beforehand. AFAIK, reaching hard quota on NFS cannot be easily detected. At least 'df' won't tell you, and if I try to copy a 1GB file to a mounted NFS share with 100KB of quota left, GNOME won't complain but will start copying until full.

I am not really a programmer, but to me it seems the best approach would be to first write the new preferences to a new file prefs.js.tmp, and if that succeeds, remove prefs.js and rename prefs.js.tmp to prefs.js
You need to log in before you can comment on or make changes to this bug.