Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

v0.6.0rc5 segfault on initial blockchain download when out of diskspace #999

Closed
dooglus opened this Issue · 5 comments

3 participants

@dooglus

I'm playing about with rc5 trying to see how quickly I can get it to download the initial blockchain putting the datadir on a ramdisk and connecting only to a machine on the LAN which already has the blockchain.

The database log files build up continually, even though they're checkpointed every 5000 blocks. I would expect checkpointing to free up some space, but it doesn't. Eventually the ram disk holding ~/.bitcoin filled up, and bitcoin-qt crashed, leaving a message popped up in a bubble pointing at the bitcoin systray icon: "Warning: Disk space is low".

(gdb) run
Starting program: /home/chris/Bin/bitcoin -server -min -connect=192.168.0.194 -nolisten -noirc
[Thread debugging using libthread_db enabled]
[New Thread 0xb54c0b70 (LWP 2948)]
[New Thread 0xb4cbfb70 (LWP 2949)]
[New Thread 0xb12a8b70 (LWP 2952)]
[New Thread 0xb0aa7b70 (LWP 2953)]
[New Thread 0xb02a6b70 (LWP 2954)]
[New Thread 0xafaa5b70 (LWP 2955)]
[New Thread 0xaf19ab70 (LWP 2956)]
[New Thread 0xae999b70 (LWP 2957)]
[New Thread 0xae198b70 (LWP 2959)]
[New Thread 0xad997b70 (LWP 2960)]
[New Thread 0xad196b70 (LWP 2961)]
[New Thread 0xac995b70 (LWP 2962)]
[Thread 0xae999b70 (LWP 2957) exited]
[Thread 0xad997b70 (LWP 2960) exited]
[New Thread 0xae999b70 (LWP 2963)]
[Thread 0xb0aa7b70 (LWP 2953) exited]
[Thread 0xafaa5b70 (LWP 2955) exited]
"sni-qt/2947" WARN  23:57:35.064 void StatusNotifierItemFactory::connectToSnw() Invalid interface to SNW_SERVICE 
[New Thread 0xafaa5b70 (LWP 2964)]
[Thread 0xb54c0b70 (LWP 2948) exited]
[New Thread 0xb54c0b70 (LWP 2973)]
[Thread 0xac995b70 (LWP 2962) exited]
[Thread 0xafaa5b70 (LWP 2964) exited]
[Thread 0xae198b70 (LWP 2959) exited]
[Thread 0xb12a8b70 (LWP 2952) exited]
[Thread 0xad196b70 (LWP 2961) exited]
[Thread 0xaf19ab70 (LWP 2956) exited]
[New Thread 0xaf19ab70 (LWP 2975)]
[Thread 0xaf19ab70 (LWP 2975) exited]

