Page MenuHomePhabricator

qt/test: Reset chainman in ~ChainstateManager instead
ClosedPublic

Authored by PiRK on Jul 15 2022, 08:29.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC3151d3637eac: qt/test: Reset chainman in ~ChainstateManager instead
Summary

There are some mutable, global state variables that are currently reseti by UnloadBlockIndex such as pindexBestHeader which should be cleaned up whenever the ChainstateManager is unloaded/reset/destructed/etc.

Not cleaning them up leads to bugs like a use-after-free that happens like so:

  1. At the end of a test, ChainstateManager is destructed, which also destructs BlockManager, which calls BlockManager::Unload to free all CBlockIndexes in its BlockMap
  2. Since pindexBestHeader is not cleaned up, it now points to an invalid0 location
  3. Another test starts to init, and calls LoadGenesisBlock, which calls AddToBlockIndex, which compares the genesis block with an invalid location
  4. Cute puppies perish by the hundreds

Previously, for normal codepaths (e.g. bitcoind), we relied on the fact that our program will be unloaded by the operating system which effectively resets these variables. The one exception is in QT tests, where these variables had to be manually reset.

Since now ChainstateManager is no longer a global, we can just put this logic in its destructor to make sure that callers are always correct.

Over time, we should probably move these mutable global state variables into ChainstateManager or CChainState so it's easier to reason about their lifecycles.

This is a backport of core#21866 [11/12]
https://github.com/bitcoin/bitcoin/pull/21866/commits/972c5166ee685447a6d4bf5e501b07a0871fba85

Depends on D11751 and D11744

Backport note: it is not possible to drop the chainman reset code in apptests.cpp at this point, as the unit tests still use g_chainman. This has to be removed in the next commit in D11753, when we actually make the unit tests use their own chain state manager instead of the global one.

Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Jul 15 2022, 08:29

