Bug 61255 - FILEOPEN: File opening shows that file is corrupted when /tmp is full, locked file afterwards
Summary: FILEOPEN: File opening shows that file is corrupted when /tmp is full, locked...
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) release
Hardware: Other Linux (All)
: medium normal
Assignee: Not Assigned
Whiteboard: BSA
Depends on:
Blocks: Desktop-Environment
  Show dependency treegraph
Reported: 2013-02-22 00:41 UTC by Rodolfo Quesada
Modified: 2021-03-23 00:04 UTC (History)
0 users

See Also:
Crash report or crash signature:
Regression By:

LibreOffice Error when opening a file and /tmp is full. (5.46 KB, image/png)
2016-04-16 19:26 UTC, Rodolfo Quesada

Note You need to log in before you can comment on or make changes to this bug.
Description Rodolfo Quesada 2013-02-22 00:41:32 UTC
Problem description: I tried to open a spreadsheet file unaware that my /tmp directory was full (a ramdisk), so LibreOffice showed me a dialog that said that the file is corrupted and it should attempt to fix it and to not trust the contents afterwards. It was unable to do so. 

I cleaned my /tmp directory and then proceeded to copy the file to another location and it opened without any issue and intact details. 

Also, a ".lock....name_of_file" locked the filename in the directory and I needed to remove it manually in order to have a file with the same name as the locked file. 

Steps to reproduce:
1. Fill the /tmp partition/directory (this is common in distributions as ArchLinux that uses a ramdisk, otherwise the hard drive should be full)
2. Open a file
3. Errors will appear and the .lock file should be removed manually. 

Current behavior: A lock file blocks the manipulation of a file with the same filaname in the same directory. LO says that the file is corrupted but it isn't. 

Expected behavior: It shouldn't say that the file is corrupted if the error is LO unable to create a temporary file in /tmp (I guess that's what happened). A lock file should be removed if there isn't an open session. 

Thanks for a great product and the amazing work you guys have done!

Operating System: Linux (Other)
Version: release
Comment 1 Michael Meeks 2013-03-01 18:44:22 UTC
I've seen problems like this when low on space. There are so many potential failure modes - that IMHO we should check free-space and warn before doing any load/save of this kind - as well as improving this warning.

Thanks for the report :-)
Comment 2 QA Administrators 2015-02-19 15:34:53 UTC Comment hidden (obsolete)
Comment 3 Michael Meeks 2015-03-07 17:04:32 UTC
Not sure if it's still alive; but we should certainly have some unit tests for this scenario - hopefully we can simulate them in various ways.

Perhaps there is some better way we can warn people of low-space on our /tmp folders - if it's sub size-of-document*2 or something then there is likely to be an issue.
Comment 4 tommy27 2016-04-16 07:24:22 UTC Comment hidden (obsolete)
Comment 5 Rodolfo Quesada 2016-04-16 19:26:23 UTC
Created attachment 124414 [details]
LibreOffice Error when opening a file and /tmp is full.
Comment 6 Rodolfo Quesada 2016-04-16 19:32:39 UTC
Bug is still present in: 

Build ID: Arch Linux build-1
CPU Threads: 4; OS Version: Linux 4.5; UI Render: default; 
Locale: en-US (en_US.utf8)

How to reproduce: 

1) Fill /tmp (dd if=/dev/zero of=/tmp/zero.zero)
2) Try to open any file in LO
3) Error will appear (attached to thread).
4) Clear /tmp
5) Try to open the same file, it is now locked
6) Remove .~lock.<filename>.odt# 
7) It works again
Comment 7 QA Administrators 2017-05-22 13:25:17 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2020-10-26 04:12:56 UTC Comment hidden (obsolete)
Comment 9 Svatopluk Vít 2021-03-19 14:08:30 UTC
Bug is not present in

Version: / LibreOffice Community
Build ID: fe0b08f4af1bacafe4c7ecc87ce55bb426164676
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: kf5
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded
Comment 10 Rodolfo Quesada 2021-03-23 00:04:19 UTC
Just tested again, bug is still present after filling /tmp, I acknowledge it is a corner case, but there is quite a big difference between stating "/tmp is full, and can't open a file due to needing to write something there" and that "The file <filename> is corrupt.... do you want to recover?". 

The steps to reproduce from "Comment 6" still apply. 

Version: / LibreOffice Community
Build ID: 10(Build:2)
CPU threads: 4; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded