laanwj/bitcoin-qt — Issue #29: Crash under XMonad WM
Author: Hanczar
Created: 2011-11-13 00:16:18+00:00
State: open

I downloaded and compiled bitcoin-qt from sources. First time it run correctly ( gui showed), but next starts ended with crash ( no gui showed only splash screen by short while).
Even I deleted completely ~/.bitcoin , it crashed everytime.
When I run the same executable under valgrind - it run ok, gui showed ( only slower ). Without valgrind - crash.
From the same console the same executable -> with valgrind ok, without valgrind crash.
I couldn't reproduce problem after switching to Unity WM, switching back to Xmonad it started crashing again.
It looks like some race condition problem.

My envirionment:
AMD 5600+, Ubuntu 11.10 64-bit, WM: Xmonad

version of downloaded sources:

git log -1
commit 1320b61bcfe25b1944b8db95166475c32adb6cfe
Author: sje397
Date: Fri Nov 11 01:20:17 2011 +1100

Added QRCode generation functions via libqrencode

All coredumps from these crashes shows:

Core was generated by `./bitcoin-qt'.
Program terminated with signal 11, Segmentation fault.
#0 0x0000000000614f74 in ClientModel::getOptionsModel (this=0x0) at src/qt/clientmodel.cpp:77
77 return optionsModel;
(gdb) bt
#0 0x0000000000614f74 in ClientModel::getOptionsModel (this=0x0) at src/qt/clientmodel.cpp:77
#1 0x000000000042b61e in BitcoinGUI::changeEvent (this=0x7fff2ee3e9d0, e=0x7fff2ee3e310) at src/qt/bitcoingui.cpp:482
#2 0x00007fca3b2df77f in QWidget::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#3 0x00007fca3b6a1ceb in QMainWindow::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#4 0x00007fca3b28f424 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#5 0x00007fca3b294291 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#6 0x00007fca3ad5eafc in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#7 0x00007fca3b300617 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#8 0x00007fca3b30e56b in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#9 0x00007fca3b32446e in qt_x11_wait_for_window_manager(QWidget*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#10 0x00007fca3b6dde31 in QSplashScreen::finish(QWidget*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#11 0x0000000000425905 in main (argc=1, argv=0x7fff2ee3eef8) at src/qt/bitcoin.cpp:164
(gdb) print this
$1 = (ClientModel * const) 0x0
(gdb) frame 1
#1 0x000000000042b61e in BitcoinGUI::changeEvent (this=0x7fff2ee3e9d0, e=0x7fff2ee3e310) at src/qt/bitcoingui.cpp:482
482 if (clientModel->getOptionsModel()->getMinimizeToTray())
(gdb) print clientModel
$2 = (ClientModel *) 0x0
(gdb) print *this
$3 = { = {}, static staticMetaObject = {d = {superdata = 0xabc760, stringdata = 0x71e520 "BitcoinGUI", data = 0x71e380, extradata = 0x0}}, TabIndex = 1022834469, clientModel = 0x0, walletModel = 0x0, centralWidget = 0x1c33120,
overviewPage = 0x1bc3fa0, transactionsPage = 0x1bef880, addressBookPage = 0x1c029d0, receiveCoinsPage = 0x1c0d920, sendCoinsPage = 0x1c1a590, labelEncryptionIcon = 0x1c68400, labelConnectionsIcon = 0x1c68740, labelBlocksIcon = 0x1c68a80, progressBarLabel = 0x1c68e10,
progressBar = 0x1c69560, appMenuBar = 0x1bac160, overviewAction = 0x1ba81f0, historyAction = 0x1ba8820, quitAction = 0x1baa260, sendCoinsAction = 0x1ba9ac0, addressBookAction = 0x1ba89d0, aboutAction = 0x1baa3e0, receiveCoinsAction = 0x1ba9000, optionsAction = 0x1baa400,
openBitcoinAction = 0x1baa770, exportAction = 0x1baa790, encryptWalletAction = 0x1baaab0, changePassphraseAction = 0x1baa9f0, trayIcon = 0x1bc2bb0, notificator = 0x1bcafb0, transactionView = 0x1bf0550, syncIconMovie = 0x1c69b60}
(gdb)

I added locally check for clientMode != NULL in src/qt/bitcoingui.cpp:482, it worked around problem for me as no problem reproduced after that in the same environment.