~CCheckQueue assertion failure during unclean exits #25448

issue luke-jr opened this issue on June 22, 2022
  1. luke-jr commented at 5:21 PM on June 22, 2022: member

    For testing, I am using this:

    --- a/src/wallet/wallet.cpp
    +++ b/src/wallet/wallet.cpp
    @@ -2102,6 +2102,7 @@ OutputType CWallet::TransactionChangeType(const std::optional<OutputType>& chang
     void CWallet::CommitTransaction(CTransactionRef tx, mapValue_t mapValue, std::vector<std::pair<std::string, std::string>> orderForm)
     {
         LOCK(cs_wallet);
    +    throw std::runtime_error(std::string(__func__) + ": Wallet db error, transaction commit failed");
         WalletLogPrintf("CommitTransaction:\n%s", tx->ToString()); /* Continued */
     
         // Add tx to wallet, because if it has change it's also ours,
    

    To trigger it, you have to attempt to send a transaction.

    This correctly displays an error dialog, then exits with:

    ************************
    EXCEPTION: St13runtime_error       
    CommitTransaction: Wallet db error, transaction commit failed       
    bitcoin in QPushButton->SendCoinsDialog       
    
    bitcoin-qt: ./checkqueue.h:204: CCheckQueue<CScriptCheck>::~CCheckQueue() [T = CScriptCheck]: Assertion `m_worker_threads.empty()' failed.
    Aborted
    

    This issue is related to the failed assertion during the unclean exit.

  2. luke-jr added the label Bug on Jun 22, 2022
  3. luke-jr commented at 5:21 PM on June 22, 2022: member

    (Previously seen in #24953, and "fixed" by avoiding the unclean exit in that one scenario)

  4. laanwj commented at 8:05 PM on June 22, 2022: member

    Yeah, this is a very old problem. It's not safe to destruct the queue while there's stil a thread running. Maybe it could wait instead of assert.

  5. maflcko commented at 5:44 AM on June 23, 2022: member
  6. hebasto commented at 1:19 PM on December 28, 2022: member

    #18731

    It is #26762 now :)

  7. achow101 closed this on Nov 30, 2023

  8. Julio-Rats referenced this in commit 498994b6f5 on Jan 26, 2024
  9. bitcoin locked this on Nov 29, 2024

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-05-02 06:13 UTC

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