gui: crash if encrypt / change passphrase window is open and wallet is unloaded #15310

issue fanquake openend this issue on February 1, 2019
  1. fanquake commented at 7:21 am on February 1, 2019: member

    Using master @ cb35f1d305d88934df64c2e7fb80700b673360e6

    Run bitcoin-qt, and open either the Encrypt Wallet or Change Passphrase window. Unload the wallet. ie src/bitcoin-cli unloadwallet

     0* thread [#1](/bitcoin-bitcoin/1/), queue = 'com.apple.main-thread', stop reason = signal SIGABRT
     1  * frame [#0](/bitcoin-bitcoin/0/): 0x00007fff5ba9523e libsystem_kernel.dylib`__pthread_kill + 10
     2    frame [#1](/bitcoin-bitcoin/1/): 0x00007fff5bb4bc1c libsystem_pthread.dylib`pthread_kill + 285
     3    frame [#2](/bitcoin-bitcoin/2/): 0x00007fff5b9fe1c9 libsystem_c.dylib`abort + 127
     4    frame [#3](/bitcoin-bitcoin/3/): 0x00007fff5bb0d6e2 libsystem_malloc.dylib`malloc_vreport + 545
     5    frame [#4](/bitcoin-bitcoin/4/): 0x00007fff5bb0d4a3 libsystem_malloc.dylib`malloc_report + 152
     6    frame [#5](/bitcoin-bitcoin/5/): 0x0000000101ef9e90 QtCore`QObjectPrivate::deleteChildren() + 224
     7    frame [#6](/bitcoin-bitcoin/6/): 0x00000001012439e2 QtWidgets`QWidget::~QWidget() + 1058
     8    frame [#7](/bitcoin-bitcoin/7/): 0x00000001000ddc8c bitcoin-qt`WalletView::~WalletView() [inlined] WalletView::~WalletView(this=0x0000000159d976e0) at walletview.cpp:87 [opt]
     9    frame [#8](/bitcoin-bitcoin/8/): 0x00000001000ddc87 bitcoin-qt`WalletView::~WalletView() [inlined] WalletView::~WalletView(this=0x0000000159d976e0) at walletview.cpp:86 [opt]
    10    frame [#9](/bitcoin-bitcoin/9/): 0x00000001000ddc87 bitcoin-qt`WalletView::~WalletView(this=0x0000000159d976e0) at walletview.cpp:86 [opt]
    11    frame [#10](/bitcoin-bitcoin/10/): 0x00000001000d42f8 bitcoin-qt`WalletFrame::removeWallet(this=0x000000010eaa4130, wallet_model=<unavailable>) at walletframe.cpp:98 [opt]
    12    frame [#11](/bitcoin-bitcoin/11/): 0x000000010001f5b6 bitcoin-qt`BitcoinGUI::removeWallet(this=0x0000000108dc8bb0, walletModel=<unavailable>) at bitcoingui.cpp:611 [opt]
    13    frame [#12](/bitcoin-bitcoin/12/): 0x0000000101f01d7b QtCore`QMetaObject::activate(QObject*, int, int, void**) + 2219
    14    frame [#13](/bitcoin-bitcoin/13/): 0x00000001000ef3ff bitcoin-qt`WalletController::walletRemoved(this=<unavailable>, _t1=<unavailable>) at moc_walletcontroller.cpp:206 [opt]
    15    frame [#14](/bitcoin-bitcoin/14/): 0x00000001000d2f46 bitcoin-qt`WalletController::removeAndDeleteWallet(this=0x0000000159d31a00, wallet_model=0x0000000122f44f80) at walletcontroller.cpp:91 [opt]
    16    frame [#15](/bitcoin-bitcoin/15/): 0x0000000101f01d7b QtCore`QMetaObject::activate(QObject*, int, int, void**) + 2219
    17    frame [#16](/bitcoin-bitcoin/16/): 0x0000000101efa801 QtCore`QObject::event(QEvent*) + 753
    18    frame [#17](/bitcoin-bitcoin/17/): 0x0000000101218f8d QtWidgets`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 269
    19    frame [#18](/bitcoin-bitcoin/18/): 0x000000010121a392 QtWidgets`QApplication::notify(QObject*, QEvent*) + 594
    
  2. fanquake added the label GUI on Feb 1, 2019
  3. jonasschnelli commented at 8:42 am on February 1, 2019: contributor

    This is due to the blocking (synchronous) QDialog::exec() call which does not work with unloading wallets (from another thread at least).

    There are other areas where unloading a wallet via RPC will make the GUI crash (CoinControl / AddressBook, Transaction-Details, Unlocking a wallet, changing passphrase)

  4. gmaxwell commented at 11:28 pm on March 16, 2019: contributor

    User exposed easily triggered crasher, should probably block v0.18. :( Esp if users trigger this during/shortly after IBD they’ll likely corrupt their blockchain state and end up with a days long resync or reindex.

    We might want to consider reverting #14941 just in 0.18.0, in part because there might be other similar interactions? (also because we’re awfully close to 0.18 to engage in non-trivial fixes)

  5. jonasschnelli commented at 3:26 pm on March 17, 2019: contributor
    This is fixed in #15313 and I think it’s a simple and ready fix that could merged into 0.18.
  6. MarcoFalke added this to the milestone 0.18.0 on Mar 17, 2019
  7. promag commented at 9:30 pm on March 17, 2019: member

    This is due to the blocking (synchronous) QDialog::exec() call which does not work with unloading wallets (from another thread at least).

    There are other areas where unloading a wallet via RPC will make the GUI crash (CoinControl / AddressBook, Transaction-Details, Unlocking a wallet, changing passphrase)

    I’ve tried to remove all usages of QDialog::exec but the change is not that simple, especially in WalletModel::bumpFee.

    #15614 is an alternative solution which I think is more adequate for 0.18 branch.

  8. jonasschnelli closed this on Mar 22, 2019

  9. jonasschnelli referenced this in commit abd914ed34 on Mar 22, 2019
  10. PastaPastaPasta referenced this in commit 7017bc4620 on Sep 21, 2021
  11. PastaPastaPasta referenced this in commit 167363d4bd on Sep 24, 2021
  12. kittywhiskers referenced this in commit 4094e3313e on Oct 12, 2021
  13. DrahtBot locked this on Dec 16, 2021
  14. gades referenced this in commit de5ffa5cb1 on May 10, 2022


fanquake jonasschnelli gmaxwell promag

Labels
GUI

Milestone
0.18.0


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-07-05 19:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me