Tail of the build log:

Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 334ms
********* Finished testing of AppTests *********
********* Start testing of URITests *********
Config: Using QtTest library 5.11.3, Qt 5.11.3 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.3.0)
PASS   : URITests::initTestCase()
PASS   : URITests::uriTestsCashAddr()
PASS   : URITests::uriTestFormatURI()
PASS   : URITests::cleanupTestCase()
Totals: 4 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of URITests *********
********* Start testing of PaymentServerTests *********
Config: Using QtTest library 5.11.3, Qt 5.11.3 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.3.0)
PASS   : PaymentServerTests::initTestCase()
QDEBUG : PaymentServerTests::paymentServerTests() PaymentServer::initNetManager: No active proxy server found.
QDEBUG : PaymentServerTests::paymentServerTests() PaymentServer::processPaymentRequest: Secure payment request from  "testmerchant.org"
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: Payment request: certificate expired or not yet active:  QSslCertificate("3", "03", "LxHILx+N3qwVoAcCmQ5cyw==", (), ("Expired Test Merchant"), QMap(), QDateTime(2013-02-23 21:26:43.000 UTC Qt::TimeSpec(UTC)), QDateTime(2013-02-24 21:26:43.000 UTC Qt::TimeSpec(UTC)))
QDEBUG : PaymentServerTests::paymentServerTests() PaymentServer::processPaymentRequest: Insecure payment request to  "ecash:qz2kpzsrera6t6gnrdxjemlz64s4tuve4qlmqu2p5m"
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: Payment request: certificate expired or not yet active:  QSslCertificate("3", "03", "LxHILx+N3qwVoAcCmQ5cyw==", (), ("Expired Test Merchant"), QMap(), QDateTime(2013-02-23 21:26:43.000 UTC Qt::TimeSpec(UTC)), QDateTime(2013-02-24 21:26:43.000 UTC Qt::TimeSpec(UTC)))
QDEBUG : PaymentServerTests::paymentServerTests() PaymentServer::processPaymentRequest: Secure payment request from  "testmerchant8.org"
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: Payment request: certificate expired or not yet active:  QSslCertificate("3", "06", "MiZaQ+g9lSHZGuHWkXZG+g==", (), ("Payment Request Intermediate 5"), QMap(), QDateTime(2013-02-23 22:59:51.000 UTC Qt::TimeSpec(UTC)), QDateTime(2013-02-24 22:59:51.000 UTC Qt::TimeSpec(UTC)))
QDEBUG : PaymentServerTests::paymentServerTests() PaymentServer::processPaymentRequest: Insecure payment request to  "ecash:qz2kpzsrera6t6gnrdxjemlz64s4tuve4qlmqu2p5m"
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: Payment request: certificate expired or not yet active:  QSslCertificate("3", "06", "MiZaQ+g9lSHZGuHWkXZG+g==", (), ("Payment Request Intermediate 5"), QMap(), QDateTime(2013-02-23 22:59:51.000 UTC Qt::TimeSpec(UTC)), QDateTime(2013-02-24 22:59:51.000 UTC Qt::TimeSpec(UTC)))
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: SSL error:  certificate signature failure
QDEBUG : PaymentServerTests::paymentServerTests() PaymentServer::processPaymentRequest: Insecure payment request to  "ecash:qz2kpzsrera6t6gnrdxjemlz64s4tuve4qlmqu2p5m"
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: SSL error:  certificate signature failure
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: SSL error:  unable to get local issuer certificate
QDEBUG : PaymentServerTests::paymentServerTests() PaymentServer::processPaymentRequest: Insecure payment request to  "ecash:qz2kpzsrera6t6gnrdxjemlz64s4tuve4qlmqu2p5m"
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: SSL error:  unable to get local issuer certificate
QWARN  : PaymentServerTests::paymentServerTests() "PaymentServer::verifyNetwork: Payment request network \"test\" doesn't match client network \"main\"."
QWARN  : PaymentServerTests::paymentServerTests() "PaymentServer::verifyExpired: Payment request expired \"1970-01-01T00:00:01Z\"."
QWARN  : PaymentServerTests::paymentServerTests() "PaymentServer::verifyExpired: Payment request expired \"\"."
QWARN  : PaymentServerTests::paymentServerTests() "PaymentServer::verifySize: Payment request too large (50001 bytes, allowed 50000 bytes)."
QWARN  : PaymentServerTests::paymentServerTests() "PaymentServer::verifyAmount: Payment request amount out of allowed range (2100000100000000, allowed 0 - 2100000000000000)."
PASS   : PaymentServerTests::paymentServerTests()
PASS   : PaymentServerTests::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 24ms
********* Finished testing of PaymentServerTests *********
********* Start testing of RPCNestedTests *********
Config: Using QtTest library 5.11.3, Qt 5.11.3 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.3.0)
PASS   : RPCNestedTests::initTestCase()
FAIL!  : RPCNestedTests::rpcNestedTests() Caught unhandled exception
   Loc: [qtestcase.cpp(1847)]
Totals: 1 passed, 1 failed, 0 skipped, 0 blacklisted, 8ms
********* Finished testing of RPCNestedTests *********
terminate called after throwing an instance of 'std::logic_error'
  what():  should not be overwriting a chainstate
Aborted (core dumped)
[470/479] bitcoin: testing transaction_tests
[471/479] Running utility command for check-bitcoin-transaction_tests
[472/479] secp256k1: testing secp256k1-tests
[473/479] Running secp256k1 test suite
PASSED: secp256k1 test suite
[474/479] bitcoin: testing coinselector_tests
[475/479] Running utility command for check-bitcoin-coinselector_tests
[476/479] bitcoin: testing coins_tests
[477/479] Running utility command for check-bitcoin-coins_tests
[478/479] Running bitcoin test suite
PASSED: bitcoin test suite
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang failed with exit code 1

Tail of the build log:

