elements/ci/test
Andrew Poelstra c0fda0cc05 Merge ddc0a600b3 into merged_master (Bitcoin PR #18617)
For reasons I do not really grok, this PR changes the timing behavior of the
functional tests to reliably expose a deadlock in the claimpegin RPC that has
existed since the 0.17 rebase.

The mechanism is: in `claimpegin` in src/wallet/rpcwallet.cpp:5873, we call
`AcceptToMemoryPoolWorker`. This requires cs_main to be locked, which it is
not (contrast Core's `testmempoolaccept` RPC, which similarly calls
`AcceptToMemoryPoolWorker` from the RPC thread, and locks cs_main immediately
before).

We do *say* that it is locked, in the `LockAssertion` one the line above, but
this was added in ad3d496d78 during the 0.17
rebase (PR #620), apparently to shut up some linter on OSX, and as near as I
can tell it was never true.

Anyway, `AcceptToMemoryPoolWorker` calls through a couple layers which assume
cs_main is locked, to `AcceptSingleTransaction`, which locks m_pool.cs on line
src/validation.cpp:1101. It then calls `PreChecks`, which on line 784 calls
::ChainActive(), which _actually_ locks cs_main, though only briefly. This
line is the deadlock, because we locked m_pool.cs followed by cs_main...

...meanwhile, in src/net_processing.cpp, we lock cs_main at the top of the
`PeerLogicValidation::SendMessages` loop (src/net_processing.cpp:3628). In the
same loop, in the `feefilter` message processing, we call CTxMemPool::GetMinFee
(src/net_processing.cpp:4137), which locks m_pool.cs. Deadlock.

Anyway, that explains the change to locking behavior that I added to an
otherwise test-only PR.
2020-11-26 01:08:36 +00:00
..
00_setup_env.sh Merge #18798: ci: Fix default retry script usage 2020-04-29 11:14:14 -04:00
00_setup_env_arm.sh scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
00_setup_env_i686_centos.sh test: set a name for CI Docker containers 2020-02-10 20:03:52 +08:00
00_setup_env_mac.sh scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
00_setup_env_mac_host.sh ci: Document why tests can not be run on mac 2020-04-28 07:10:19 -04:00
00_setup_env_native_asan.sh scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
00_setup_env_native_fuzz.sh scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
00_setup_env_native_fuzz_with_valgrind.sh scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
00_setup_env_native_nowallet.sh scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
00_setup_env_native_qt5.sh ci: Merge C++17 build with one of the existing ones 2020-04-30 12:50:36 -04:00
00_setup_env_native_tsan.sh ci: Remove xenial tsan workaround 2020-04-19 08:52:49 -04:00
00_setup_env_native_valgrind.sh test: add factor option to adjust test timeouts 2020-05-03 01:42:40 +02:00
00_setup_env_s390x.sh scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
00_setup_env_s390x_host.sh scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
00_setup_env_win64.sh scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
03_before_install.sh scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
04_install.sh Merge #18798: ci: Fix default retry script usage 2020-04-29 11:14:14 -04:00
05_before_script.sh Merge e302830fae into merged_master (Bitcoin PR #18774) 2020-11-26 01:08:33 +00:00
06_script_a.sh Merge a483ffd689 into merged_master (Bitcoin PR #18735) 2020-11-26 01:08:32 +00:00
06_script_b.sh Merge 41162c0ba0 into merged_master (Bitcoin PR #17423) 2020-11-09 23:10:13 +00:00
wrap-qemu.sh scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
wrap-valgrind.sh scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00