Page MenuHomePhabricator

rpc: Avoid getchaintxstats invalid results
Needs RevisionPublic

Authored by PiRK on Tue, May 6, 10:28.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Summary

The getchaintxstats RPC reply during AU background download may return non-zero, but invalid, values for window_tx_count and txrate.

For example, txcount may be zero for a to-be-downloaded block, but may be non-zero for an ancestor block which is already downloaded. Thus, the values returned may be negative (and cause intermediate integer sanitizer violations).

Also, txcount may be accurate for the snapshot base block, or a descendant of it. However it may be zero for an ancestor block that still needs to be downloaded. Thus, the values returned may be positive, but wrong.

Fix all issues by skipping the returned value if either txcount is unset (equal to zero).
Also, skip txcount in the returned value, if it is unset (equal to zero).

This is a backport of core#29720

Test Plan

ninja all check-all

Event Timeline

PiRK requested review of this revision.Tue, May 6, 10:28

Tail of the build log:

[515/658] Building C object src/secp256k1/CMakeFiles/internal-bench.dir/src/bench_internal.c.o
[516/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockindex.cpp.o
[517/658] Linking C static library src/secp256k1/libsecp256k1.a
[518/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/coins.cpp.o
[519/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[520/658] Linking C executable src/secp256k1/recover-bench
[521/658] Linking CXX static library src/libbitcoinconsensus.a
[522/658] Linking C executable src/secp256k1/verify-bench
[523/658] Linking C executable src/secp256k1/sign-bench
[524/658] Linking CXX static library src/libscript.a
[525/658] Linking C executable src/secp256k1/internal-bench
[526/658] Linking C executable src/secp256k1/ecmult-bench
[527/658] Linking CXX static library src/libcommon.a
[528/658] Building CXX object src/CMakeFiles/bitcoin-chainstate.dir/bitcoin-chainstate.cpp.o
[529/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[530/658] Linking CXX shared library src/libbitcoinconsensus.so.0.31.2
[531/658] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[532/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[533/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/random.cpp.o
[534/658] Linking CXX executable src/bitcoin-cli
[535/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[536/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[537/658] Linking CXX executable src/bitcoin-tx
[538/658] Linking CXX static library src/libbitcoinkernel.a
[539/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[540/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[541/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/txmempool.cpp.o
[542/658] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[543/658] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[544/658] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[545/658] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[546/658] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana.cpp.o
[547/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[548/658] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana_formatter.cpp.o
[549/658] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana_interpreter.cpp.o
[550/658] Linking CXX executable src/iguana/iguana
[551/658] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[552/658] Linking CXX executable src/bitcoin-chainstate
[553/658] Building CXX object src/CMakeFiles/server.dir/rest.cpp.o
[554/658] Building CXX object src/CMakeFiles/server.dir/node/interfaces.cpp.o
[555/658] Building CXX object src/CMakeFiles/server.dir/rpc/misc.cpp.o
[556/658] Building CXX object src/CMakeFiles/server.dir/rpc/net.cpp.o
[557/658] Building CXX object src/CMakeFiles/server.dir/rpc/mining.cpp.o
[558/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[559/658] Building CXX object src/CMakeFiles/server.dir/rpc/rawtransaction.cpp.o
[560/658] Building CXX object src/CMakeFiles/server.dir/rpc/avalanche.cpp.o
[561/658] Building CXX object src/CMakeFiles/server.dir/init.cpp.o
[562/658] Building CXX object src/CMakeFiles/server.dir/rpc/blockchain.cpp.o
FAILED: src/CMakeFiles/server.dir/rpc/blockchain.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_NO_CXX98_FUNCTION_BASE -DBUILD_BITCOIN_INTERNAL -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_LINUX -I/work/src/leveldb/helpers/memenv -I/work/src/. -I/work/abc-ci-builds/build-without-wallet/src -I/work/src/univalue/include -I/work/abc-ci-builds/build-without-wallet/src/crypto/.. -I/work/src/secp256k1/include -I/work/src/leveldb/include -isystem /usr/include/jemalloc -isystem /usr/include/miniupnpc -Werror -g -O2 -fPIC -fvisibility=hidden -fstack-reuse=none -fstack-protector-all -Wstack-protector -fcf-protection=full -fstack-clash-protection -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wredundant-decls -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wformat-security -Wredundant-move -Woverloaded-virtual -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-psabi -std=gnu++17 -MD -MT src/CMakeFiles/server.dir/rpc/blockchain.cpp.o -MF src/CMakeFiles/server.dir/rpc/blockchain.cpp.o.d -o src/CMakeFiles/server.dir/rpc/blockchain.cpp.o -c /work/src/rpc/blockchain.cpp
/work/src/rpc/blockchain.cpp: In function ‘getchaintxstats()::<lambda(const RPCHelpMan&, const Config&, const JSONRPCRequest&)>’:
/work/src/rpc/blockchain.cpp:1968:36: error: ‘*(std::_Optional_payload_base<unsigned int>::_Storage<unsigned int, true>*)((char*)&window_tx_count + offsetof(const std::optional<unsigned int>,std::optional<unsigned int>::<unnamed>.std::_Optional_base<unsigned int, true, true>::<unnamed>)).std::_Optional_payload_base<unsigned int>::_Storage<unsigned int, true>::_M_value’ may be used uninitialized [-Werror=maybe-uninitialized]
 1968 |                                    double(*window_tx_count) / nTimeDiff);
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~
/work/src/rpc/blockchain.cpp:1947:24: note: ‘*(std::_Optional_payload_base<unsigned int>::_Storage<unsigned int, true>*)((char*)&window_tx_count + offsetof(const std::optional<unsigned int>,std::optional<unsigned int>::<unnamed>.std::_Optional_base<unsigned int, true, true>::<unnamed>)).std::_Optional_payload_base<unsigned int>::_Storage<unsigned int, true>::_M_value’ was declared here
 1947 |             const auto window_tx_count{
      |                        ^~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
ninja: build stopped: cannot make progress due to previous errors.
Build build-without-wallet failed with exit code 1

Tail of the build log:

[414/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[415/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[416/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[417/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[418/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[419/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[420/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[421/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[422/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[423/583] Linking C executable src/secp256k1/recover-bench
[424/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[425/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[426/583] Linking C executable src/secp256k1/verify-bench
[427/583] Installing component secp256k1
-- Install configuration: "RelWithDebInfo"
-- Install component: "secp256k1"
-- Installing: /results/artifacts/lib/libsecp256k1.a
-- Installing: /results/artifacts/include/secp256k1.h
-- Installing: /results/artifacts/include/secp256k1_preallocated.h
-- Installing: /results/artifacts/include/secp256k1_recovery.h
-- Installing: /results/artifacts/include/secp256k1_schnorr.h
[428/583] Linking C executable src/secp256k1/internal-bench
[429/583] Linking C executable src/secp256k1/sign-bench
[430/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[431/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[432/583] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[433/583] Linking C executable src/secp256k1/ecmult-bench
[434/583] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana_interpreter.cpp.o
[435/583] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[436/583] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[437/583] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[438/583] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[439/583] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana.cpp.o
[440/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[441/583] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[442/583] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana_formatter.cpp.o
[443/583] Linking CXX static library src/libbitcoinconsensus.a
[444/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[445/583] Linking CXX static library src/libscript.a
[446/583] Linking CXX static library src/libcommon.a
[447/583] Linking CXX shared library src/libbitcoinconsensus.so.0.31.2
[448/583] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[449/583] Linking CXX executable src/iguana/iguana
[450/583] Linking CXX executable src/bitcoin-cli
[451/583] Linking CXX executable src/bitcoin-tx
[452/583] Linking CXX static library src/wallet/libwallet.a
[453/583] Building CXX object src/CMakeFiles/server.dir/txmempool.cpp.o
[454/583] Building CXX object src/CMakeFiles/server.dir/rpc/blockchain.cpp.o
FAILED: src/CMakeFiles/server.dir/rpc/blockchain.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_NO_CXX98_FUNCTION_BASE -DBUILD_BITCOIN_INTERNAL -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_LINUX -I/work/src/leveldb/helpers/memenv -I/work/src/. -I/work/abc-ci-builds/build-diff/src -I/work/src/univalue/include -I/work/abc-ci-builds/build-diff/src/crypto/.. -I/work/src/secp256k1/include -I/work/src/leveldb/include -isystem /usr/include/jemalloc -isystem /usr/include/miniupnpc -Werror -g -O2 -fPIC -fvisibility=hidden -fstack-reuse=none -fstack-protector-all -Wstack-protector -fcf-protection=full -fstack-clash-protection -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wredundant-decls -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wformat-security -Wredundant-move -Woverloaded-virtual -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-psabi -std=gnu++17 -MD -MT src/CMakeFiles/server.dir/rpc/blockchain.cpp.o -MF src/CMakeFiles/server.dir/rpc/blockchain.cpp.o.d -o src/CMakeFiles/server.dir/rpc/blockchain.cpp.o -c /work/src/rpc/blockchain.cpp
/work/src/rpc/blockchain.cpp: In function ‘getchaintxstats()::<lambda(const RPCHelpMan&, const Config&, const JSONRPCRequest&)>’:
/work/src/rpc/blockchain.cpp:1968:36: error: ‘*(std::_Optional_payload_base<unsigned int>::_Storage<unsigned int, true>*)((char*)&window_tx_count + offsetof(const std::optional<unsigned int>,std::optional<unsigned int>::<unnamed>.std::_Optional_base<unsigned int, true, true>::<unnamed>)).std::_Optional_payload_base<unsigned int>::_Storage<unsigned int, true>::_M_value’ may be used uninitialized [-Werror=maybe-uninitialized]
 1968 |                                    double(*window_tx_count) / nTimeDiff);
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~
/work/src/rpc/blockchain.cpp:1947:24: note: ‘*(std::_Optional_payload_base<unsigned int>::_Storage<unsigned int, true>*)((char*)&window_tx_count + offsetof(const std::optional<unsigned int>,std::optional<unsigned int>::<unnamed>.std::_Optional_base<unsigned int, true, true>::<unnamed>)).std::_Optional_payload_base<unsigned int>::_Storage<unsigned int, true>::_M_value’ was declared here
 1947 |             const auto window_tx_count{
      |                        ^~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
ninja: build stopped: cannot make progress due to previous errors.
Build build-diff failed with exit code 1
PiRK planned changes to this revision.Tue, May 6, 11:00

workaround for false-positive -Werror=maybe-uninitialized: try opt.value() instead of *opt

Tail of the build log:

[515/658] Building C object src/secp256k1/CMakeFiles/verify-bench.dir/src/bench_verify.c.o
[516/658] Building CXX object src/CMakeFiles/bitcoinkernel.dir/util/sock.cpp.o
[517/658] Building C object src/secp256k1/CMakeFiles/sign-bench.dir/src/bench_sign.c.o
[518/658] Building CXX object src/CMakeFiles/bitcoinkernel.dir/policy/block/preconsensus.cpp.o
[519/658] Building CXX object src/CMakeFiles/bitcoinkernel.dir/util/error.cpp.o
[520/658] Building CXX object src/CMakeFiles/bitcoinkernel.dir/policy/block/stakingrewards.cpp.o
[521/658] Building C object src/secp256k1/CMakeFiles/ecmult-bench.dir/src/bench_ecmult.c.o
[522/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockindex.cpp.o
[523/658] Building CXX object src/CMakeFiles/bitcoind.dir/bitcoind.cpp.o
[524/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[525/658] Building C object src/secp256k1/CMakeFiles/internal-bench.dir/src/bench_internal.c.o
[526/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/coins.cpp.o
[527/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[528/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/random.cpp.o
[529/658] Building CXX object src/CMakeFiles/bitcoin-chainstate.dir/bitcoin-chainstate.cpp.o
[530/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[531/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[532/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[533/658] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[534/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[535/658] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[536/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/txmempool.cpp.o
[537/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[538/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[539/658] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[540/658] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[541/658] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana_formatter.cpp.o
[542/658] Linking C static library src/secp256k1/libsecp256k1.a
[543/658] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana_interpreter.cpp.o
[544/658] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[545/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[546/658] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana.cpp.o
[547/658] Linking C executable src/secp256k1/recover-bench
[548/658] Linking C executable src/secp256k1/verify-bench
[549/658] Linking C executable src/secp256k1/sign-bench
[550/658] Linking C executable src/secp256k1/ecmult-bench
[551/658] Linking C executable src/secp256k1/internal-bench
[552/658] Linking CXX static library src/libbitcoinconsensus.a
[553/658] Linking CXX static library src/libscript.a
[554/658] Linking CXX static library src/libcommon.a
[555/658] Linking CXX shared library src/libbitcoinconsensus.so.0.31.2
[556/658] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[557/658] Linking CXX executable src/bitcoin-cli
[558/658] Linking CXX executable src/iguana/iguana
[559/658] Linking CXX executable src/bitcoin-tx
[560/658] Linking CXX static library src/libbitcoinkernel.a
[561/658] Linking CXX executable src/bitcoin-chainstate
[562/658] Building CXX object src/CMakeFiles/server.dir/rpc/blockchain.cpp.o
FAILED: src/CMakeFiles/server.dir/rpc/blockchain.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_NO_CXX98_FUNCTION_BASE -DBUILD_BITCOIN_INTERNAL -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_LINUX -I/work/src/leveldb/helpers/memenv -I/work/src/. -I/work/abc-ci-builds/build-without-wallet/src -I/work/src/univalue/include -I/work/abc-ci-builds/build-without-wallet/src/crypto/.. -I/work/src/secp256k1/include -I/work/src/leveldb/include -isystem /usr/include/jemalloc -isystem /usr/include/miniupnpc -Werror -g -O2 -fPIC -fvisibility=hidden -fstack-reuse=none -fstack-protector-all -Wstack-protector -fcf-protection=full -fstack-clash-protection -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wredundant-decls -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wformat-security -Wredundant-move -Woverloaded-virtual -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-psabi -std=gnu++17 -MD -MT src/CMakeFiles/server.dir/rpc/blockchain.cpp.o -MF src/CMakeFiles/server.dir/rpc/blockchain.cpp.o.d -o src/CMakeFiles/server.dir/rpc/blockchain.cpp.o -c /work/src/rpc/blockchain.cpp
/work/src/rpc/blockchain.cpp: In function ‘getchaintxstats()::<lambda(const RPCHelpMan&, const Config&, const JSONRPCRequest&)>’:
/work/src/rpc/blockchain.cpp:1968:36: error: ‘*(std::_Optional_payload_base<unsigned int>::_Storage<unsigned int, true>*)((char*)&window_tx_count + offsetof(const std::optional<unsigned int>,std::optional<unsigned int>::<unnamed>.std::_Optional_base<unsigned int, true, true>::<unnamed>)).std::_Optional_payload_base<unsigned int>::_Storage<unsigned int, true>::_M_value’ may be used uninitialized [-Werror=maybe-uninitialized]
 1968 |                                    double(window_tx_count.value()) / nTimeDiff);
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/work/src/rpc/blockchain.cpp:1947:24: note: ‘*(std::_Optional_payload_base<unsigned int>::_Storage<unsigned int, true>*)((char*)&window_tx_count + offsetof(const std::optional<unsigned int>,std::optional<unsigned int>::<unnamed>.std::_Optional_base<unsigned int, true, true>::<unnamed>)).std::_Optional_payload_base<unsigned int>::_Storage<unsigned int, true>::_M_value’ was declared here
 1947 |             const auto window_tx_count{
      |                        ^~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
ninja: build stopped: cannot make progress due to previous errors.
Build build-without-wallet failed with exit code 1

Tail of the build log:

[414/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[415/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[416/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[417/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[418/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[419/583] Linking C executable src/secp256k1/sign-bench
[420/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[421/583] Linking C executable src/secp256k1/recover-bench
[422/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[423/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[424/583] Linking C executable src/secp256k1/internal-bench
[425/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[426/583] Linking C executable src/secp256k1/ecmult-bench
[427/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[428/583] Linking C executable src/secp256k1/verify-bench
[429/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[430/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[431/583] Installing component secp256k1
-- Install configuration: "RelWithDebInfo"
-- Install component: "secp256k1"
-- Installing: /results/artifacts/lib/libsecp256k1.a
-- Installing: /results/artifacts/include/secp256k1.h
-- Installing: /results/artifacts/include/secp256k1_preallocated.h
-- Installing: /results/artifacts/include/secp256k1_recovery.h
-- Installing: /results/artifacts/include/secp256k1_schnorr.h
[432/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[433/583] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[434/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[435/583] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[436/583] Linking CXX static library src/libbitcoinconsensus.a
[437/583] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana_formatter.cpp.o
[438/583] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[439/583] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[440/583] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[441/583] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[442/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[443/583] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana.cpp.o
[444/583] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana_interpreter.cpp.o
[445/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[446/583] Linking CXX static library src/libscript.a
[447/583] Linking CXX static library src/libcommon.a
[448/583] Linking CXX shared library src/libbitcoinconsensus.so.0.31.2
[449/583] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[450/583] Linking CXX executable src/bitcoin-cli
[451/583] Linking CXX executable src/iguana/iguana
[452/583] Linking CXX executable src/bitcoin-tx
[453/583] Linking CXX static library src/wallet/libwallet.a
[454/583] Building CXX object src/CMakeFiles/server.dir/rpc/blockchain.cpp.o
FAILED: src/CMakeFiles/server.dir/rpc/blockchain.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_NO_CXX98_FUNCTION_BASE -DBUILD_BITCOIN_INTERNAL -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_LINUX -I/work/src/leveldb/helpers/memenv -I/work/src/. -I/work/abc-ci-builds/build-diff/src -I/work/src/univalue/include -I/work/abc-ci-builds/build-diff/src/crypto/.. -I/work/src/secp256k1/include -I/work/src/leveldb/include -isystem /usr/include/jemalloc -isystem /usr/include/miniupnpc -Werror -g -O2 -fPIC -fvisibility=hidden -fstack-reuse=none -fstack-protector-all -Wstack-protector -fcf-protection=full -fstack-clash-protection -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wredundant-decls -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wformat-security -Wredundant-move -Woverloaded-virtual -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-psabi -std=gnu++17 -MD -MT src/CMakeFiles/server.dir/rpc/blockchain.cpp.o -MF src/CMakeFiles/server.dir/rpc/blockchain.cpp.o.d -o src/CMakeFiles/server.dir/rpc/blockchain.cpp.o -c /work/src/rpc/blockchain.cpp
/work/src/rpc/blockchain.cpp: In function ‘getchaintxstats()::<lambda(const RPCHelpMan&, const Config&, const JSONRPCRequest&)>’:
/work/src/rpc/blockchain.cpp:1968:36: error: ‘*(std::_Optional_payload_base<unsigned int>::_Storage<unsigned int, true>*)((char*)&window_tx_count + offsetof(const std::optional<unsigned int>,std::optional<unsigned int>::<unnamed>.std::_Optional_base<unsigned int, true, true>::<unnamed>)).std::_Optional_payload_base<unsigned int>::_Storage<unsigned int, true>::_M_value’ may be used uninitialized [-Werror=maybe-uninitialized]
 1968 |                                    double(window_tx_count.value()) / nTimeDiff);
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/work/src/rpc/blockchain.cpp:1947:24: note: ‘*(std::_Optional_payload_base<unsigned int>::_Storage<unsigned int, true>*)((char*)&window_tx_count + offsetof(const std::optional<unsigned int>,std::optional<unsigned int>::<unnamed>.std::_Optional_base<unsigned int, true, true>::<unnamed>)).std::_Optional_payload_base<unsigned int>::_Storage<unsigned int, true>::_M_value’ was declared here
 1947 |             const auto window_tx_count{
      |                        ^~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
ninja: build stopped: cannot make progress due to previous errors.
Build build-diff failed with exit code 1
Fabien requested changes to this revision.Tue, May 6, 12:49
Fabien added a subscriber: Fabien.

clearing my queue

This revision now requires changes to proceed.Tue, May 6, 12:49