QWARN  : AppTests::appTests() This plugin does not support grabbing the keyboard
QWARN  : AppTests::appTests() This plugin does not support propagateSizeHints()
QDEBUG : AppTests::appTests() requestShutdown : Requesting shutdown
QDEBUG : AppTests::appTests() shutdown : Running Shutdown in thread
QDEBUG : AppTests::appTests() shutdown : Shutdown finished
PASS   : AppTests::appTests()
PASS   : AppTests::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 246ms
********* Finished testing of AppTests *********
********* Start testing of URITests *********
Config: Using QtTest library 5.11.3, Qt 5.11.3 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.3.0)
PASS   : URITests::initTestCase()
PASS   : URITests::uriTestsCashAddr()
PASS   : URITests::uriTestFormatURI()
PASS   : URITests::cleanupTestCase()
Totals: 4 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of URITests *********
********* Start testing of PaymentServerTests *********
Config: Using QtTest library 5.11.3, Qt 5.11.3 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.3.0)
PASS   : PaymentServerTests::initTestCase()
QDEBUG : PaymentServerTests::paymentServerTests() PaymentServer::initNetManager: No active proxy server found.
QDEBUG : PaymentServerTests::paymentServerTests() PaymentServer::processPaymentRequest: Secure payment request from  "testmerchant.org"
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: Payment request: certificate expired or not yet active:  QSslCertificate("3", "03", "LxHILx+N3qwVoAcCmQ5cyw==", (), ("Expired Test Merchant"), QMap(), QDateTime(2013-02-23 21:26:43.000 UTC Qt::TimeSpec(UTC)), QDateTime(2013-02-24 21:26:43.000 UTC Qt::TimeSpec(UTC)))
QDEBUG : PaymentServerTests::paymentServerTests() PaymentServer::processPaymentRequest: Insecure payment request to  "ecash:qz2kpzsrera6t6gnrdxjemlz64s4tuve4qlmqu2p5m"
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: Payment request: certificate expired or not yet active:  QSslCertificate("3", "03", "LxHILx+N3qwVoAcCmQ5cyw==", (), ("Expired Test Merchant"), QMap(), QDateTime(2013-02-23 21:26:43.000 UTC Qt::TimeSpec(UTC)), QDateTime(2013-02-24 21:26:43.000 UTC Qt::TimeSpec(UTC)))
QDEBUG : PaymentServerTests::paymentServerTests() PaymentServer::processPaymentRequest: Secure payment request from  "testmerchant8.org"
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: Payment request: certificate expired or not yet active:  QSslCertificate("3", "06", "MiZaQ+g9lSHZGuHWkXZG+g==", (), ("Payment Request Intermediate 5"), QMap(), QDateTime(2013-02-23 22:59:51.000 UTC Qt::TimeSpec(UTC)), QDateTime(2013-02-24 22:59:51.000 UTC Qt::TimeSpec(UTC)))
QDEBUG : PaymentServerTests::paymentServerTests() PaymentServer::processPaymentRequest: Insecure payment request to  "ecash:qz2kpzsrera6t6gnrdxjemlz64s4tuve4qlmqu2p5m"
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: Payment request: certificate expired or not yet active:  QSslCertificate("3", "06", "MiZaQ+g9lSHZGuHWkXZG+g==", (), ("Payment Request Intermediate 5"), QMap(), QDateTime(2013-02-23 22:59:51.000 UTC Qt::TimeSpec(UTC)), QDateTime(2013-02-24 22:59:51.000 UTC Qt::TimeSpec(UTC)))
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: SSL error:  certificate signature failure
QDEBUG : PaymentServerTests::paymentServerTests() PaymentServer::processPaymentRequest: Insecure payment request to  "ecash:qz2kpzsrera6t6gnrdxjemlz64s4tuve4qlmqu2p5m"
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: SSL error:  certificate signature failure
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: SSL error:  unable to get local issuer certificate
QDEBUG : PaymentServerTests::paymentServerTests() PaymentServer::processPaymentRequest: Insecure payment request to  "ecash:qz2kpzsrera6t6gnrdxjemlz64s4tuve4qlmqu2p5m"
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: SSL error:  unable to get local issuer certificate
QWARN  : PaymentServerTests::paymentServerTests() "PaymentServer::verifyNetwork: Payment request network \"test\" doesn't match client network \"main\"."
QWARN  : PaymentServerTests::paymentServerTests() "PaymentServer::verifyExpired: Payment request expired \"1970-01-01T00:00:01Z\"."
QWARN  : PaymentServerTests::paymentServerTests() "PaymentServer::verifyExpired: Payment request expired \"\"."
QWARN  : PaymentServerTests::paymentServerTests() "PaymentServer::verifySize: Payment request too large (50001 bytes, allowed 50000 bytes)."
QWARN  : PaymentServerTests::paymentServerTests() "PaymentServer::verifyAmount: Payment request amount out of allowed range (2100000100000000, allowed 0 - 2100000000000000)."
PASS   : PaymentServerTests::paymentServerTests()
PASS   : PaymentServerTests::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 17ms
********* Finished testing of PaymentServerTests *********
********* Start testing of RPCNestedTests *********
Config: Using QtTest library 5.11.3, Qt 5.11.3 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.3.0)
PASS   : RPCNestedTests::initTestCase()
FAIL!  : RPCNestedTests::rpcNestedTests() Caught unhandled exception
   Loc: [qtestcase.cpp(1847)]
