chrsmithdemos / leveldb

Automatically exported from code.google.com/p/leveldb
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

leveldb segfaulting when no available disk space #219

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. sudo mount -t tmpfs tmpfs /tmp/leveldb -o size=500k
2. compile test program (see attachment): cd build && cmake 
-DCMAKE_BUILD_TYPE=debug ..
3. Run test program: build/src/leveldb /tmp/leveldb

What is the expected output? What do you see instead?
When not enought disk space, leveldb should return error on any "put" operation.
Segfaulting is not good idea:

What version of the product are you using? On what operating system?
Re-producible bug at versions:
1. 0b9a89f Release LevelDB 1.14
2. Release: LevelDB 1.14.0 (re-check from archive sources)

Operation system: Gentoo OS, ubuntu 12.04

Please provide any additional information below.
1. Test program an be found at attachment
2. See gdb output: http://pastebin.com/BpjYrPaw

Original issue reported on code.google.com by feniksgo...@gmail.com on 2 Dec 2013 at 6:56

GoogleCodeExporter commented 9 years ago
Also, i upload program for reproducing bug to github: 
https://github.com/feniksa/leveldb_bug_219

Original comment by feniksgo...@gmail.com on 3 Dec 2013 at 3:01

GoogleCodeExporter commented 9 years ago
Potentially can be a duplicate of bug: 
https://code.google.com/p/leveldb/issues/detail?id=144

Original comment by feniksgo...@gmail.com on 3 Dec 2013 at 3:21

GoogleCodeExporter commented 9 years ago
This bug should be addressable by Sanjay's proposed fd-based WritableFile.  
What's happening here is the system is sending a SIGBUS to the app (which the 
app doesn't catch) when LevelDB writes to a page that cannot be backed by space 
in the file.

Original comment by res...@gmail.com on 3 Dec 2013 at 3:24

GoogleCodeExporter commented 9 years ago
Within current design we just can change ftruncate to fallocate to get correct 
behavior of space allocation. You can merge this patch with git am:

    git am --ignore-whitespace 0001-Fix-issue-144-219.patch

Original comment by feniksgo...@gmail.com on 3 Dec 2013 at 5:30

Attachments:

GoogleCodeExporter commented 9 years ago
1.15 release should have fixed this since we now use stdio on the write path.

Original comment by san...@google.com on 10 Dec 2013 at 7:26