Program received signal SIGSEGV, Segmentation fault.
0xb7e6d385 in BN_usub () from /lib/i386-linux-gnu/libcrypto.so.1.0.0
(gdb) where
#0  0xb7e6d385 in BN_usub () from /lib/i386-linux-gnu/libcrypto.so.1.0.0
#1  0xb7e6d58c in BN_add () from /lib/i386-linux-gnu/libcrypto.so.1.0.0
#2  0x080ac4ec in operator+ (a=..., b=...) at src/bignum.h:470
#3  0x080c45a6 in GetWarnings (strFor=...) at src/main.cpp:2048
#4  0x082441ec in ClientModel::getStatusBarWarnings (this=0xbffff4f0) at src/qt/clientmodel.cpp:77
#5  0x080735e1 in BitcoinGUI::setNumBlocks (this=0xbffff3fc, count=24188) at src/qt/bitcoingui.cpp:461
#6  0x082b81a4 in BitcoinGUI::qt_metacall (this=0xbffff3fc, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0xbfffec78) at build/moc_bitcoingui.cpp:110
#7  0xb6fceb7d in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#8  0xb6fdda6a in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#9  0x082b8fdc in ClientModel::numBlocksChanged (this=0xbffff4f0, _t1=24188) at build/moc_clientmodel.cpp:101
#10 0x08244172 in ClientModel::update (this=0xbffff4f0) at src/qt/clientmodel.cpp:54
#11 0x082b8f58 in ClientModel::qt_metacall (this=0xbffff4f0, _c=QMetaObject::InvokeMetaMethod, _id=3, _a=0xbfffed64) at build/moc_clientmodel.cpp:82
#12 0xb6fceb7d in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#13 0xb6fdda6a in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#14 0xb702c7d5 in QTimer::timeout() () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#15 0xb6fe5286 in QTimer::timerEvent(QTimerEvent*) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#16 0xb6fe0994 in QObject::event(QEvent*) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#17 0xb725ad84 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#18 0xb7260133 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#19 0xb6fc819e in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#20 0xb6ff8c10 in ?? () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#21 0xb6ff6155 in ?? () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#22 0xb6a7525f in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
#23 0xb6a75990 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#24 0xb6a75c2a in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#25 0xb6ff6ada in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#26 0xb7312e7a in ?? () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#27 0xb6fc71dd in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#28 0xb6fc7421 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#29 0xb6fcc19d in QCoreApplication::exec() () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#30 0xb7258924 in QApplication::exec() () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#31 0x08068499 in main (argc=6, argv=0xbffff6e4) at src/qt/bitcoin.cpp:271
(gdb) thread apply all bt

Thread 16 (Thread 0xb54c0b70 (LWP 2973)):
#0  0xb7fdf424 in __kernel_vsyscall ()
#1  0xb6c76403 in ?? () from /lib/i386-linux-gnu/libc.so.6
#2  0xb6c0a495 in ?? () from /lib/i386-linux-gnu/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 14 (Thread 0xae999b70 (LWP 2963)):
#0  0xb7fdf424 in __kernel_vsyscall ()
#1  0xb6e55296 in nanosleep () from /lib/i386-linux-gnu/libpthread.so.0
#2  0xb7bd6284 in boost::this_thread::sleep(boost::posix_time::ptime const&) () from /usr/lib/libboost_thread.so.1.46.1
#3  0x080cf195 in boost::thread::sleep (xt=...) at /usr/include/boost/thread/detail/thread.hpp:346
#4  0x080cf317 in Sleep (n=100000) at src/util.h:92
#5  0x08125c4b in ThreadDumpAddress2 (parg=0x0) at src/net.cpp:1215
#6  0x08125cef in ThreadDumpAddress (parg=0x0) at src/net.cpp:1226
#7  0x08125ce2 in ThreadDumpAddress (parg=0x0) at src/net.cpp:1223
#8  0x08125ce2 in ThreadDumpAddress (parg=0x0) at src/net.cpp:1223
#9  0x08125ce2 in ThreadDumpAddress (parg=0x0) at src/net.cpp:1223
#10 0x08125ce2 in ThreadDumpAddress (parg=0x0) at src/net.cpp:1223
#11 0x08125ce2 in ThreadDumpAddress (parg=0x0) at src/net.cpp:1223
#12 0x08125ce2 in ThreadDumpAddress (parg=0x0) at src/net.cpp:1223
#13 0x08125ce2 in ThreadDumpAddress (parg=0x0) at src/net.cpp:1223
#14 0x08125ce2 in ThreadDumpAddress (parg=0x0) at src/net.cpp:1223
#15 0x08125ce2 in ThreadDumpAddress (parg=0x0) at src/net.cpp:1223
#16 0x08125ce2 in ThreadDumpAddress (parg=0x0) at src/net.cpp:1223
#17 0x08125ce2 in ThreadDumpAddress (parg=0x0) at src/net.cpp:1223
#18 0x08125ce2 in ThreadDumpAddress (parg=0x0) at src/net.cpp:1223
#19 0x08125ce2 in ThreadDumpAddress (parg=0x0) at src/net.cpp:1223
#20 0xb6e4dd31 in start_thread () from /lib/i386-linux-gnu/libpthread.so.0
#21 0xb6c6846e in clone () from /lib/i386-linux-gnu/libc.so.6
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 6 (Thread 0xb02a6b70 (LWP 2954)):
#0  0xb7fdf424 in __kernel_vsyscall ()
#1  0xb6e54cb8 in accept () from /lib/i386-linux-gnu/libpthread.so.0
#2  0x0829891d in boost::asio::detail::socket_ops::call_accept<unsigned int> (s=30, addr=0xb02a5e50, addrlen=0xb02a56b4)
    at /usr/include/boost/asio/detail/impl/socket_ops.ipp:75