Totals: 1 passed, 1 failed, 0 skipped, 0 blacklisted, 8ms
********* Finished testing of RPCNestedTests *********
terminate called after throwing an instance of 'std::logic_error'
  what():  should not be overwriting a chainstate
Aborted (core dumped)
[469/472] bitcoin: testing coins_tests
[470/472] Running utility command for check-bitcoin-coins_tests
[471/472] Running bitcoin test suite
PASSED: bitcoin test suite
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang-tidy failed with exit code 1

Tail of the build log:

OK
[194/440] Running seeder test suite
PASSED: seeder test suite
[200/440] Running pow test suite
PASSED: pow test suite
[203/440] Running avalanche test suite
PASSED: avalanche test suite
[206/440] bitcoin-qt: testing test_bitcoin-qt
FAILED: src/qt/test/CMakeFiles/check-bitcoin-qt-test_bitcoin-qt 
cd /work/abc-ci-builds/build-without-wallet/src/qt/test && /usr/bin/cmake -E make_directory /work/abc-ci-builds/build-without-wallet/test/junit && /usr/bin/cmake -E make_directory /work/abc-ci-builds/build-without-wallet/test/log && /usr/bin/cmake -E env /work/cmake/utils/log-and-print-on-failure.sh /work/abc-ci-builds/build-without-wallet/test/log/bitcoin-qt-test_bitcoin-qt.log /work/abc-ci-builds/build-without-wallet/src/qt/test/test_bitcoin-qt
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
********* Start testing of AppTests *********
Config: Using QtTest library 5.11.3, Qt 5.11.3 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.3.0)
PASS   : AppTests::initTestCase()
QINFO  : AppTests::appTests() Backing up GUI settings to "/tmp/test_common_Bitcoin ABC/28265bd04fc4c858e9fc1433c8dffc8804e5259b4c2cdc63b9cbb4dde4770070/regtest/guisettings.ini.bak"
QDEBUG : AppTests::appTests() requestInitialize : Requesting initialize
QDEBUG : AppTests::appTests() initialize : Running initialization in thread
QDEBUG : AppTests::appTests() initializeResult : Initialization result:  true
QINFO  : AppTests::appTests() Platform customization: "other"
QWARN  : AppTests::appTests() This plugin does not support propagateSizeHints()
QWARN  : AppTests::appTests() This plugin does not support raise()
QWARN  : AppTests::appTests() This plugin does not support grabbing the keyboard
QWARN  : AppTests::appTests() This plugin does not support propagateSizeHints()
QDEBUG : AppTests::appTests() requestShutdown : Requesting shutdown
QDEBUG : AppTests::appTests() shutdown : Running Shutdown in thread
QDEBUG : AppTests::appTests() shutdown : Shutdown finished
PASS   : AppTests::appTests()
PASS   : AppTests::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 1852ms
********* Finished testing of AppTests *********
********* Start testing of URITests *********
Config: Using QtTest library 5.11.3, Qt 5.11.3 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.3.0)
PASS   : URITests::initTestCase()
PASS   : URITests::uriTestsCashAddr()
PASS   : URITests::uriTestFormatURI()
PASS   : URITests::cleanupTestCase()
Totals: 4 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of URITests *********
********* Start testing of RPCNestedTests *********
Config: Using QtTest library 5.11.3, Qt 5.11.3 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.3.0)
PASS   : RPCNestedTests::initTestCase()
FAIL!  : RPCNestedTests::rpcNestedTests() Caught unhandled exception
   Loc: [qtestcase.cpp(1847)]
