~CCheckQueue assertion failure during unclean exits #25448

issue luke-jr openend 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:

    0--- a/src/wallet/wallet.cpp
    1+++ b/src/wallet/wallet.cpp
    2@@ -2102,6 +2102,7 @@ OutputType CWallet::TransactionChangeType(const std::optional<OutputType>& chang
    3 void CWallet::CommitTransaction(CTransactionRef tx, mapValue_t mapValue, std::vector<std::pair<std::string, std::string>> orderForm)
    4 {
    5     LOCK(cs_wallet);
    6+    throw std::runtime_error(std::string(__func__) + ": Wallet db error, transaction commit failed");
    7     WalletLogPrintf("CommitTransaction:\n%s", tx->ToString()); /* Continued */
    8 
    9     // 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:

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

    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: 2024-12-19 00:12 UTC

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