bitcoin-qt crashes every time I quit it #4003

issue dooglus opened this issue on April 5, 2014
  1. dooglus commented at 4:03 AM on April 5, 2014: contributor

    The wallet seems to run fine until I exit, and then I see:

    [Thread 0x7fffa566a700 (LWP 9742) exited]
    [Thread 0x7fffa5ebb700 (LWP 9741) exited]
    [Thread 0x7fffa670c700 (LWP 9740) exited]
    
    
    ************************
    EXCEPTION: St13runtime_error       
    CDB() : can't open database file wallet.dat, error -30973       
    bitcoin in Runaway exception       
    
    bitcoin: ../../src/allocators.h:41: LockedPageManagerBase<Locker>::~LockedPageManagerBase() [with Locker = MemoryPageLocker]: Assertion `this->GetLockedPageCount() == 0' failed.
    
    Program received signal SIGABRT, Aborted.
    0x00007ffff4323f77 in __GI_raise (sig=sig@entry=6)
        at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
    56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
    

    This happens each time I close the wallet application.

    I think it started happening after my laptop refused to resume from suspending one time and I had to power it down in a less than correct manner.

    Is there some way I can 'fix' the wallet?

  2. laanwj commented at 9:15 AM on April 5, 2014: member

    This is very strange. Why would it be unable to open the database file but only when you shut down?

    In any case, can you try (may need db4.8-util or similar package):

    cd ~/.bitcoin
    mv wallet.dat wallet.dat.backup
    db4.8_dump wallet.dat.backup | db4.8_load wallet.dat
    
  3. dooglus commented at 6:13 PM on April 5, 2014: contributor

    The first time I noticed the error was shortly after using rsync to copy my whole home directory over to a new laptop. The one I was copying from was running bitcoin-qt at the time. I figured that was a bad idea, so went to shut bitcoin-qt down and re-run the sync, and it was then that I saw the error message. I was wondering if the problem could have been caused by rsync reading the wallet file while it was open. But as I say, the laptop had frozen on resume shortly before this as well.

    I restarted bitcoin, it came up just fine, but again when I went to shut it down, I saw the same error again.

    And interestingly, even after copying everything over to the new laptop, I saw the same error on the new laptop the first time I ran it. But just this morning I was able to shut it down without the error, so it looks like the problem eventually resolved itself.

    Here's a screenshot I took the first time the error happened. Both dialogs are on the screen at the same time.

    screenshot - 14-04-04 - 07 15 45 am

    I should probably mention that I'm using libdb5.3++-dev and had to use a ./configure flag for non-compatible wallets, but I've been using that for a long time.

    Running the dump/load commands completes without error (on the new laptop where the problem is already apparently fixed), and makes the wallet considerably smaller:

    $ cp ~/.bitcoin/wallet.dat wallet.dat.before
    $ db5.3_dump wallet.dat.before | db5.3_load wallet.dat.after
    $ ls -lh wallet.dat*
    -rw-r--r-- 1 chris chris 140M Apr  5 11:11 wallet.dat.after
    -rw------- 1 chris chris 151M Apr  5 11:10 wallet.dat.before
    $ 
    

    I'll try it on the old laptop where the error presumably still happens.

  4. dooglus commented at 6:29 PM on April 5, 2014: contributor

    On the old laptop:

    $ db5.3_dump wallet.dat.before | db5.3_load wallet.dat.after
    $ ls -l wallet.dat.*
    -rw-r--r-- 1 chris chris 146464768 Apr  5 11:19 wallet.dat.after
    -rw------- 1 chris chris 157814784 Apr  5 11:17 wallet.dat.before
    $ 
    

    Then I ran bitcoin-qt on the 'before' version of the wallet, and it did still crash on shutdown. It definitely loaded up, showed the wallet balance, and started catching up with the blockchain.

    screenshot - 14-04-05 - 11 27 12 am

  5. dooglus commented at 6:38 PM on April 5, 2014: contributor

    Running bitcoin-qt with the 'wallet.dat.after' file created using those db util commands fixed the problem. I can now start and close the wallet without error messages.

  6. laanwj added the label Bug on May 2, 2014
  7. laanwj closed this on May 13, 2014

  8. MarcoFalke locked this on Sep 8, 2021
Contributors
Labels

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: 2026-04-16 00:15 UTC

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