Totals: 1 passed, 1 failed, 0 skipped, 0 blacklisted, 10ms
********* Finished testing of RPCNestedTests *********
terminate called after throwing an instance of 'std::logic_error'
  what():  should not be overwriting a chainstate
Aborted (core dumped)
[207/440] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/script_tests.cpp.o
In file included from /usr/include/boost/test/unit_test.hpp:19,
                 from ../../src/test/script_tests.cpp:30:
../../src/test/script_tests.cpp: In member function ‘void script_tests::script_build::test_method()’:
../../src/test/script_tests.cpp:540:22: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without
 BOOST_AUTO_TEST_CASE(script_build) {
                      ^~~~~~~~~~~~
[438/440] Running bitcoin test suite
PASSED: bitcoin test suite
ninja: build stopped: cannot make progress due to previous errors.
Build build-without-wallet failed with exit code 1

Tail of the build log:

QWARN  : AppTests::appTests() This plugin does not support grabbing the keyboard
QWARN  : AppTests::appTests() This plugin does not support propagateSizeHints()
QDEBUG : AppTests::appTests() requestShutdown : Requesting shutdown
QDEBUG : AppTests::appTests() shutdown : Running Shutdown in thread
QDEBUG : AppTests::appTests() shutdown : Shutdown finished
PASS   : AppTests::appTests()
PASS   : AppTests::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 837ms
********* Finished testing of AppTests *********
********* Start testing of URITests *********
Config: Using QtTest library 5.11.3, Qt 5.11.3 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.3.0)
PASS   : URITests::initTestCase()
PASS   : URITests::uriTestsCashAddr()
PASS   : URITests::uriTestFormatURI()
PASS   : URITests::cleanupTestCase()
Totals: 4 passed, 0 failed, 0 skipped, 0 blacklisted, 17ms
********* Finished testing of URITests *********
********* Start testing of PaymentServerTests *********
Config: Using QtTest library 5.11.3, Qt 5.11.3 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.3.0)
PASS   : PaymentServerTests::initTestCase()
QDEBUG : PaymentServerTests::paymentServerTests() PaymentServer::initNetManager: No active proxy server found.
QDEBUG : PaymentServerTests::paymentServerTests() PaymentServer::processPaymentRequest: Secure payment request from  "testmerchant.org"
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: Payment request: certificate expired or not yet active:  QSslCertificate("3", "03", "LxHILx+N3qwVoAcCmQ5cyw==", (), ("Expired Test Merchant"), QMap(), QDateTime(2013-02-23 21:26:43.000 UTC Qt::TimeSpec(UTC)), QDateTime(2013-02-24 21:26:43.000 UTC Qt::TimeSpec(UTC)))
QDEBUG : PaymentServerTests::paymentServerTests() PaymentServer::processPaymentRequest: Insecure payment request to  "ecash:qz2kpzsrera6t6gnrdxjemlz64s4tuve4qlmqu2p5m"
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: Payment request: certificate expired or not yet active:  QSslCertificate("3", "03", "LxHILx+N3qwVoAcCmQ5cyw==", (), ("Expired Test Merchant"), QMap(), QDateTime(2013-02-23 21:26:43.000 UTC Qt::TimeSpec(UTC)), QDateTime(2013-02-24 21:26:43.000 UTC Qt::TimeSpec(UTC)))
QDEBUG : PaymentServerTests::paymentServerTests() PaymentServer::processPaymentRequest: Secure payment request from  "testmerchant8.org"
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: Payment request: certificate expired or not yet active:  QSslCertificate("3", "06", "MiZaQ+g9lSHZGuHWkXZG+g==", (), ("Payment Request Intermediate 5"), QMap(), QDateTime(2013-02-23 22:59:51.000 UTC Qt::TimeSpec(UTC)), QDateTime(2013-02-24 22:59:51.000 UTC Qt::TimeSpec(UTC)))
QDEBUG : PaymentServerTests::paymentServerTests() PaymentServer::processPaymentRequest: Insecure payment request to  "ecash:qz2kpzsrera6t6gnrdxjemlz64s4tuve4qlmqu2p5m"
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: Payment request: certificate expired or not yet active:  QSslCertificate("3", "06", "MiZaQ+g9lSHZGuHWkXZG+g==", (), ("Payment Request Intermediate 5"), QMap(), QDateTime(2013-02-23 22:59:51.000 UTC Qt::TimeSpec(UTC)), QDateTime(2013-02-24 22:59:51.000 UTC Qt::TimeSpec(UTC)))
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: SSL error:  certificate signature failure
QDEBUG : PaymentServerTests::paymentServerTests() PaymentServer::processPaymentRequest: Insecure payment request to  "ecash:qz2kpzsrera6t6gnrdxjemlz64s4tuve4qlmqu2p5m"
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: SSL error:  certificate signature failure
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: SSL error:  unable to get local issuer certificate
QDEBUG : PaymentServerTests::paymentServerTests() PaymentServer::processPaymentRequest: Insecure payment request to  "ecash:qz2kpzsrera6t6gnrdxjemlz64s4tuve4qlmqu2p5m"
QWARN  : PaymentServerTests::paymentServerTests() PaymentRequestPlus::getMerchant: SSL error:  unable to get local issuer certificate
QWARN  : PaymentServerTests::paymentServerTests() "PaymentServer::verifyNetwork: Payment request network \"test\" doesn't match client network \"main\"."
QWARN  : PaymentServerTests::paymentServerTests() "PaymentServer::verifyExpired: Payment request expired \"1970-01-01T00:00:01Z\"."
QWARN  : PaymentServerTests::paymentServerTests() "PaymentServer::verifyExpired: Payment request expired \"\"."
QWARN  : PaymentServerTests::paymentServerTests() "PaymentServer::verifySize: Payment request too large (50001 bytes, allowed 50000 bytes)."
QWARN  : PaymentServerTests::paymentServerTests() "PaymentServer::verifyAmount: Payment request amount out of allowed range (2100000100000000, allowed 0 - 2100000000000000)."
PASS   : PaymentServerTests::paymentServerTests()
PASS   : PaymentServerTests::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 103ms
********* Finished testing of PaymentServerTests *********
********* Start testing of RPCNestedTests *********
Config: Using QtTest library 5.11.3, Qt 5.11.3 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.3.0)
PASS   : RPCNestedTests::initTestCase()
FAIL!  : RPCNestedTests::rpcNestedTests() Caught unhandled exception
   Loc: [qtestcase.cpp(1847)]