#3  0x082959d0 in boost::asio::detail::socket_ops::accept (s=30, addr=0xb02a5e50, addrlen=0xb02a56b4, ec=...)
    at /usr/include/boost/asio/detail/impl/socket_ops.ipp:93
#4  0x08295a3a in boost::asio::detail::socket_ops::sync_accept (s=30, state=16 '\020', addr=0xb02a5e50, addrlen=0xb02a56b4, ec=...)
    at /usr/include/boost/asio/detail/impl/socket_ops.ipp:119
#5  0x082a33e2 in boost::asio::detail::reactive_socket_service<boost::asio::ip::tcp>::accept<boost::asio::basic_socket<boost::asio::ip::tcp, boost::asio::stream_socket_service<boost::asio::ip::tcp> > > (this=0x87110a4, impl=..., peer=..., peer_endpoint=0xb02a5e50, ec=...)
    at /usr/include/boost/asio/detail/reactive_socket_service.hpp:326
#6  0x0829f337 in boost::asio::socket_acceptor_service<boost::asio::ip::tcp>::accept<boost::asio::stream_socket_service<boost::asio::ip::tcp> > (
    this=0x8711090, impl=..., peer=..., peer_endpoint=0xb02a5e50, ec=...) at /usr/include/boost/asio/socket_acceptor_service.hpp:197
#7  0x0829b895 in boost::asio::basic_socket_acceptor<boost::asio::ip::tcp, boost::asio::socket_acceptor_service<boost::asio::ip::tcp> >::accept<boost::asio::stream_socket_service<boost::asio::ip::tcp> > (this=0xb02a579c, peer=..., peer_endpoint=...)
    at /usr/include/boost/asio/basic_socket_acceptor.hpp:747
