Page MenuHomePhabricator

Fix threading issue in processor_tests.cpp
AbandonedPublic

Authored by deadalnix on Jun 4 2021, 16:43.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

Operations were performed on the PeerManager without holding the proper locks.

This wasn't a problem before because there were no concurent operation being performed, but now there are.

Test Plan
ninja check-avalanche

Run the test suite using TSAN

Event Timeline

Tail of the build log:

wallet_import_with_label.py             | ✓ Passed  | 1 s
wallet_importdescriptors.py             | ✓ Passed  | 7 s
wallet_importmulti.py                   | ✓ Passed  | 6 s
wallet_importprunedfunds.py             | ✓ Passed  | 2 s
wallet_keypool.py                       | ✓ Passed  | 3 s
wallet_keypool_topup.py                 | ✓ Passed  | 4 s
wallet_labels.py                        | ✓ Passed  | 2 s
wallet_listreceivedby.py                | ✓ Passed  | 22 s
wallet_listsinceblock.py                | ✓ Passed  | 6 s
wallet_listtransactions.py              | ✓ Passed  | 13 s
wallet_multiwallet.py                   | ✓ Passed  | 19 s
wallet_multiwallet.py --usecli          | ✓ Passed  | 21 s
wallet_reorgsrestore.py                 | ✓ Passed  | 5 s
wallet_resendwallettransactions.py      | ✓ Passed  | 11 s
wallet_txn_clone.py                     | ✓ Passed  | 3 s
wallet_txn_clone.py --mineblock         | ✓ Passed  | 4 s
wallet_txn_doublespend.py               | ✓ Passed  | 2 s
wallet_txn_doublespend.py --mineblock   | ✓ Passed  | 4 s
wallet_watchonly.py                     | ✓ Passed  | 1 s
wallet_watchonly.py --usecli            | ✓ Passed  | 1 s
wallet_zapwallettxes.py                 | ✓ Passed  | 7 s

ALL                                     | ✓ Passed  | 1461 s (accumulated) 
Runtime: 293 s

----------------------------------------------------------------------
Ran 5 tests in 0.003s

OK

[157/453] avalanche: testing processor_tests
FAILED: src/avalanche/test/CMakeFiles/check-avalanche-processor_tests 
cd /work/abc-ci-builds/build-debug/src/avalanche/test && /usr/bin/cmake -E make_directory /work/abc-ci-builds/build-debug/test/junit && /usr/bin/cmake -E make_directory /work/abc-ci-builds/build-debug/test/log && /usr/bin/cmake -E env /work/cmake/utils/log-and-print-on-failure.sh /work/abc-ci-builds/build-debug/test/log/avalanche-processor_tests.log /work/abc-ci-builds/build-debug/src/avalanche/test/test-avalanche --run_test=processor_tests --logger=HRF,message:JUNIT,message,avalanche-processor_tests.xml --catch_system_errors=no
Running 11 test cases...
Assertion failed: detected inconsistent lock order at ../../src/sync.cpp:117, details in debug log.
Aborted (core dumped)
[190/453] Test Bitcoin RPC authentication...
...
----------------------------------------------------------------------
Ran 3 tests in 0.004s

OK
[191/453] cd /work/contrib/devtools/chainparams && /usr/bin/python3.7 ./test_make_chainparams.py
.....
----------------------------------------------------------------------
Ran 5 tests in 0.001s

OK
[194/453] Running seeder test suite
PASSED: seeder test suite
[402/453] Running secp256k1 test suite
PASSED: secp256k1 test suite
[422/453] Running pow test suite
PASSED: pow test suite
[445/453] Running bitcoin-qt test suite
PASSED: bitcoin-qt test suite
[450/453] Running bitcoin test suite
PASSED: bitcoin test suite
ninja: build stopped: cannot make progress due to previous errors.
Build build-debug failed with exit code 1

Tail of the build log:

wallet_import_with_label.py             | ✓ Passed  | 1 s
wallet_importdescriptors.py             | ✓ Passed  | 6 s
wallet_importmulti.py                   | ✓ Passed  | 6 s
wallet_importprunedfunds.py             | ✓ Passed  | 2 s
wallet_keypool.py                       | ✓ Passed  | 3 s
wallet_keypool_topup.py                 | ✓ Passed  | 4 s
wallet_labels.py                        | ✓ Passed  | 3 s
wallet_listreceivedby.py                | ✓ Passed  | 18 s
wallet_listsinceblock.py                | ✓ Passed  | 5 s
wallet_listtransactions.py              | ✓ Passed  | 11 s
wallet_multiwallet.py                   | ✓ Passed  | 18 s
wallet_multiwallet.py --usecli          | ✓ Passed  | 20 s
wallet_reorgsrestore.py                 | ✓ Passed  | 5 s
wallet_resendwallettransactions.py      | ✓ Passed  | 5 s
wallet_txn_clone.py                     | ✓ Passed  | 3 s
wallet_txn_clone.py --mineblock         | ✓ Passed  | 4 s
wallet_txn_doublespend.py               | ✓ Passed  | 3 s
wallet_txn_doublespend.py --mineblock   | ✓ Passed  | 4 s
wallet_watchonly.py                     | ✓ Passed  | 1 s
wallet_watchonly.py --usecli            | ✓ Passed  | 1 s
wallet_zapwallettxes.py                 | ✓ Passed  | 7 s

ALL                                     | ✓ Passed  | 1444 s (accumulated) 
Runtime: 289 s

----------------------------------------------------------------------
Ran 5 tests in 0.026s

OK

[156/453] avalanche: testing processor_tests
FAILED: src/avalanche/test/CMakeFiles/check-avalanche-processor_tests 
cd /work/abc-ci-builds/build-debug/src/avalanche/test && /usr/bin/cmake -E make_directory /work/abc-ci-builds/build-debug/test/junit && /usr/bin/cmake -E make_directory /work/abc-ci-builds/build-debug/test/log && /usr/bin/cmake -E env /work/cmake/utils/log-and-print-on-failure.sh /work/abc-ci-builds/build-debug/test/log/avalanche-processor_tests.log /work/abc-ci-builds/build-debug/src/avalanche/test/test-avalanche --run_test=processor_tests --logger=HRF,message:JUNIT,message,avalanche-processor_tests.xml --catch_system_errors=no
Running 11 test cases...
Assertion failed: detected inconsistent lock order at ../../src/sync.cpp:117, details in debug log.
Aborted (core dumped)
[190/453] Running seeder test suite
PASSED: seeder test suite
[192/453] Test Bitcoin RPC authentication...
...
----------------------------------------------------------------------
Ran 3 tests in 0.005s

OK
[193/453] cd /work/contrib/devtools/chainparams && /usr/bin/python3.7 ./test_make_chainparams.py
.....
----------------------------------------------------------------------
Ran 5 tests in 0.001s

OK
[414/453] Running secp256k1 test suite
PASSED: secp256k1 test suite
[424/453] Running pow test suite
PASSED: pow test suite
[445/453] Running bitcoin-qt test suite
PASSED: bitcoin-qt test suite
[450/453] Running bitcoin test suite
PASSED: bitcoin test suite
ninja: build stopped: cannot make progress due to previous errors.
Build build-debug failed with exit code 1

Please consider D9634 for an alternative solution