Totals: 1 passed, 1 failed, 0 skipped, 0 blacklisted, 85ms
********* Finished testing of RPCNestedTests *********
terminate called after throwing an instance of 'std::logic_error'
  what():  should not be overwriting a chainstate
Aborted (core dumped)
[471/480] Running secp256k1 test suite
PASSED: secp256k1 test suite
[478/480] 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
PiRK planned changes to this revision.EditedJul 15 2022, 08:44

Looks like I missed something related to the GUI tests.

Tail of the build log:

wallet_abandonconflict.py                              | ✓ Passed  | 5 s
wallet_address_types.py                                | ✓ Passed  | 13 s
wallet_address_types.py --descriptors                  | ✓ Passed  | 8 s
wallet_avoidreuse.py                                   | ✓ Passed  | 4 s
wallet_avoidreuse.py --descriptors                     | ✓ Passed  | 4 s
wallet_backup.py                                       | ✓ Passed  | 21 s
wallet_balance.py                                      | ✓ Passed  | 17 s
wallet_balance.py --descriptors                        | ✓ Passed  | 26 s
wallet_basic.py                                        | ✓ Passed  | 18 s
wallet_coinbase_category.py                            | ✓ Passed  | 1 s
wallet_create_tx.py                                    | ✓ Passed  | 5 s
wallet_createwallet.py                                 | ✓ Passed  | 2 s
wallet_createwallet.py --descriptors                   | ✓ Passed  | 2 s
wallet_createwallet.py --usecli                        | ✓ Passed  | 3 s
wallet_descriptor.py                                   | ✓ Passed  | 6 s
wallet_disable.py                                      | ✓ Passed  | 0 s
wallet_dump.py                                         | ✓ Passed  | 5 s
wallet_encryption.py                                   | ✓ Passed  | 5 s
wallet_encryption.py --descriptors                     | ✓ Passed  | 5 s
wallet_hd.py                                           | ✓ Passed  | 6 s
wallet_hd.py --descriptors                             | ✓ Passed  | 5 s
wallet_import_rescan.py                                | ✓ Passed  | 5 s
wallet_import_with_label.py                            | ✓ Passed  | 1 s
wallet_importdescriptors.py                            | ✓ Passed  | 6 s
wallet_importmulti.py                                  | ✓ Passed  | 3 s
wallet_importprunedfunds.py                            | ✓ Passed  | 2 s
wallet_importprunedfunds.py --descriptors              | ✓ Passed  | 2 s
wallet_keypool.py                                      | ✓ Passed  | 3 s
wallet_keypool_topup.py                                | ✓ Passed  | 3 s
wallet_keypool_topup.py --descriptors                  | ✓ Passed  | 3 s
wallet_labels.py                                       | ✓ Passed  | 1 s
wallet_labels.py --descriptors                         | ✓ Passed  | 1 s
wallet_listreceivedby.py                               | ✓ Passed  | 13 s
wallet_listsinceblock.py                               | ✓ Passed  | 4 s
wallet_listsinceblock.py --descriptors                 | ✓ Passed  | 7 s
wallet_listtransactions.py                             | ✓ Passed  | 4 s
wallet_listtransactions.py --descriptors               | ✓ Passed  | 3 s
wallet_multiwallet.py                                  | ✓ Passed  | 39 s
wallet_multiwallet.py --usecli                         | ✓ Passed  | 10 s
wallet_reorgsrestore.py                                | ✓ Passed  | 3 s
wallet_resendwallettransactions.py                     | ✓ Passed  | 5 s
wallet_send.py                                         | ✓ Passed  | 8 s
wallet_startup.py                                      | ✓ Passed  | 2 s
wallet_txn_clone.py                                    | ✓ Passed  | 2 s
wallet_txn_clone.py --mineblock                        | ✓ Passed  | 3 s
wallet_txn_doublespend.py                              | ✓ Passed  | 1 s
wallet_txn_doublespend.py --mineblock                  | ✓ Passed  | 3 s
wallet_watchonly.py                                    | ✓ Passed  | 1 s
wallet_watchonly.py --usecli                           | ✓ Passed  | 1 s

ALL                                                    | ✓ Passed  | 1277 s (accumulated) 
Runtime: 256 s

----------------------------------------------------------------------
Ran 10 tests in 0.092s

OK

ninja: build stopped: cannot make progress due to previous errors.
Build build-diff failed with exit code 1
PiRK edited the summary of this revision. (Show Details)

restore the g_chainman reset code in apptests.cpp, as it is still needed at this point. It should be removed in D11753, when the chain state manager actually becomes a member of the test setup (constructed and destructed in each test) rather than a global.

This revision is now accepted and ready to land.Jul 15 2022, 09:49