Page MenuHomePhabricator

rpc: Avoid getchaintxstats invalid results
ClosedPublic

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

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCb78399611ae6: rpc: Avoid getchaintxstats invalid results
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

Diff Detail

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

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

try another workaround

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/net.cpp.o
[517/658] Building CXX object src/CMakeFiles/bitcoinkernel.dir/util/sock.cpp.o
[518/658] Building C object src/secp256k1/CMakeFiles/secp256k1.dir/src/secp256k1.c.o
[519/658] Building C object src/secp256k1/CMakeFiles/sign-bench.dir/src/bench_sign.c.o
[520/658] Building CXX object src/CMakeFiles/bitcoinkernel.dir/policy/block/stakingrewards.cpp.o
[521/658] Building C object src/secp256k1/CMakeFiles/internal-bench.dir/src/bench_internal.c.o
[522/658] Building C object src/secp256k1/CMakeFiles/ecmult-bench.dir/src/bench_ecmult.c.o
[523/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockindex.cpp.o
[524/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[525/658] Building CXX object src/CMakeFiles/bitcoind.dir/bitcoind.cpp.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/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[535/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[536/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[537/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[538/658] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[539/658] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana_formatter.cpp.o
[540/658] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[541/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/txmempool.cpp.o
[542/658] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[543/658] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana.cpp.o
[544/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[545/658] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana_interpreter.cpp.o
[546/658] Linking C static library src/secp256k1/libsecp256k1.a
[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/ecmult-bench
[550/658] Linking C executable src/secp256k1/internal-bench
[551/658] Linking C executable src/secp256k1/sign-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/iguana/iguana
[558/658] Linking CXX executable src/bitcoin-cli
[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:1969: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]
 1969 |                                    double(window_tx_count_ref) / 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/util.cpp.o
[417/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[418/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[419/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.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/scriptpubkeyman.cpp.o
[422/583] Linking C executable src/secp256k1/recover-bench
[423/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[424/583] Linking C executable src/secp256k1/verify-bench
[425/583] Linking C executable src/secp256k1/ecmult-bench
[426/583] Linking C executable src/secp256k1/sign-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] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[429/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[430/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[431/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[432/583] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[433/583] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[434/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[435/583] Linking C executable src/secp256k1/internal-bench
[436/583] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[437/583] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana_interpreter.cpp.o
[438/583] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana_formatter.cpp.o
[439/583] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana.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/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[444/583] Linking CXX static library src/libbitcoinconsensus.a
[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/iguana/iguana
[451/583] Linking CXX executable src/bitcoin-cli
[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:1969: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]
 1969 |                                    double(window_tx_count_ref) / 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

Tail of the build log:

[519/658] Building C object src/secp256k1/CMakeFiles/internal-bench.dir/src/bench_internal.c.o
[520/658] Building C object src/secp256k1/CMakeFiles/ecmult-bench.dir/src/bench_ecmult.c.o
[521/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockindex.cpp.o
[522/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.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/coins.cpp.o
[525/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[526/658] Building CXX object src/CMakeFiles/bitcoin-chainstate.dir/bitcoin-chainstate.cpp.o
[527/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/random.cpp.o
[528/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[529/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[530/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[531/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[532/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[533/658] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[534/658] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[535/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[536/658] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[537/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[538/658] Building CXX object src/test/CMakeFiles/testutil.dir/util/txmempool.cpp.o
[539/658] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[540/658] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana_formatter.cpp.o
[541/658] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana_interpreter.cpp.o
[542/658] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[543/658] Linking C static library src/secp256k1/libsecp256k1.a
[544/658] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana.cpp.o
[545/658] Linking C executable src/secp256k1/recover-bench
[546/658] Linking C executable src/secp256k1/internal-bench
[547/658] Linking C executable src/secp256k1/sign-bench
[548/658] Linking C executable src/secp256k1/ecmult-bench
[549/658] Linking C executable src/secp256k1/verify-bench
[550/658] Linking CXX static library src/libbitcoinconsensus.a
[551/658] Linking CXX static library src/libscript.a
[552/658] Linking CXX static library src/libcommon.a
[553/658] Linking CXX shared library src/libbitcoinconsensus.so.0.31.2
[554/658] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[555/658] Linking CXX executable src/bitcoin-cli
[556/658] Linking CXX executable src/iguana/iguana
[557/658] Linking CXX executable src/bitcoin-tx
[558/658] Building CXX object src/CMakeFiles/server.dir/txmempool.cpp.o
[559/658] Building CXX object src/CMakeFiles/bitcoinkernel.dir/txmempool.cpp.o
[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
In file included from /work/src/./rpc/blockchain.h:13,
                 from /work/src/rpc/blockchain.cpp:6:
In constructor ‘UniValue::UniValue(Ref&&) [with Ref = unsigned int&; T = unsigned int; typename std::enable_if<((((is_floating_point_v<T> || is_same_v<bool, T>) || is_signed_v<T>) || is_unsigned_v<T>) || is_constructible_v<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, T>), bool>::type <anonymous> = true]’,
    inlined from ‘getchaintxstats()::<lambda(const RPCHelpMan&, const Config&, const JSONRPCRequest&)>’ at /work/src/rpc/blockchain.cpp:1966:31:
/work/src/univalue/include/univalue.h:61:19: 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]
   61 |             setInt(uint64_t{val});
      |             ~~~~~~^~~~~~~~~~~~~~~
/work/src/rpc/blockchain.cpp: In function ‘getchaintxstats()::<lambda(const RPCHelpMan&, const Config&, const JSONRPCRequest&)>’:
/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:

[411/583] Linking CXX executable src/bitcoin-cli
[412/583] Building CXX object src/test/CMakeFiles/testutil.dir/util/random.cpp.o
[413/583] Building CXX object src/CMakeFiles/server.dir/rpc/rawtransaction.cpp.o
[414/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[415/583] Building CXX object src/CMakeFiles/server.dir/txmempool.cpp.o
[416/583] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[417/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[418/583] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[419/583] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
[420/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[421/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[422/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
In file included from /work/src/./rpc/blockchain.h:13,
                 from /work/src/rpc/blockchain.cpp:6:
In constructor ‘UniValue::UniValue(Ref&&) [with Ref = unsigned int&; T = unsigned int; typename std::enable_if<((((is_floating_point_v<T> || is_same_v<bool, T>) || is_signed_v<T>) || is_unsigned_v<T>) || is_constructible_v<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, T>), bool>::type <anonymous> = true]’,
    inlined from ‘getchaintxstats()::<lambda(const RPCHelpMan&, const Config&, const JSONRPCRequest&)>’ at /work/src/rpc/blockchain.cpp:1966:31:
/work/src/univalue/include/univalue.h:61:19: 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]
   61 |             setInt(uint64_t{val});
      |             ~~~~~~^~~~~~~~~~~~~~~
/work/src/rpc/blockchain.cpp: In function ‘getchaintxstats()::<lambda(const RPCHelpMan&, const Config&, const JSONRPCRequest&)>’:
/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
[423/583] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[424/583] Building CXX object src/test/CMakeFiles/testutil.dir/util/txmempool.cpp.o
[425/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[426/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[427/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[428/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[429/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[430/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[431/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[432/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[433/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[434/583] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[435/583] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[436/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[437/583] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[438/583] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana.cpp.o
[439/583] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana_interpreter.cpp.o
[440/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[441/583] Building CXX object src/iguana/CMakeFiles/iguana.dir/iguana_formatter.cpp.o
[442/583] Linking CXX executable src/iguana/iguana
[443/583] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[444/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[445/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[446/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[447/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[448/583] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[449/583] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[450/583] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[451/583] Building CXX object src/CMakeFiles/server.dir/validation.cpp.o
[452/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[453/583] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[454/583] Linking CXX static library src/wallet/libwallet.a
ninja: build stopped: cannot make progress due to previous errors.
Build build-diff failed with exit code 1

give up on using std::optional

This revision is now accepted and ready to land.Tue, May 6, 15:29