Just ran into this crash in the nightly CI, which was using llvm 22~++20251125085442+ed95c4d6ecf0-1~exp1~20251125085501.1311. It may be a compiler error, but it is odd that only one test was failing:
0 node0 stderr bitcoind: validation.cpp:5392: void ChainstateManager::CheckBlockIndex() const: Assertion `!c->setBlockIndexCandidates.contains(const_cast<CBlockIndex*>(pindex))' failed.
0...
1 node0 2025-11-26T05:23:50.207878Z [initload] [util/thread.cpp:22] [void util::TraceThread(std::string_view, std::function<void ()>)] initload thread exit
2 node0 2025-11-26T05:23:50.207921Z [net] [util/thread.cpp:20] [void util::TraceThread(std::string_view, std::function<void ()>)] net thread start
3 node0 2025-11-26T05:23:50.208026Z [addcon] [util/thread.cpp:20] [void util::TraceThread(std::string_view, std::function<void ()>)] addcon thread start
4 node0 2025-11-26T05:23:50.208076Z [init] [noui.cpp:57] [void noui_InitMessage(const std::string &)] init message: Done loading
5 node0 2025-11-26T05:23:50.208131Z [msghand] [util/thread.cpp:20] [void util::TraceThread(std::string_view, std::function<void ()>)] msghand thread start
6 node0 2025-11-26T05:23:50.300411Z [http] [httpserver.cpp:308] [void http_request_cb(struct evhttp_request *, void *)] [http] Received a POST request for / from 127.0.0.1:53008
7 node0 2025-11-26T05:23:50.301476Z [httpworker.0] [rpc/request.cpp:243] [void JSONRPCRequest::parse(const UniValue &)] [rpc] ThreadRPCServer method=getblockcount user=__cookie__
8 node0 2025-11-26T05:23:50.302068Z [http] [httpserver.cpp:308] [void http_request_cb(struct evhttp_request *, void *)] [http] Received a POST request for / from 127.0.0.1:53008
9 node0 2025-11-26T05:23:50.302154Z [httpworker.1] [rpc/request.cpp:243] [void JSONRPCRequest::parse(const UniValue &)] [rpc] ThreadRPCServer method=getmempoolinfo user=__cookie__
10 test 2025-11-26T05:23:50.302472Z TestFramework.node0 (DEBUG): RPC successfully started
11 test 2025-11-26T05:23:50.303502Z TestFramework.node0 (DEBUG): TestNode.generate() dispatches `generate` call to `generatetoaddress`
12 node0 2025-11-26T05:23:50.303964Z [http] [httpserver.cpp:308] [void http_request_cb(struct evhttp_request *, void *)] [http] Received a POST request for / from 127.0.0.1:53008
13 node0 2025-11-26T05:23:50.304029Z [httpworker.0] [rpc/request.cpp:243] [void JSONRPCRequest::parse(const UniValue &)] [rpc] ThreadRPCServer method=generatetoaddress user=__cookie__
14 node0 2025-11-26T05:23:50.304103Z [httpworker.0] [node/miner.cpp:173] [std::unique_ptr<CBlockTemplate> node::BlockAssembler::CreateNewBlock()] CreateNewBlock(): block weight: 904 txs: 0 fees: 0 sigops 400
15 node0 2025-11-26T05:23:50.304141Z [httpworker.0] [validation.cpp:2405] [bool Chainstate::ConnectBlock(const CBlock &, BlockValidationState &, CBlockIndex *, CCoinsViewCache &, bool)] [bench] - Sanity checks: 0.00ms [0.00s (0.00ms/blk)]
16 node0 2025-11-26T05:23:50.304159Z [httpworker.0] [validation.cpp:2507] [bool Chainstate::ConnectBlock(const CBlock &, BlockValidationState &, CBlockIndex *, CCoinsViewCache &, bool)] [bench] - Fork checks: 0.02ms [0.00s (0.02ms/blk)]
17 node0 2025-11-26T05:23:50.304171Z [httpworker.0] [validation.cpp:2513] [bool Chainstate::ConnectBlock(const CBlock &, BlockValidationState &, CBlockIndex *, CCoinsViewCache &, bool)] Enabling script verification at block [#228](/bitcoin-bitcoin/228/) (2a5aefafbdc44a7bc7f446f5e10b5cfb3d2bb92c4213f8c17356455f105d00fc): assumevalid=0 (always verify).
18 node0 2025-11-26T05:23:50.304179Z [httpworker.0] [validation.cpp:2622] [bool Chainstate::ConnectBlock(const CBlock &, BlockValidationState &, CBlockIndex *, CCoinsViewCache &, bool)] [bench] - Connect 1 transactions: 0.02ms (0.019ms/tx, 0.000ms/txin) [0.00s (0.02ms/blk)]
19 node0 2025-11-26T05:23:50.304189Z [httpworker.0] [validation.cpp:2645] [bool Chainstate::ConnectBlock(const CBlock &, BlockValidationState &, CBlockIndex *, CCoinsViewCache &, bool)] [bench] - Verify 0 txins: 0.03ms (0.000ms/txin) [0.00s (0.03ms/blk)]
20 node0 2025-11-26T05:23:50.304194Z [httpworker.0] [node/miner.cpp:191] [std::unique_ptr<CBlockTemplate> node::BlockAssembler::CreateNewBlock()] [bench] CreateNewBlock() chunks: 0.02ms, validity: 0.10ms (total 0.12ms)
21 test 2025-11-26T05:23:50.742247Z TestFramework (DEBUG): Destroying ZMQ context
22 test 2025-11-26T05:23:50.743550Z TestFramework (ERROR): Unexpected exception
23 Traceback (most recent call last):
24 File "/__w/bitcoin-core-nightly/bitcoin-core-nightly/test/functional/test_framework/test_framework.py", line 142, in main
25 self.run_test()
26 File "/__w/bitcoin-core-nightly/bitcoin-core-nightly/bld/test/functional/interface_zmq.py", line 131, in run_test
27 self.test_multiple_interfaces()
28 File "/__w/bitcoin-core-nightly/bitcoin-core-nightly/bld/test/functional/interface_zmq.py", line 563, in test_multiple_interfaces
29 subscribers = self.setup_zmq_test([
30 ^^^^^^^^^^^^^^^^^^^^^
31 File "/__w/bitcoin-core-nightly/bitcoin-core-nightly/bld/test/functional/interface_zmq.py", line 162, in setup_zmq_test
32 test_block = ZMQTestSetupBlock(self, self.nodes[0])
33 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34 File "/__w/bitcoin-core-nightly/bitcoin-core-nightly/bld/test/functional/interface_zmq.py", line 93, in __init__
35 self.block_hash = test_framework.generate(node, 1, sync_fun=test_framework.no_op)[0]
36 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37 File "/__w/bitcoin-core-nightly/bitcoin-core-nightly/test/functional/test_framework/test_framework.py", line 660, in generate
38 blocks = generator.generate(*args, called_by_framework=True, **kwargs)
39 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40 File "/__w/bitcoin-core-nightly/bitcoin-core-nightly/test/functional/test_framework/test_node.py", line 405, in generate
41 return self.generatetoaddress(nblocks=nblocks, address=self.get_deterministic_priv_key().address, maxtries=maxtries, **kwargs)
42 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43 File "/__w/bitcoin-core-nightly/bitcoin-core-nightly/test/functional/test_framework/test_node.py", line 413, in generatetoaddress
44 return self.__getattr__('generatetoaddress')(*args, **kwargs)
45 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46 File "/__w/bitcoin-core-nightly/bitcoin-core-nightly/test/functional/test_framework/coverage.py", line 50, in __call__
47 return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
48 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49 File "/__w/bitcoin-core-nightly/bitcoin-core-nightly/test/functional/test_framework/authproxy.py", line 137, in __call__
50 response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
51 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
52 File "/__w/bitcoin-core-nightly/bitcoin-core-nightly/test/functional/test_framework/authproxy.py", line 111, in _request
53 return self._get_response()
54 ^^^^^^^^^^^^^^^^^^^^
55 File "/__w/bitcoin-core-nightly/bitcoin-core-nightly/test/functional/test_framework/authproxy.py", line 174, in _get_response
56 http_response = self.__conn.getresponse()
57 ^^^^^^^^^^^^^^^^^^^^^^^^^
58 File "/usr/lib/python3.12/http/client.py", line 1428, in getresponse
59 response.begin()
60 File "/usr/lib/python3.12/http/client.py", line 331, in begin
61 version, status, reason = self._read_status()
62 ^^^^^^^^^^^^^^^^^^^
63 File "/usr/lib/python3.12/http/client.py", line 300, in _read_status
64 raise RemoteDisconnected("Remote end closed connection without"
65 http.client.RemoteDisconnected: Remote end closed connection without response