Deadlock when upgrading an existing 2.0.3 installation to 2.1

Issue #228 resolved
CoinGame
created an issue

As reported by woodstockmerkle here

I've gotten a development environment online and was able to reproduce the "Splash Screen hanging" in the debugger.

The workaround to move aside the wallets during the conversion is logical.

The hanging startup screen appears to be a mutex deadlock condition between what seems to be the startup code that "re-sends" the transactions, and the code that starts the conversion. (I think.)

i.e.: - Thread #1 (main) grabs cs_wallet, then cs_setpwalletRegistered - Thread #8 (conversion thread) grabs cs_setpwalletRegistered, then grabs cs_wallet.

@Michael Witrant @coingame @pennybreaker does this help?

A final note that I suppressed Nu network interaction with a nu.conf entry of "connect=" to an unavailable host.

Stack traces below:

Thread #1

0 ntdll!ZwWaitForSingleObject 0x7ff96a3e0e7a
1 WaitForSingleObjectEx 0x7ff967751118
2 boost::detail::basic_timed_mutex::lock basic_timed_mutex.hpp 84 0x70381e
3 boost::detail::basic_recursive_mutex_impl<boost::detail::basic_timed_mutex>::lock basic_recursive_mutex.hpp 56 0x70381e
4 AnnotatedMixin<boost::recursive_mutex>::lock sync.h 22 0x70381e
5 boost::unique_lock<AnnotatedMixin<boost::recursive_mutex>>::lock lock_types.hpp 346 0x70381e
6 CMutexLock<AnnotatedMixin<boost::recursive_mutex>>::Enter sync.h 70 0x70381e
7 CMutexLock<AnnotatedMixin<boost::recursive_mutex>>::CMutexLock sync.h 91 0x70381e
8 SyncWithWallets main.cpp 165 0x4496c5
--> LOCK(cs_setpwalletRegistered); 9 CTxMemPool::accept main.cpp 1026 0x4562ce
10 CTransaction::AcceptToMemoryPool main.cpp 1034 0x45bb04
11 CMerkleTx::AcceptToMemoryPool main.cpp 1155 0x45bced
12 CWalletTx::AcceptWalletTransaction main.cpp 1174 0x45bced
--> LOCK(mempool.cs); 13 CWallet::ReacceptWalletTransactions wallet.cpp 961 0x4b97f2
--> LOCK(cs_wallet); 14 AppInit2 init.cpp 1138 0x47bab0
15 qMain bitcoin.cpp 251 0x40353f
16 WinMain 0x58dca8
17 __tmainCRTStartup C:/devel/build-nu/release/nu.exe 332 0x4013ed
18 WinMainCRTStartup C:/devel/build-nu/release/nu.exe 184 0x4014fb

Thread #8

0 ntdll!ZwWaitForSingleObject 0x7ff96a3e0e7a
1 WaitForSingleObjectEx 0x7ff967751118
2 boost::detail::basic_timed_mutex::lock basic_timed_mutex.hpp 84 0x70381e
3 boost::detail::basic_recursive_mutex_impl<boost::detail::basic_timed_mutex>::lock basic_recursive_mutex.hpp 56 0x70381e
4 AnnotatedMixin<boost::recursive_mutex>::lock sync.h 22 0x70381e
5 boost::unique_lock<AnnotatedMixin<boost::recursive_mutex>>::lock lock_types.hpp 346 0x70381e
6 CMutexLock<AnnotatedMixin<boost::recursive_mutex>>::Enter sync.h 70 0x70381e
7 CMutexLock<AnnotatedMixin<boost::recursive_mutex>>::CMutexLock sync.h 91 0x70381e
8 CWallet::UpdatedTransaction wallet.cpp 2811 0x4b658b --> LOCK(cs_wallet);
9 UpdatedTransaction main.cpp 195 0x464391
--> LOCK(cs_setpwalletRegistered); 10 CBlock::AddToBlockIndex main.cpp 2564 0x464391
11 CBlock::AcceptBlock main.cpp 2885 0x464627
12 ProcessBlock main.cpp 3123 0x466280
13 LoadExternalBlockFile main.cpp 3898 0x46716b
--> LOCK(cs_main);

14 ThreadImport init.cpp 417 0x46fc29
15 boost::_bi::list1<boost::_bi::value<std::vector<boost::filesystem::path>>>::operator()<void ( )(std::vector<boost::filesystem::path>), boost::_bi::list0> bind.hpp 253 0x768456
16 boost::_bi::bind_t<void, void (
)(std::vector<boost::filesystem::path>), boost::_bi::list1<boost::_bi::value<std::vector<boost::filesystem::path>>>>::operator() bind_template.hpp 20 0x768456
17 boost::detail::thread_data<boost::_bi::bind_t<void, void ( )(std::vector<boost::filesystem::path>), boost::_bi::list1<boost::_bi::value<std::vector<boost::filesystem::path>>>>>::run thread.hpp 116 0x768456
18 boost::(anonymous namespace)::thread_start_function(void
) 0x6efa6d
19 msvcrt!_strupr 0x7ff968780b13
... <More>

Comments (2)

  1. Log in to comment