#8  0x0828db66 in ThreadRPCServer2 (parg=0x0) at src/bitcoinrpc.cpp:2438
#9  0x0828d2eb in ThreadRPCServer (parg=0x0) at src/bitcoinrpc.cpp:2347
#10 0x0828d2c0 in ThreadRPCServer (parg=0x0) at src/bitcoinrpc.cpp:2343
#11 0x0828d2c0 in ThreadRPCServer (parg=0x0) at src/bitcoinrpc.cpp:2343
#12 0x0828d2c0 in ThreadRPCServer (parg=0x0) at src/bitcoinrpc.cpp:2343
#13 0x0828d2c0 in ThreadRPCServer (parg=0x0) at src/bitcoinrpc.cpp:2343
#14 0x0828d2c0 in ThreadRPCServer (parg=0x0) at src/bitcoinrpc.cpp:2343
#15 0x0828d2c0 in ThreadRPCServer (parg=0x0) at src/bitcoinrpc.cpp:2343
#16 0x0828d2c0 in ThreadRPCServer (parg=0x0) at src/bitcoinrpc.cpp:2343
#17 0x0828d2c0 in ThreadRPCServer (parg=0x0) at src/bitcoinrpc.cpp:2343
#18 0x0828d2c0 in ThreadRPCServer (parg=0x0) at src/bitcoinrpc.cpp:2343
#19 0x0828d2c0 in ThreadRPCServer (parg=0x0) at src/bitcoinrpc.cpp:2343
#20 0x0828d2c0 in ThreadRPCServer (parg=0x0) at src/bitcoinrpc.cpp:2343
#21 0x0828d2c0 in ThreadRPCServer (parg=0x0) at src/bitcoinrpc.cpp:2343
#22 0x0828d2c0 in ThreadRPCServer (parg=0x0) at src/bitcoinrpc.cpp:2343
#23 0x0828d2c0 in ThreadRPCServer (parg=0x0) at src/bitcoinrpc.cpp:2343
#24 0x0828d2c0 in ThreadRPCServer (parg=0x0) at src/bitcoinrpc.cpp:2343
#25 0x0828d2c0 in ThreadRPCServer (parg=0x0) at src/bitcoinrpc.cpp:2343
#26 0x0828d2c0 in ThreadRPCServer (parg=0x0) at src/bitcoinrpc.cpp:2343
#27 0x0828d2c0 in ThreadRPCServer (parg=0x0) at src/bitcoinrpc.cpp:2343
#28 0xb6e4dd31 in start_thread () from /lib/i386-linux-gnu/libpthread.so.0
#29 0xb6c6846e in clone () from /lib/i386-linux-gnu/libc.so.6
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 3 (Thread 0xb4cbfb70 (LWP 2949)):
#0  0xb7fdf424 in __kernel_vsyscall ()
#1  0xb6c597ae in poll () from /lib/i386-linux-gnu/libc.so.6
#2  0xb6a8434b in g_poll () from /lib/i386-linux-gnu/libglib-2.0.so.0
#3  0xb6a75896 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#4  0xb6a75f9b in g_main_loop_run () from /lib/i386-linux-gnu/libglib-2.0.so.0
#5  0xb6150cea in ?? () from /usr/lib/i386-linux-gnu/libgio-2.0.so.0
#6  0xb6a9c5f4 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#7  0xb6e4dd31 in start_thread () from /lib/i386-linux-gnu/libpthread.so.0
#8  0xb6c6846e in clone () from /lib/i386-linux-gnu/libc.so.6
Backtrace stopped: Not enough registers or memory available to unwind further

Thread 1 (Thread 0xb6692710 (LWP 2947)):
#0  0xb7e6d385 in BN_usub () from /lib/i386-linux-gnu/libcrypto.so.1.0.0
#1  0xb7e6d58c in BN_add () from /lib/i386-linux-gnu/libcrypto.so.1.0.0
#2  0x080ac4ec in operator+ (a=..., b=...) at src/bignum.h:470
#3  0x080c45a6 in GetWarnings (strFor=...) at src/main.cpp:2048
#4  0x082441ec in ClientModel::getStatusBarWarnings (this=0xbffff4f0) at src/qt/clientmodel.cpp:77
#5  0x080735e1 in BitcoinGUI::setNumBlocks (this=0xbffff3fc, count=24188) at src/qt/bitcoingui.cpp:461
#6  0x082b81a4 in BitcoinGUI::qt_metacall (this=0xbffff3fc, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0xbfffec78) at build/moc_bitcoingui.cpp:110
#7  0xb6fceb7d in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#8  0xb6fdda6a in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#9  0x082b8fdc in ClientModel::numBlocksChanged (this=0xbffff4f0, _t1=24188) at build/moc_clientmodel.cpp:101
#10 0x08244172 in ClientModel::update (this=0xbffff4f0) at src/qt/clientmodel.cpp:54
#11 0x082b8f58 in ClientModel::qt_metacall (this=0xbffff4f0, _c=QMetaObject::InvokeMetaMethod, _id=3, _a=0xbfffed64) at build/moc_clientmodel.cpp:82
#12 0xb6fceb7d in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#13 0xb6fdda6a in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#14 0xb702c7d5 in QTimer::timeout() () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#15 0xb6fe5286 in QTimer::timerEvent(QTimerEvent*) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#16 0xb6fe0994 in QObject::event(QEvent*) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#17 0xb725ad84 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#18 0xb7260133 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#19 0xb6fc819e in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#20 0xb6ff8c10 in ?? () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#21 0xb6ff6155 in ?? () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#22 0xb6a7525f in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
#23 0xb6a75990 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#24 0xb6a75c2a in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#25 0xb6ff6ada in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#26 0xb7312e7a in ?? () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#27 0xb6fc71dd in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#28 0xb6fc7421 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#29 0xb6fcc19d in QCoreApplication::exec() () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#30 0xb7258924 in QApplication::exec() () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#31 0x08068499 in main (argc=6, argv=0xbffff6e4) at src/qt/bitcoin.cpp:271
(gdb) 

