Skip to content

~CCheckQueue assertion failure during unclean exits #25448

Closed

Description

@luke-jr

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.

Activity

  1. luke-jr commented on Jun 22, 2022

    @luke-jr
    ContributorAuthor

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

  2. laanwj commented on Jun 22, 2022

    @laanwj
    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.

  3. maflcko commented on Jun 23, 2022

    @maflcko
    Member
  4. hebasto commented on Dec 28, 2022

    @hebasto
    Member

    #18731

    It is #26762 now :)

  5. added a commit that references this issue on Jan 26, 2024
  6. locked and limited conversation to collaborators on Nov 29, 2024
  7. added a commit that references this issue on Aug 6, 2025
  8. added a commit that references this issue on Jun 28, 2026
  9. added a commit that references this issue on Jun 30, 2026
  10. added a commit that references this issue on Aug 19, 2026
  11. added 4 commits that reference this issue on Nov 27, 2026
  12. added a commit that references this issue on Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions