Skip to content

Instantly share code, notes, and snippets.

@fanquake
Last active February 21, 2020 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fanquake/a2dc2cddc153e07c077cd67653f3350d to your computer and use it in GitHub Desktop.
Save fanquake/a2dc2cddc153e07c077cd67653f3350d to your computer and use it in GitHub Desktop.
2020-02-21T06:47:47.246113Z [scheduler] UpdatedBlockTip: new block hash=00000000000000001264cb5b03b34447d49fb4da4892790a2c17d3c202124e98 fork block hash=000000000000000010800ae86eb74401b90f58c7296feb77c5587faae580930b (in IBD=true)
2020-02-21T06:47:47.246291Z [httpworker.3] BerkeleyEnvironment::Flush: [/Users/michael/Library/Application Support/Bitcoin/test] Flush(false)
2020-02-21T06:47:47.246397Z [scheduler] BlockConnected: block hash=000000000000000009acd4874e2be8e8a7b1d7e793c23ef2e91651a8d62620e1 block height=351323
2020-02-21T06:47:47.246480Z [httpworker.3] BerkeleyEnvironment::Flush: Flushing wallet.dat (refcount = 0)...
2020-02-21T06:47:47.246987Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.259517Z [httpworker.3] BerkeleyEnvironment::Flush: wallet.dat checkpoint
2020-02-21T06:47:47.259649Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.259811Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.269852Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.276451Z [httpworker.3] BerkeleyEnvironment::Flush: wallet.dat detach
2020-02-21T06:47:47.276615Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.276899Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.277128Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.277269Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.277485Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.277633Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.277819Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.277968Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.278092Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.278303Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.278518Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.278795Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.278924Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.279058Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.279210Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.279353Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.279476Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.279600Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.279722Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.279846Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.279974Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.280104Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.280300Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.280409Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.280550Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.280676Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.280840Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.280993Z [scheduler] [default wallet] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.281600Z [scheduler] [test] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.281738Z [scheduler] [test] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.281919Z [scheduler] [test] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.289817Z [httpworker.3] BerkeleyEnvironment::Flush: wallet.dat closed
2020-02-21T06:47:47.289912Z [msghand] received: inv (541 bytes) peer=4
2020-02-21T06:47:47.290027Z [scheduler] [test] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
2020-02-21T06:47:47.290102Z [httpworker.3] BerkeleyEnvironment::Flush: Flush(false) took              43ms
2020-02-21T06:47:47.290204Z [scheduler] [test] SCHED: bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef &, CWalletTx::Confirmation, bool)
Assertion failed: (e == 0), function ~recursive_mutex, file /BuildRoot/Library/Caches/com.apple.xbs/Sources/libcxx/libcxx-400.9.4/src/mutex.cpp, line 64.
Process 72347 stopped
* thread #2, name = 'b-httpworker.3', stop reason = signal SIGABRT
    frame #0: 0x00007fff5c4182c2 libsystem_kernel.dylib`__pthread_kill + 10
libsystem_kernel.dylib`__pthread_kill:
->  0x7fff5c4182c2 <+10>: jae    0x7fff5c4182cc            ; <+20>
    0x7fff5c4182c4 <+12>: movq   %rax, %rdi
    0x7fff5c4182c7 <+15>: jmp    0x7fff5c412453            ; cerror_nocancel
    0x7fff5c4182cc <+20>: retq   
Target 0: (bitcoind) stopped.
(lldb) bt
* thread #2, name = 'b-httpworker.3', stop reason = signal SIGABRT
  * frame #0: 0x00007fff5c4182c2 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff5c4d3bf1 libsystem_pthread.dylib`pthread_kill + 284
    frame #2: 0x00007fff5c3826a6 libsystem_c.dylib`abort + 127
    frame #3: 0x00007fff5c34b20d libsystem_c.dylib`__assert_rtn + 324
    frame #4: 0x00007fff59543092 libc++.1.dylib`std::__1::recursive_mutex::~recursive_mutex() + 46
    frame #5: 0x00000001000f1edb bitcoind`AnnotatedMixin<std::__1::recursive_mutex>::~AnnotatedMixin(this=0x000000015b7ccf98) at sync.h:84:5
    frame #6: 0x00000001000aa6f3 bitcoind`AnnotatedMixin<std::__1::recursive_mutex>::~AnnotatedMixin(this=0x000000015b7ccf98) at sync.h:82:23
    frame #7: 0x00000001007d9ea0 bitcoind`CWallet::~CWallet(this=0x000000015b7cce20) at wallet.h:758:5
    frame #8: 0x00000001007c4373 bitcoind`CWallet::~CWallet(this=0x000000015b7cce20) at wallet.h:755:5
    frame #9: 0x00000001007c703a bitcoind`CWallet::~CWallet(this=0x000000015b7cce20) at wallet.h:755:5
    frame #10: 0x00000001007c4691 bitcoind`ReleaseWallet(wallet=0x000000015b7cce20) at wallet.cpp:117:5
    frame #11: 0x000000010083115e bitcoind`std::__1::__shared_ptr_pointer<CWallet*, void (*)(CWallet*), std::__1::allocator<CWallet> >::__on_zero_shared(this=0x00000001577e76c0) at memory:3511:5
    frame #12: 0x00000001000ebd1b bitcoind`std::__1::__shared_count::__release_shared(this=0x00000001577e76c0) at memory:3415:9
    frame #13: 0x00000001000ebc8d bitcoind`std::__1::__shared_weak_count::__release_shared(this=0x00000001577e76c0) at memory:3457:27
    frame #14: 0x000000010065a49a bitcoind`std::__1::shared_ptr<CWallet>::~shared_ptr(this=0x0000700007fb9738) at memory:4393:19
    frame #15: 0x000000010065a3f3 bitcoind`std::__1::shared_ptr<CWallet>::~shared_ptr(this=0x0000700007fb9738) at memory:4391:1
    frame #16: 0x0000000100797521 bitcoind`std::__1::shared_ptr<CWallet>::reset(this=0x0000700007fb9938) at memory:4528:5
    frame #17: 0x000000010079740e bitcoind`UnloadWallet(wallet=nullptr) at wallet.cpp:143:12
    frame #18: 0x000000010074f1e2 bitcoind`unloadwallet(request=0x0000700007fba990) at rpcwallet.cpp:2779:5
 ```bash
 
 #### httpworker (unloadwallet) thread
 
 ```bash
 
 (AnnotatedMixin<std::__1::recursive_mutex> *) this = 0x000000015b7ccf98
 
 (lldb) frame select 6
frame #6: 0x00000001000aa6f3 bitcoind`AnnotatedMixin<std::__1::recursive_mutex>::~AnnotatedMixin(this=0x000000015b7ccf98) at sync.h:82:23
   79  	class LOCKABLE AnnotatedMixin : public PARENT
   80  	{
   81  	public:
-> 82  	    ~AnnotatedMixin() {
   83  	        DeleteLock((void*)this);
   84  	    }
   85  	

 (lldb) frame select 7
frame #7: 0x00000001007d9ea0 bitcoind`CWallet::~CWallet(this=0x000000015b7cce20) at wallet.h:758:5
   755 	    {
   756 	        // Should not have slots connected at this point.
   757 	        assert(NotifyUnload.empty());
-> 758 	    }
   759 	
   760 	    bool IsCrypted() const;
   761 	    bool IsLocked() const override;
 (lldb) frame select 8
frame #8: 0x00000001007c4373 bitcoind`CWallet::~CWallet(this=0x000000015b7cce20) at wallet.h:755:5
   752 	    }
   753 	
   754 	    ~CWallet()
-> 755 	    {
   756 	        // Should not have slots connected at this point.
   757 	        assert(NotifyUnload.empty());
   758 	    }