Edit @laanwj: clarified that this problem happens when out of diskspace

@dooglus

The ram disk I'm using for ~/.bitcoin is 4000M, created like this:

$ sudo mount -t tmpfs -o size=4000M tmpfs .bitcoin

The 4000M is running out of space and causing the crash. Does bitcoin not handle a disk full condition without segfaulting? There are a lot of logfiles in the database folder. bitcoind was started at 20:28 - note the timestamps on the logfiles, starting just 3 minutes after that. It looks like none of them have been cleared up:

chris@chris:~/.bitcoin$ df -h .
df -h .
Filesystem            Size  Used Avail Use% Mounted on
tmpfs                 4.0G  3.8G  135M  97% /home/chris/.bitcoin
chris@chris:~/.bitcoin$ du -m .
2412    ./database
3867    .
chris@chris:~/.bitcoin$ ls -lSr | tail -5
-rw------- 1 chris chris   10616832 2012-03-27 20:31 __db.004
-rw------- 1 chris chris   32776192 2012-03-27 20:31 __db.003
-rw------- 1 chris chris   37763380 2012-03-27 21:04 debug.log
-rw------- 1 chris chris  396447744 2012-03-27 21:04 blkindex.dat
-rw------- 1 chris chris 1042249308 2012-03-27 21:04 blk0001.dat
chris@chris:~/.bitcoin$ ls -l database
total 2471212
-rw------- 1 chris chris 104857600 2012-03-27 20:31 log.0000000001
-rw------- 1 chris chris 104857600 2012-03-27 20:33 log.0000000002
-rw------- 1 chris chris 104857600 2012-03-27 20:35 log.0000000003
-rw------- 1 chris chris 104857600 2012-03-27 20:36 log.0000000004
-rw------- 1 chris chris 104857600 2012-03-27 20:38 log.0000000005
-rw------- 1 chris chris 104857600 2012-03-27 20:38 log.0000000006
-rw------- 1 chris chris 104857600 2012-03-27 20:39 log.0000000007
-rw------- 1 chris chris 104857600 2012-03-27 20:40 log.0000000008
-rw------- 1 chris chris 104857600 2012-03-27 20:41 log.0000000009
-rw------- 1 chris chris 104857600 2012-03-27 20:42 log.0000000010
-rw------- 1 chris chris 104857600 2012-03-27 20:43 log.0000000011
-rw------- 1 chris chris 104857600 2012-03-27 20:44 log.0000000012
-rw------- 1 chris chris 104857600 2012-03-27 20:45 log.0000000013
-rw------- 1 chris chris 104857600 2012-03-27 20:46 log.0000000014
-rw------- 1 chris chris 104857600 2012-03-27 20:48 log.0000000015
-rw------- 1 chris chris 104857600 2012-03-27 20:49 log.0000000016
-rw------- 1 chris chris 104857600 2012-03-27 20:50 log.0000000017
-rw------- 1 chris chris 104857600 2012-03-27 20:52 log.0000000018
-rw------- 1 chris chris 104857600 2012-03-27 20:53 log.0000000019
-rw------- 1 chris chris 104857600 2012-03-27 20:55 log.0000000020
-rw------- 1 chris chris 104857600 2012-03-27 20:56 log.0000000021
-rw------- 1 chris chris 104857600 2012-03-27 20:57 log.0000000022
-rw------- 1 chris chris 104857600 2012-03-27 20:59 log.0000000023
-rw------- 1 chris chris 104857600 2012-03-27 21:02 log.0000000024
-rw------- 1 chris chris 104857600 2012-03-27 21:04 log.0000000025
chris@chris:~/.bitcoin$ 

Using bitcoind, it runs out of the 4000M disk space and exits cleanly:

received block 000000000000014bea61
*** Warning: Disk space is low  
Bitcoin: Warning: Disk space is low  
ERROR: AcceptBlock() : out of disk space
ERROR: ProcessBlock() : AcceptBlock FAILED
ThreadMessageHandler exiting

So perhaps it's just the GUI version that segfaults when it runs out of disk space.

There are 2 issues then:

1) rc5 uses large amounts of disk space on database logs. I'll check whether that's new, or whether rc4 also did this
2) the bitcoin-qt version doesn't seem to always exit gracefully when it's out of disk space, but around 30% of the time segfaults instead

@dooglus

rc4 has the same issue; it just uses smaller logfiles:

chris@chris:~/.bitcoin/database$ ls | wc -l
187
chris@chris:~/.bitcoin/database$ ls -ltr | tail -5
-rw------- 1 chris chris 10000000 2012-03-27 21:47 log.0000000183
-rw------- 1 chris chris 10000000 2012-03-27 21:47 log.0000000184
-rw------- 1 chris chris 10000000 2012-03-27 21:47 log.0000000185
-rw------- 1 chris chris 10000000 2012-03-27 21:47 log.0000000186
-rw------- 1 chris chris 10000000 2012-03-27 21:47 log.0000000187
chris@chris:~/.bitcoin/database$ du -m .
1787    .
chris@chris:~/.bitcoin/database$ 

CDB::Close() is called after every block that's downloaded, and every 5000 blocks it calls txn_checkpoint(0, 0, 0), which should flush the logfiles:

The txn_checkpoint function flushes the underlying memory pool,
writes a checkpoint record to the log, and then flushes the log.

If either kbyte or min is non-zero, the checkpoint is done only if
there has been activity since the last checkpoint, and either more
than min minutes have passed since the last checkpoint or if more
than kbyte kilobytes of log data have been written since the last
checkpoint.

However, even though it is being called every 5000 blocks, the logfiles aren't disappearing - they just keep building up:

strFile = blkindex.dat, nMinutes = 1, IBD = 1, nBestHeight = 129999
txn_checkpoint(0, 1, 0) = 0

strFile = blkindex.dat, nMinutes = 0, IBD = 1, nBestHeight = 130000
txn_checkpoint(0, 0, 0) = 0

strFile = blkindex.dat, nMinutes = 1, IBD = 1, nBestHeight = 130001
txn_checkpoint(0, 1, 0) = 0

I'm using package "libdb5.1++-dev" on ubuntu 11.10, rather than the 4.8 version suggested in the build-unix.txt. Trying to install 4.8 tells me:

E: Package 'libdb4.8++-dev' has no installation candidate

Could that be the problem?

Even using:

dbenv.txn_checkpoint(0, 0, DB_FORCE);

doesn't cause the log files to be cleaned up.

@gavinandresen

Not a show-stopper for 0.6, but handling out-of-disk-space more gracefully is definitely high priority.
Using less disk space during a full blockchain download is lower priority, in my opinion; most users will be running with tens or hundreds of gigabytes free, and if I recall correctly old database log files are cleaned up on database environment shutdown.

@dooglus

Some people run mining rigs from bootable USB sticks (to save having to buy a hard drive for each machine) and currently won't be able to download the blockchain unless they have a big USB stick, or keep quitting and restarting bitcoind to flush the logs. If bitcoind was better about not using so much disk space it could be possible.

@laanwj
Owner

The problem is that it doesn't do a graceful shutdown when a fatal condition happens (such as out-of-diskspace). It spawns Shutdown() in a thread immediately, which causes the UI to crash. I'm working on a fix for this, which will likely go into 0.7.

@laanwj laanwj closed this
@laanwj laanwj reopened this
@laanwj laanwj closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.