salvagewallet fails assertion. Aborted (core dumped) #7231

issue MarcoFalke opened this issue on December 18, 2015
  1. MarcoFalke commented at 4:35 PM on December 18, 2015: member

    Steps to reproduce:

    $ ./configure CPPFLAGS=-DDEBUG_LOCKORDER
    $ make
    $ src/bitcoind -regtest -salvagewallet
    Assertion failed: lock cs_wallet not held in wallet/wallet.cpp:153; locks held:
    Aborted (core dumped)
    
  2. jonasschnelli commented at 10:19 AM on December 19, 2015: contributor

    -salvagewallet calls the CWallet::Verify() method which does not lock cs_wallet, but, some subfunctions call AssertLockHeld(). Because CWallet::Verify() can only happen over init.cpp/main thread, I guess this is tolerable.

    The assert only "fires" when CPPFLAGS=-DDEBUG_LOCKORDER is enabled.

    A "fix" (only a debug mode fix) would probably be a LOCK(cs_wallet) at the beginning of CWallet::Verify().

  3. MarcoFalke commented at 1:50 PM on December 19, 2015: member

    @jonasschnelli Thanks! Looks like fa33d9740c9b0d1071094ab6c1736f27a7090c95 (#7229) fixes it.

  4. MarcoFalke closed this on Jan 7, 2016

  5. MarcoFalke locked this on Sep 8, 2021

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-17 06:15 UTC

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