scheduler thread (10)

// in frame 14
frame variable criticalblock27
(DebugLock<decltype(this->cs_wallet)>) criticalblock27 = {
 std::__1::unique_lock<std::__1::recursive_mutex> = {
   __m_ = 0x000000015b7ccf98
   __owns_ = true
 }
}



(lldb) frame select 12
frame #12: 0x00000001007a76b3 bitcoind`CWallet::AddToWalletIfInvolvingMe(this=0x000000015b7cce20, ptx=std::__1::shared_ptr<const CTransaction>::element_type @ 0x000000015c6c3908 strong=1 weak=1, confirm=Confirmation @ 0x0000700007d2ab70, fUpdate=true) at wallet.cpp:914:9
  911 	{
  912 	    const CTransaction& tx = *ptx;
  913 	    {
-> 914 	        WalletLogPrintf("SCHED: %s\n", __PRETTY_FUNCTION__);
  915 	        // This assertion fails?
  916 	        AssertLockHeld(cs_wallet);
  917
(lldb) frame select 13
frame #13: 0x00000001007a91ca bitcoind`CWallet::SyncTransaction(this=0x000000015b7cce20, ptx=std::__1::shared_ptr<const CTransaction>::element_type @ 0x000000015c6c3908 strong=1 weak=1, confirm=Confirmation @ 0x0000700007d2ac10, update_tx=true) at wallet.cpp:1089:10
  1086	void CWallet::SyncTransaction(const CTransactionRef& ptx, CWalletTx::Confirmation confirm, bool update_tx)
  1087	{
  1088	    //WalletLogPrintf("SCHED: %s\n", __PRETTY_FUNCTION__);
-> 1089	    if (!AddToWalletIfInvolvingMe(ptx, confirm, update_tx))
  1090	        return; // Not one of ours
  1091	
  1092	    // If a transaction changes 'conflicted' state, that changes the balance
(lldb) frame variable cs_wallet
(RecursiveMutex) cs_wallet = {
 std::__1::recursive_mutex = {
   __m_ = (__sig = 1297437784, __opaque = "")
 }
}
(lldb) frame select 14
frame #14: 0x00000001007a99f2 bitcoind`CWallet::BlockConnected(this=0x000000015b7cce20, block=0x000000015c765d28, vtxConflicted=size=0, height=351323) at wallet.cpp:1129:9
  1126	    m_last_block_processed = block_hash;
  1127	    for (size_t index = 0; index < block.vtx.size(); index++) {
  1128	        CWalletTx::Confirmation confirm(CWalletTx::Status::CONFIRMED, height, block_hash, index);
-> 1129	        SyncTransaction(block.vtx[index], confirm);
  1130	        TransactionRemovedFromMempool(block.vtx[index]);
  1131	    }
  1132	    for (const CTransactionRef& ptx : vtxConflicted) {
(lldb) frame variable cs_wallet
(RecursiveMutex) cs_wallet = {
 std::__1::recursive_mutex = {
   __m_ = (__sig = 1297437784, __opaque = "")
 }
}
(lldb) frame select 15
frame #15: 0x00000001007a9bb2 bitcoind`non-virtual thunk to CWallet::BlockConnected(this=0x000000015b7cce20, block=0x000000015c765d28, vtxConflicted=size=0, height=351323) at wallet.cpp:0
  1   	// Copyright (c) 2009-2010 Satoshi Nakamoto
  2   	// Copyright (c) 2009-2020 The Bitcoin Core developers
  3   	// Distributed under the MIT software license, see the accompanying
  4   	// file COPYING or http://www.opensource.org/licenses/mit-license.php.
  5   	
  6   	#include <wallet/wallet.h>
  7   	
(lldb) frame variable cs_wallet
error: no variable named 'cs_wallet' found in this frame
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment