bitcoin-qt crash after early call to loadwallet #16937

issue fanquake openend this issue on September 22, 2019
  1. fanquake commented at 11:59 pm on September 22, 2019: member

    A call to loadwallet while bitcoin-qt is starting will cause a crash:

     0Process 77611 launched: '/Users/michael/github/bitcoin/src/qt/bitcoin-qt' (x86_64)
     12019-09-23 07:40:29.799378+0800 bitcoin-qt[77611:495185] MessageTracer: Falling back to default whitelist
     2Process 77611 stopped
     3* thread [#12](/bitcoin-bitcoin/12/), name = 'bitcoin-httpworker.0', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
     4    frame [#0](/bitcoin-bitcoin/0/): 0x00000001001faaa0 bitcoin-qt`WalletController::getOrCreateWallet(this=0x000000011a5a1670, wallet=unique_ptr<interfaces::Wallet, std::__1::default_delete<interfaces::Wallet> > @ 0x0000700009586200) at walletcontroller.cpp:96:36
     5   93  	
     6   94  	    // Return model instance if exists.
     7   95  	    if (!m_wallets.empty()) {
     8-> 96  	        std::string name = wallet->getWalletName();
     9   97  	        for (WalletModel* wallet_model : m_wallets) {
    10   98  	            if (wallet_model->wallet().getWalletName() == name) {
    11   99  	                return wallet_model;
    12Target 0: (bitcoin-qt) stopped.
    
     0import argparse
     1import time
     2import os
     3import sys
     4
     5from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
     6
     7# lldb src/qt/bitcoin-qt -- -debug -regtest
     8# python3 crash.py <datadir>
     9
    10parser = argparse.ArgumentParser()
    11parser.add_argument('datadir')
    12args = parser.parse_args()
    13
    14cookie: str = args.datadir + '/regtest/.cookie'
    15wallet_name: str = 'hello'
    16
    17# Wait for cookie file to be created
    18while not os.path.exists(cookie):
    19    time.sleep(0.5)
    20# Read .cookie file to get user and pass
    21with open(cookie) as f:
    22    userpass: str = f.readline().lstrip().rstrip()
    23rpc = AuthServiceProxy('http://{}@127.0.0.1:18443'.format(userpass))
    24
    25# Wait for bitcoin-qt to be ready
    26ready: bool = False
    27while not ready:
    28    print('waiting...')
    29    try:
    30        rpc.getblockchaininfo()
    31        ready = True
    32    except Exception:
    33        time.sleep(0.5)
    34        pass
    35rpc.loadwallet(wallet_name)
    
  2. fanquake added the label GUI on Sep 22, 2019
  3. fanquake added the label good first issue on Sep 22, 2019
  4. icota referenced this in commit db31bcb475 on Sep 24, 2019
  5. promag commented at 7:53 am on September 25, 2019: member
    Are you able to crash in every try?
  6. laanwj closed this on Jan 8, 2020

  7. sidhujag referenced this in commit a46d74a339 on Jan 8, 2020
  8. sidhujag referenced this in commit fc6d53ddd2 on Nov 10, 2020
  9. DrahtBot locked this on Feb 15, 2022

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-11-17 09:12 UTC

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