From fa40807fa830ee9724b5cfeef263263aaa6ce5d9 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Wed, 18 Dec 2024 09:50:13 +0100 Subject: [PATCH 1/2] ci: Enable DEBUG=1 for one GCC-12+ build to catch 117966 regressions --- ci/test/00_setup_env_native_centos.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/test/00_setup_env_native_centos.sh b/ci/test/00_setup_env_native_centos.sh index ff4b9bc570a..c423d788eb8 100755 --- a/ci/test/00_setup_env_native_centos.sh +++ b/ci/test/00_setup_env_native_centos.sh @@ -10,5 +10,6 @@ export CONTAINER_NAME=ci_native_centos export CI_IMAGE_NAME_TAG="quay.io/centos/centos:stream10" export CI_BASE_PACKAGES="gcc-c++ glibc-devel libstdc++-devel ccache make git python3 python3-pip which patch xz procps-ng ksh rsync coreutils bison e2fsprogs cmake" export PIP_PACKAGES="pyzmq" +export DEP_OPTS="DEBUG=1" # Temporarily enable a DEBUG=1 build to check for GCC-bug-117966 regressions. This can be removed once the minimum GCC version is bumped to 12 in the previous releases task, see https://github.com/bitcoin/bitcoin/issues/31436#issuecomment-2530717875 export GOAL="install" -export BITCOIN_CONFIG="-DWITH_ZMQ=ON -DBUILD_GUI=ON -DREDUCE_EXPORTS=ON" +export BITCOIN_CONFIG="-DWITH_ZMQ=ON -DBUILD_GUI=ON -DREDUCE_EXPORTS=ON -DCMAKE_BUILD_TYPE=Debug" From fa8ade300f421dcc3b0cd956ab03a50a5ae80646 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Fri, 17 Jan 2025 17:49:55 +0100 Subject: [PATCH 2/2] refactor: Avoid GCC false positive error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoids an overly agressive GCC false positive warning: error: ‘tmp’ may be used uninitialized [-Werror=maybe-uninitialized] --- src/test/fuzz/float.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/fuzz/float.cpp b/src/test/fuzz/float.cpp index 6897e814948..c80c4877e6c 100644 --- a/src/test/fuzz/float.cpp +++ b/src/test/fuzz/float.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2021 The Bitcoin Core developers +// Copyright (c) 2020-present The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -11,6 +11,7 @@ #include #include #include +#include FUZZ_TARGET(float) { @@ -18,7 +19,7 @@ FUZZ_TARGET(float) { const double d{[&] { - double tmp; + std::optional tmp; CallOneOf( fuzzed_data_provider, // an actual number @@ -42,7 +43,7 @@ FUZZ_TARGET(float) }); }, // Anything from raw memory (also checks that DecodeDouble doesn't crash on any input) [&] { tmp = DecodeDouble(fuzzed_data_provider.ConsumeIntegral()); }); - return tmp; + return *tmp; }()}; (void)memusage::DynamicUsage(d);