Page MenuHomePhabricator

fix a couple of node.avalanche nullptr dereferencing
ClosedPublic

Authored by PiRK on Jun 10 2024, 10:14.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC1a982a197370: fix a couple of node.avalanche nullptr dereferencing
Summary

When avalanche is not initialized we should not pass it as a net events interface to CConnman::m_msgproc as the codebase never checks for nullptr before dereferencing these interfaces.

The node.avalanche->startEventLoop(*node.scheduler) obviously needs to be gated as well, or the node will not even start with -avalanche=0

Add a functional test that starts the node with avalanche=0 to catch these bugs. The first bug is caught by self.restart_node(1, extra_args=["-avalanche=0"]), the second bug related to net interface is caught by the block synchronization test.

Test Plan

Check that this does not segfault src/bitcoind -regtest -avalanche=0

ninja all check-all
Check that without either one of the two fixes the new test crashes

Diff Detail

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

Event Timeline

PiRK requested review of this revision.Jun 10 2024, 10:14
PiRK planned changes to this revision.Jun 10 2024, 10:22

i should be able to add a test for this

Failed tests logs:

====== Bitcoin ABC functional tests: feature_init.py ======

------- Stdout: -------
2024-06-10T10:35:20.125000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50
2024-06-10T10:35:21.051000Z TestFramework (INFO): Starting node and will exit after line b'Validating signatures for all blocks'
2024-06-10T10:35:21.275000Z TestFramework (INFO): Starting node and will exit after line b'scheduler thread start'
2024-06-10T10:35:21.611000Z TestFramework (INFO): Starting node and will exit after line b'Starting HTTP server'
2024-06-10T10:35:21.982000Z TestFramework (INFO): Starting node and will exit after line b'Loading P2P addresses'
2024-06-10T10:35:22.330000Z TestFramework (INFO): Starting node and will exit after line b'Loading banlist'
2024-06-10T10:35:22.630000Z TestFramework (INFO): Starting node and will exit after line b'Loading block index'
2024-06-10T10:35:22.856000Z TestFramework (INFO): Starting node and will exit after line b'Checking all blk files are present'
2024-06-10T10:35:23.170000Z TestFramework (INFO): Starting node and will exit after line b'Loaded best chain:'
2024-06-10T10:35:23.534000Z TestFramework (INFO): Starting node and will exit after line b'init message: Verifying blocks'
2024-06-10T10:35:23.947000Z TestFramework (INFO): Starting node and will exit after line b'init message: Starting network threads'
2024-06-10T10:35:24.480000Z TestFramework (INFO): Starting node and will exit after line b'net thread start'
2024-06-10T10:35:25.118000Z TestFramework (INFO): Starting node and will exit after line b'addcon thread start'
2024-06-10T10:35:25.805000Z TestFramework (INFO): Starting node and will exit after line b'loadblk thread start'
2024-06-10T10:35:26.485000Z TestFramework (INFO): Starting node and will exit after line b'txindex thread start'
2024-06-10T10:35:27.532000Z TestFramework (INFO): Starting node and will exit after line b'block filter index thread start'
2024-06-10T10:35:28.016000Z TestFramework (INFO): Starting node and will exit after line b'coinstatsindex thread start'
2024-06-10T10:37:28.047000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 147, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 137, in _run_test_internal
    self.run_test()
  File "/work/test/functional/feature_init.py", line 77, in run_test
    node.start(
  File "/usr/lib/python3.9/contextlib.py", line 124, in __exit__
    next(self.gen)
  File "/work/test/functional/test_framework/test_node.py", line 653, in wait_for_debug_log
    self._raise_assertion_error(
  File "/work/test/functional/test_framework/test_node.py", line 261, in _raise_assertion_error
    raise AssertionError(self._node_msg(msg))
AssertionError: [node 0] Expected messages "[b'coinstatsindex thread start']" does not partially match log:

 - 
 - 
 - 
 - 
 - 
 - 
 - 
 - 
 - 
 - 
 - 
 - 2024-06-10T10:35:28Z Ignoring unknown configuration value regtest.chronikbind
 - 
 - 2024-06-10T10:35:28Z Ignoring unknown configuration value regtest.chroniktxnumcachebucketsize
 - 
 - 2024-06-10T10:35:28.132126Z [../../src/init/common.cpp:243] [LogPackageVersion] Bitcoin ABC version v0.29.6-fcac11c054ef (release build)
 - 
 - 2024-06-10T10:35:28.132152Z [../../src/init.cpp:1498] [InitParameterInteraction] InitParameterInteraction: parameter interaction: -bind set -> setting -listen=1
 - 
 - 2024-06-10T10:35:28.132334Z [../../src/init/common.cpp:32] [SetGlobals] Using the 'standard' SHA256 implementation
 - 
 - 2024-06-10T10:35:28.132359Z [../../src/random.cpp:106] [ReportHardwareRand] Using RdSeed as additional entropy source
 - 
 - 2024-06-10T10:35:28.132376Z [../../src/random.cpp:109] [ReportHardwareRand] Using RdRand as an additional entropy source
 - 
 - 2024-06-10T10:35:28.141987Z [../../src/init/common.cpp:211] [StartLogging] Default data directory /root/.bitcoin
 - 
 - 2024-06-10T10:35:28.142018Z [../../src/init/common.cpp:213] [StartLogging] Using data directory /work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0/regtest
 - 
 - 2024-06-10T10:35:28.142061Z [../../src/init/common.cpp:218] [StartLogging] Config file: /work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0/bitcoin.conf
 - 
 - 2024-06-10T10:35:28.142084Z [../../src/common/args.cpp:854] [logArgsPrefix] Config file arg: regtest="1"
 - 
 - 2024-06-10T10:35:28.142101Z [../../src/common/args.cpp:854] [logArgsPrefix] Config file arg: [regtest] bind="127.0.0.1"
 - 
 - 2024-06-10T10:35:28.142117Z [../../src/common/args.cpp:854] [logArgsPrefix] Config file arg: [regtest] connect="0"
 - 
 - 2024-06-10T10:35:28.142136Z [../../src/common/args.cpp:854] [logArgsPrefix] Config file arg: [regtest] discover="0"
 - 
 - 2024-06-10T10:35:28.142149Z [../../src/common/args.cpp:854] [logArgsPrefix] Config file arg: [regtest] dnsseed="0"
 - 
 - 2024-06-10T10:35:28.142163Z [../../src/common/args.cpp:854] [logArgsPrefix] Config file arg: [regtest] fallbackfee="200"
 - 
 - 2024-06-10T10:35:28.142177Z [../../src/common/args.cpp:854] [logArgsPrefix] Config file arg: [regtest] fixedseeds="0"
 - 
 - 2024-06-10T10:35:28.142192Z [../../src/common/args.cpp:854] [logArgsPrefix] Config file arg: [regtest] keypool="1"
 - 
 - 2024-06-10T10:35:28.142205Z [../../src/common/args.cpp:854] [logArgsPrefix] Config file arg: [regtest] listenonion="0"
 - 
 - 2024-06-10T10:35:28.142221Z [../../src/common/args.cpp:854] [logArgsPrefix] Config file arg: [regtest] natpmp="0"
 - 
 - 2024-06-10T10:35:28.142235Z [../../src/common/args.cpp:854] [logArgsPrefix] Config file arg: [regtest] peertimeout="999999999"
 - 
 - 2024-06-10T10:35:28.142249Z [../../src/common/args.cpp:854] [logArgsPrefix] Config file arg: [regtest] port="23201"
 - 
 - 2024-06-10T10:35:28.142272Z [../../src/common/args.cpp:854] [logArgsPrefix] Config file arg: [regtest] printtoconsole="0"
 - 
 - 2024-06-10T10:35:28.142287Z [../../src/common/args.cpp:854] [logArgsPrefix] Config file arg: [regtest] rpcdoccheck="0"
 - 
 - 2024-06-10T10:35:28.142301Z [../../src/common/args.cpp:854] [logArgsPrefix] Config file arg: [regtest] rpcport="27201"
 - 
 - 2024-06-10T10:35:28.142317Z [../../src/common/args.cpp:854] [logArgsPrefix] Config file arg: [regtest] server="1"
 - 
 - 2024-06-10T10:35:28.142329Z [../../src/common/args.cpp:854] [logArgsPrefix] Config file arg: [regtest] shrinkdebugfile="0"
 - 
 - 2024-06-10T10:35:28.142341Z [../../src/common/args.cpp:854] [logArgsPrefix] Config file arg: [regtest] upnp="0"
 - 
 - 2024-06-10T10:35:28.142354Z [../../src/common/args.cpp:854] [logArgsPrefix] Config file arg: [regtest] usecashaddr="1"
 - 
 - 2024-06-10T10:35:28.142374Z [../../src/common/args.cpp:867] [LogArgs] Setting file arg: wallet = [""]
 - 
 - 2024-06-10T10:35:28.142398Z [../../src/common/args.cpp:854] [logArgsPrefix] Command-line arg: blockfilterindex="1"
 - 
 - 2024-06-10T10:35:28.142411Z [../../src/common/args.cpp:854] [logArgsPrefix] Command-line arg: coinstatsindex="1"
 - 
 - 2024-06-10T10:35:28.142433Z [../../src/common/args.cpp:854] [logArgsPrefix] Command-line arg: datadir="/work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0"
 - 
 - 2024-06-10T10:35:28.142449Z [../../src/common/args.cpp:854] [logArgsPrefix] Command-line arg: debug=""
 - 
 - 2024-06-10T10:35:28.142462Z [../../src/common/args.cpp:854] [logArgsPrefix] Command-line arg: debugexclude="libevent"
 - 
 - 2024-06-10T10:35:28.142475Z [../../src/common/args.cpp:854] [logArgsPrefix] Command-line arg: debugexclude="leveldb"
 - 
 - 2024-06-10T10:35:28.142488Z [../../src/common/args.cpp:854] [logArgsPrefix] Command-line arg: logsourcelocations=""
 - 
 - 2024-06-10T10:35:28.142501Z [../../src/common/args.cpp:854] [logArgsPrefix] Command-line arg: logthreadnames=""
 - 
 - 2024-06-10T10:35:28.142515Z [../../src/common/args.cpp:854] [logArgsPrefix] Command-line arg: logtimemicros=""
 - 
 - 2024-06-10T10:35:28.142527Z [../../src/common/args.cpp:854] [logArgsPrefix] Command-line arg: txindex="1"
 - 
 - 2024-06-10T10:35:28.142540Z [../../src/common/args.cpp:854] [logArgsPrefix] Command-line arg: uacomment="testnode-0"
 - 
 - 2024-06-10T10:35:28.142559Z [../../src/init.cpp:2063] [AppInitMain] Using at most 4096 automatic connections (1048576 file descriptors available)
 - 
 - 2024-06-10T10:35:28.148819Z [../../src/script/sigcache.cpp:94] [InitSignatureCache] Using 32 MiB out of 32 MiB requested for signature cache, able to store 1048576 elements
 - 
 - 2024-06-10T10:35:28.169917Z [../../src/script/scriptcache.cpp:93] [InitScriptExecutionCache] Using 32 MiB out of 32 MiB requested for script execution cache, able to store 1048576 elements
 - 
 - 2024-06-10T10:35:28.169966Z [../../src/init.cpp:2111] [AppInitMain] Script verification uses 11 additional threads
 - 
 - 2024-06-10T10:35:28.170700Z [../../src/util/thread.cpp:17] [TraceThread] scheduler thread start
 - 
 - 2024-06-10T10:35:28.185352Z [../../src/httpserver.cpp:191] [InitHTTPAllowList] Allowing HTTP connections from: 127.0.0.0/8 ::1/128 
 - 
 - 2024-06-10T10:35:28.185435Z [../../src/httpserver.cpp:343] [HTTPBindAddresses] Binding RPC on address ::1 port 27201
 - 
 - 2024-06-10T10:35:28.185523Z [../../src/httpserver.cpp:343] [HTTPBindAddresses] Binding RPC on address 127.0.0.1 port 27201
 - 
 - 2024-06-10T10:35:28.185574Z [../../src/httpserver.cpp:431] [InitHTTPServer] Initialized HTTP server
 - 
 - 2024-06-10T10:35:28.185596Z [../../src/httpserver.cpp:434] [InitHTTPServer] HTTP: creating work queue of depth 16
 - 
 - 2024-06-10T10:35:28.185610Z [../../src/rpc/server.cpp:349] [StartRPC] Starting RPC
 - 
 - 2024-06-10T10:35:28.185645Z [../../src/httprpc.cpp:451] [StartHTTPRPC] Starting HTTP RPC server
 - 
 - 2024-06-10T10:35:28.185660Z [../../src/httprpc.cpp:405] [InitRPCAuthentication] Using random cookie authentication.
 - 
 - 2024-06-10T10:35:28.185780Z [../../src/rpc/request.cpp:110] [GenerateAuthCookie] Generated RPC authentication cookie /work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0/regtest/.cookie
 - 
 - 2024-06-10T10:35:28.185805Z [../../src/httpserver.cpp:675] [RegisterHTTPHandler] Registering HTTP handler for / (exactmatch 1)
 - 
 - 2024-06-10T10:35:28.185823Z [../../src/httpserver.cpp:675] [RegisterHTTPHandler] Registering HTTP handler for /wallet/ (exactmatch 0)
 - 
 - 2024-06-10T10:35:28.185842Z [../../src/httpserver.cpp:461] [StartHTTPServer] Starting HTTP server
 - 
 - 2024-06-10T10:35:28.185855Z [../../src/httpserver.cpp:464] [StartHTTPServer] HTTP: starting 4 worker threads
 - 
 - 2024-06-10T10:35:28.186201Z [../../src/wallet/load.cpp:51] [VerifyWallets] Using wallet directory /work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0/regtest
 - 
 - 2024-06-10T10:35:28.186404Z [../../src/httpserver.cpp:301] [ThreadHTTP] Entering http event loop
 - 
 - 2024-06-10T10:35:28.186503Z [../../src/noui.cpp:56] [noui_InitMessage] init message: Verifying wallet(s)...
 - 
 - 2024-06-10T10:35:28.186691Z [../../src/wallet/bdb.cpp:290] [Verify] Using BerkeleyDB version Berkeley DB 5.3.28: (September  9, 2013)
 - 
 - 2024-06-10T10:35:28.186717Z [../../src/wallet/bdb.cpp:291] [Verify] Using wallet /work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0/regtest/wallet.dat
 - 
 - 2024-06-10T10:35:28.186791Z [../../src/wallet/bdb.cpp:174] [Open] BerkeleyEnvironment::Open: LogDir=/work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0/regtest/database ErrorFile=/work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0/regtest/db.log
 - 
 - 2024-06-10T10:35:28.190462Z [../../src/init.cpp:2204] [AppInitMain] Using /16 prefix for IP bucketing
 - 
 - 2024-06-10T10:35:28.190484Z [../../src/noui.cpp:56] [noui_InitMessage] init message: Loading P2P addresses...
 - 
 - 2024-06-10T10:35:28.190772Z [../../src/./logging/timer.h:48] [Log] CheckAddrman: new 0, tried 0, total 0 started
 - 
 - 2024-06-10T10:35:28.190886Z [../../src/./logging/timer.h:48] [Log] CheckAddrman: completed (0.09ms)
 - 
 - 2024-06-10T10:35:28.190910Z [../../src/addrdb.cpp:178] [LoadAddrman] Loaded 0 addresses from peers.dat  0ms
 - 
 - 2024-06-10T10:35:28.191202Z [../../src/noui.cpp:56] [noui_InitMessage] init message: Loading banlist...
 - 
 - 2024-06-10T10:35:28.191244Z [../../src/banman.cpp:36] [BanMan] Loaded 0 banned node ips/subnets from banlist.dat  0ms
 - 
 - 2024-06-10T10:35:28.191275Z [../../src/net.cpp:2077] [SetTryNewOutboundPeer] net: setting try another outbound peer=false
 - 
 - 2024-06-10T10:35:28.191290Z [../../src/net.cpp:2843] [SetNetworkActive] SetNetworkActive: true
 - 
 - 2024-06-10T10:35:28.191351Z [../../src/init.cpp:2369] [AppInitMain] Checkpoints will be verified.
 - 
 - 2024-06-10T10:35:28.191378Z [../../src/init.cpp:2385] [AppInitMain] Cache configuration:
 - 
 - 2024-06-10T10:35:28.191393Z [../../src/init.cpp:2387] [AppInitMain] * Using 2.0 MiB for block index database
 - 
 - 2024-06-10T10:35:28.191410Z [../../src/init.cpp:2390] [AppInitMain] * Using 127.8 MiB for transaction index database
 - 
 - 2024-06-10T10:35:28.191430Z [../../src/init.cpp:2395] [AppInitMain] * Using 111.8 MiB for basic block filter index database
 - 
 - 2024-06-10T10:35:28.191443Z [../../src/init.cpp:2398] [AppInitMain] * Using 8.0 MiB for chain state database
 - 
 - 2024-06-10T10:35:28.191470Z [../../src/init.cpp:2426] [AppInitMain] * Using 774.5 MiB for in-memory UTXO set (plus up to 286.1 MiB of unused mempool space)
 - 
 - 2024-06-10T10:35:28.191513Z [../../src/noui.cpp:56] [noui_InitMessage] init message: Loading block index...
 - 
 - 2024-06-10T10:35:28.191531Z [../../src/node/chainstate.cpp:174] [LoadChainstate] Validating signatures for all blocks.
 - 
 - 2024-06-10T10:35:28.191545Z [../../src/node/chainstate.cpp:177] [LoadChainstate] Setting nMinimumChainWork=0000000000000000000000000000000000000000000000000000000000000000
 - 
 - 2024-06-10T10:35:28.191681Z [../../src/dbwrapper.cpp:141] [CDBWrapper] Opening LevelDB in /work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0/regtest/blocks/index
 - 
 - 2024-06-10T10:35:28.243850Z [../../src/dbwrapper.cpp:150] [CDBWrapper] Opened LevelDB successfully
 - 
 - 2024-06-10T10:35:28.243908Z [../../src/dbwrapper.cpp:179] [CDBWrapper] Using obfuscation key for /work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0/regtest/blocks/index: 0000000000000000
 - 
 - 2024-06-10T10:35:28.246113Z [../../src/node/blockstorage.cpp:327] [LoadBlockIndexDB] LoadBlockIndexDB: last block file = 0
 - 
 - 2024-06-10T10:35:28.246201Z [../../src/node/blockstorage.cpp:332] [LoadBlockIndexDB] LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=201, size=38093, heights=0...200, time=2011-02-02T23:16:42Z...2024-06-10T10:35:20Z)
 - 
 - 2024-06-10T10:35:28.246254Z [../../src/node/blockstorage.cpp:343] [LoadBlockIndexDB] Checking all blk files are present...
 - 
 - 2024-06-10T10:35:28.246716Z [../../src/node/chainstate.cpp:114] [CompleteChainstateInitialization] Initializing chainstate Chainstate [ibd] @ height -1 (null)
 - 
 - 2024-06-10T10:35:28.246804Z [../../src/dbwrapper.cpp:141] [CDBWrapper] Opening LevelDB in /work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0/regtest/chainstate
 - 
 - 2024-06-10T10:35:28.272125Z [../../src/dbwrapper.cpp:150] [CDBWrapper] Opened LevelDB successfully
 - 
 - 2024-06-10T10:35:28.272363Z [../../src/dbwrapper.cpp:179] [CDBWrapper] Using obfuscation key for /work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0/regtest/chainstate: a7557e7bd5935e45
 - 
 - 2024-06-10T10:35:28.272936Z [../../src/validation.cpp:4668] [LoadChainTip] Loaded best chain: hashBestChain=7ad21fd8b6783ea7ed6356901fae6ba3b60537bde7ea965842420f4d7fe9afb4 height=200 date=2024-06-10T10:35:20Z progress=1.000000
 - 
 - 2024-06-10T10:35:28.273028Z [../../src/validation.cpp:6402] [MaybeRebalanceCaches] [snapshot] allocating all cache to the IBD chainstate
 - 
 - 2024-06-10T10:35:28.273306Z [../../src/dbwrapper.cpp:141] [CDBWrapper] Opening LevelDB in /work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0/regtest/chainstate
 - 
 - 2024-06-10T10:35:28.291685Z [../../src/dbwrapper.cpp:150] [CDBWrapper] Opened LevelDB successfully
 - 
 - 2024-06-10T10:35:28.291968Z [../../src/dbwrapper.cpp:179] [CDBWrapper] Using obfuscation key for /work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0/regtest/chainstate: a7557e7bd5935e45
 - 
 - 2024-06-10T10:35:28.292117Z [../../src/validation.cpp:5753] [ResizeCoinsCaches] [Chainstate [ibd] @ height 200 (7ad21fd8b6783ea7ed6356901fae6ba3b60537bde7ea965842420f4d7fe9afb4)] resized coinsdb cache to 8.0 MiB
 - 
 - 2024-06-10T10:35:28.292249Z [../../src/validation.cpp:5755] [ResizeCoinsCaches] [Chainstate [ibd] @ height 200 (7ad21fd8b6783ea7ed6356901fae6ba3b60537bde7ea965842420f4d7fe9afb4)] resized coinstip cache to 774.5 MiB
 - 
 - 2024-06-10T10:35:28.292424Z [../../src/noui.cpp:56] [noui_InitMessage] init message: Verifying blocks...
 - 
 - 2024-06-10T10:35:28.292492Z [../../src/validation.cpp:4702] [VerifyDB] Verifying last 6 blocks at level 3
 - 
 - 2024-06-10T10:35:28.292645Z [../../src/validation.cpp:4712] [VerifyDB] Verification progress: 0%
 - 
 - 2024-06-10T10:35:28.293485Z [../../src/validation.cpp:4725] [VerifyDB] Verification progress: 16%
 - 
 - 2024-06-10T10:35:28.293979Z [../../src/validation.cpp:4725] [VerifyDB] Verification progress: 33%
 - 
 - 2024-06-10T10:35:28.294483Z [../../src/validation.cpp:4725] [VerifyDB] Verification progress: 50%
 - 
 - 2024-06-10T10:35:28.294948Z [../../src/validation.cpp:4725] [VerifyDB] Verification progress: 66%
 - 
 - 2024-06-10T10:35:28.295394Z [../../src/validation.cpp:4725] [VerifyDB] Verification progress: 83%
 - 
 - 2024-06-10T10:35:28.296008Z [../../src/validation.cpp:4725] [VerifyDB] Verification progress: 99%
 - 
 - 2024-06-10T10:35:28.296098Z [../../src/validation.cpp:4865] [VerifyDB] Verification: No coin database inconsistencies in last 6 blocks (6 transactions)
 - 
 - 2024-06-10T10:35:28.296162Z [../../src/init.cpp:2479] [AppInitMain]  block index             105ms
 - 
 - 2024-06-10T10:35:28.298539Z [../../src/avalanche/processor.cpp:200] [Processor] Loaded 0 peers from the /work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0/regtest/avapeers.dat file
 - 
 - 2024-06-10T10:35:28.301304Z [../../src/dbwrapper.cpp:141] [CDBWrapper] Opening LevelDB in /work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0/regtest/indexes/txindex
 - 
 - 2024-06-10T10:35:28.328208Z [../../src/dbwrapper.cpp:150] [CDBWrapper] Opened LevelDB successfully
 - 
 - 2024-06-10T10:35:28.328334Z [../../src/dbwrapper.cpp:179] [CDBWrapper] Using obfuscation key for /work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0/regtest/indexes/txindex: 0000000000000000
 - 
 - 2024-06-10T10:35:28.328765Z [../../src/dbwrapper.cpp:141] [CDBWrapper] Opening LevelDB in /work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0/regtest/indexes/blockfilter/basic/db
 - 
 - 2024-06-10T10:35:28.328994Z [../../src/util/thread.cpp:17] [TraceThread] txindex thread start
 - 
 - 2024-06-10T10:35:28.329145Z [../../src/index/base.cpp:211] [ThreadSync] txindex is enabled at height 200
 - 
 - 2024-06-10T10:35:28.329249Z [../../src/util/thread.cpp:19] [TraceThread] txindex thread exit
 - 
 - 2024-06-10T10:35:28.357849Z [../../src/dbwrapper.cpp:150] [CDBWrapper] Opened LevelDB successfully
 - 
 - 2024-06-10T10:35:28.357901Z [../../src/dbwrapper.cpp:179] [CDBWrapper] Using obfuscation key for /work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0/regtest/indexes/blockfilter/basic/db: 0000000000000000
 - 
 - 2024-06-10T10:35:28.358114Z [../../src/dbwrapper.cpp:141] [CDBWrapper] Opening LevelDB in /work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0/regtest/indexes/coinstats/db
 - 
 - 2024-06-10T10:35:28.358189Z [../../src/util/thread.cpp:17] [TraceThread] basic block filter index thread start
 - 
 - 2024-06-10T10:35:28.358227Z [../../src/index/base.cpp:211] [ThreadSync] basic block filter index is enabled at height 200
 - 
 - 2024-06-10T10:35:28.358252Z [../../src/util/thread.cpp:19] [TraceThread] basic block filter index thread exit
 - 
 - 2024-06-10T10:35:28.378000Z [../../src/dbwrapper.cpp:150] [CDBWrapper] Opened LevelDB successfully
 - 
 - 2024-06-10T10:35:28.378033Z [../../src/dbwrapper.cpp:179] [CDBWrapper] Using obfuscation key for /work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0/regtest/indexes/coinstats/db: 0000000000000000
 - 
 - 2024-06-10T10:35:28.385522Z [../../src/./logging.h:226] [error] ERROR: Init: Cannot read current coinstatsindex state; index may be corrupted
 - 
 - 2024-06-10T10:35:28.385547Z [../../src/httpserver.cpp:473] [InterruptHTTPServer] Interrupting HTTP server
 - 
 - 2024-06-10T10:35:28.385578Z [../../src/httprpc.cpp:472] [InterruptHTTPRPC] Interrupting HTTP RPC server
 - 
 - 2024-06-10T10:35:28.385592Z [../../src/rpc/server.cpp:359] [operator()] Interrupting RPC
 - 
 - 2024-06-10T10:35:28.385634Z [../../src/init.cpp:227] [Shutdown] Shutdown: In progress...
 - 
 - 2024-06-10T10:35:28.385651Z [../../src/httprpc.cpp:476] [StopHTTPRPC] Stopping HTTP RPC server
 - 
 - 2024-06-10T10:35:28.385676Z [../../src/httpserver.cpp:690] [UnregisterHTTPHandler] Unregistering HTTP handler for / (exactmatch 1)
 - 
 - 2024-06-10T10:35:28.385704Z [../../src/httpserver.cpp:690] [UnregisterHTTPHandler] Unregistering HTTP handler for /wallet/ (exactmatch 0)
 - 
 - 2024-06-10T10:35:28.385719Z [../../src/rpc/server.cpp:371] [operator()] Stopping RPC
 - 
 - 2024-06-10T10:35:28.385788Z [../../src/init.cpp:415] [OnRPCStopped] RPC stopped.
 - 
 - 2024-06-10T10:35:28.385803Z [../../src/httpserver.cpp:484] [StopHTTPServer] Stopping HTTP server
 - 
 - 2024-06-10T10:35:28.385819Z [../../src/httpserver.cpp:486] [StopHTTPServer] Waiting for HTTP worker threads to exit
 - 
 - 2024-06-10T10:35:28.385851Z [../../src/httpserver.cpp:501] [StopHTTPServer] Waiting for HTTP event thread to exit
 - 
 - 2024-06-10T10:35:28.385882Z [../../src/httpserver.cpp:304] [ThreadHTTP] Exited http event loop
 - 
 - 2024-06-10T10:35:28.385988Z [../../src/httpserver.cpp:514] [StopHTTPServer] Stopped HTTP server
 - 
 - 2024-06-10T10:35:28.386053Z [../../src/util/thread.cpp:19] [TraceThread] scheduler thread exit
 - 
 - 2024-06-10T10:35:28.393436Z [../../src/avalanche/peermanager.cpp:1300] [dumpPeersToFile] Successfully dumped 0 peers to /work/abc-ci-builds/build-asan/test/tmp/test_runner_₿₵_  _20240610_103143/feature_init_50/node0/regtest/avapeers.dat.
 - 
 - 2024-06-10T10:35:28.393576Z [../../src/./logging/timer.h:48] [Log] FlushStateToDisk: write block and undo data to disk started
 - 
 - 2024-06-10T10:35:28.408727Z [../../src/./logging/timer.h:48] [Log] FlushStateToDisk: write block and undo data to disk completed (15.12ms)
 - 
 - 2024-06-10T10:35:28.408754Z [../../src/./logging/timer.h:48] [Log] FlushStateToDisk: write block index to disk started
 - 
 - 2024-06-10T10:35:28.414320Z [../../src/./logging/timer.h:48] [Log] FlushStateToDisk: write block index to disk completed (5.55ms)
 - 
 - 2024-06-10T10:35:28.414353Z [../../src/./logging/timer.h:48] [Log] FlushStateToDisk: write coins cache to disk (0 coins, 262kB) started
 - 
 - 2024-06-10T10:35:28.414395Z [../../src/txdb.cpp:175] [BatchWrite] Writing final batch of 0.00 MiB
 - 
 - 2024-06-10T10:35:28.414430Z [../../src/txdb.cpp:180] [BatchWrite] Committed 0 changed transaction outputs (out of 0) to coin database...
 - 
 - 2024-06-10T10:35:28.414487Z [../../src/./logging/timer.h:48] [Log] FlushStateToDisk: write coins cache to disk (0 coins, 262kB) completed (0.12ms)
 - 
 - 2024-06-10T10:35:28.414510Z [../../src/validationinterface.cpp:272] [ChainStateFlushed] Enqueuing ChainStateFlushed: block hash=7ad21fd8b6783ea7ed6356901fae6ba3b60537bde7ea965842420f4d7fe9afb4
 - 
 - 2024-06-10T10:35:28.414532Z [../../src/validationinterface.cpp:272] [operator()] ChainStateFlushed: block hash=7ad21fd8b6783ea7ed6356901fae6ba3b60537bde7ea965842420f4d7fe9afb4
 - 
 - 2024-06-10T10:35:28.417551Z [../../src/./logging/timer.h:48] [Log] FlushStateToDisk: write block and undo data to disk started
 - 
 - 2024-06-10T10:35:28.431851Z [../../src/./logging/timer.h:48] [Log] FlushStateToDisk: write block and undo data to disk completed (14.27ms)
 - 
 - 2024-06-10T10:35:28.431882Z [../../src/./logging/timer.h:48] [Log] FlushStateToDisk: write block index to disk started
 - 
 - 2024-06-10T10:35:28.438504Z [../../src/./logging/timer.h:48] [Log] FlushStateToDisk: write block index to disk completed (6.60ms)
 - 
 - 2024-06-10T10:35:28.438535Z [../../src/./logging/timer.h:48] [Log] FlushStateToDisk: write coins cache to disk (0 coins, 262kB) started
 - 
 - 2024-06-10T10:35:28.438566Z [../../src/txdb.cpp:175] [BatchWrite] Writing final batch of 0.00 MiB
 - 
 - 2024-06-10T10:35:28.438588Z [../../src/txdb.cpp:180] [BatchWrite] Committed 0 changed transaction outputs (out of 0) to coin database...
 - 
 - 2024-06-10T10:35:28.438638Z [../../src/./logging/timer.h:48] [Log] FlushStateToDisk: write coins cache to disk (0 coins, 262kB) completed (0.08ms)
 - 
 - 2024-06-10T10:35:28.438667Z [../../src/validationinterface.cpp:272] [ChainStateFlushed] Enqueuing ChainStateFlushed: block hash=7ad21fd8b6783ea7ed6356901fae6ba3b60537bde7ea965842420f4d7fe9afb4
 - 
 - 2024-06-10T10:35:28.438975Z [../../src/init.cpp:371] [Shutdown] Shutdown: done


2024-06-10T10:37:28.099000Z TestFramework (INFO): Stopping nodes
[node 0] Cleaning up leftover process
------- Stderr: -------
Traceback (most recent call last):
  File "/work/test/functional/feature_init.py", line 137, in <module>
    InitStressTest().main()
  File "/work/test/functional/test_framework/test_framework.py", line 170, in main
    exit_code = self.shutdown()
  File "/work/test/functional/test_framework/test_framework.py", line 396, in shutdown
    self.stop_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 645, in stop_nodes
    node.stop_node(wait=wait, wait_until_stopped=False)
  File "/work/test/functional/test_framework/test_node.py", line 501, in stop_node
    self.stop(wait=wait)
  File "/work/test/functional/test_framework/test_node.py", line 278, in __getattr__
    assert self.rpc is not None, self._node_msg("Error: RPC not initialized")
AssertionError: [node 0] Error: RPC not initialized

Each failure log is accessible here:
Bitcoin ABC functional tests: feature_init.py

PiRK retitled this revision from make sure not to pass a nullptr to CConnman::m_msgproc to fix a couple of node.avalanche nullptr dereferencing.
PiRK edited the summary of this revision. (Show Details)
PiRK edited the test plan for this revision. (Show Details)

fix another related bug, update summary, add test that catches both bugs

This revision is now accepted and ready to land.Jun 10 2024, 14:33