HomePhabricator

test: Fix inconsistent lock order in wallet_tests/CreateWallet

Description

test: Fix inconsistent lock order in wallet_tests/CreateWallet

Summary:

sync: Improve CheckLastCritical()

This commit adds actual lock stack logging if check fails.

[skip ci] sync: Check precondition in LEAVE_CRITICAL_SECTION() macro

This change reveals a bug in the wallet_tests/CreateWalletFromFile test,
that will be fixed in the following commit.

test: Fix inconsistent lock order in wallet_tests/CreateWallet

This is a backport of core#19982

Test Plan:
I confirmed that after commit #2, running ninja check with -DCMAKE_BUILD_TYPE=Debug reveals a lock order issue:

../src/wallet/test/wallet_tests.cpp:853 wallet_param->wallet()->cs_wallet was not most recent critical section locked, details in debug log.

This goes away with the next commit.

Tested also with TSAN, after removing the suppression.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D11093

Details

Provenance
Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>Authored on Sep 20 2020, 08:33
PiRKCommitted on Feb 22 2022, 16:47
PiRKPushed on Feb 22 2022, 16:47
Reviewer
Restricted Project
Differential Revision
D11093: test: Fix inconsistent lock order in wallet_tests/CreateWallet
Parents
rABC0e5745ce31e3: test: Add testing of ParseInt/ParseUInt edge cases with leading +/-/0:s
Branches
Unknown
Tags
Unknown