From 2f2952c5f2e367ccac34025a159c9fbaffd7f172 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Tue, 3 Feb 2026 11:15:21 +0100 Subject: [PATCH 1/2] Squashed 'src/leveldb/' changes from cad64b151d..ab6c84e6f3 ab6c84e6f3 Merge bitcoin-core/leveldb-subtree#58: Initialize file_size to 0 to avoid UB ad9b1c9893 Initialize file_size to 0 to avoid UB git-subtree-dir: src/leveldb git-subtree-split: ab6c84e6f38fae0279e30305a182f9b4674e2ecd --- db/db_impl.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/db/db_impl.cc b/db/db_impl.cc index 65e31724bce..10f523257c1 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -803,6 +803,7 @@ Status DBImpl::OpenCompactionOutputFile(CompactionState* compact) { pending_outputs_.insert(file_number); CompactionState::Output out; out.number = file_number; + out.file_size = 0; out.smallest.Clear(); out.largest.Clear(); compact->outputs.push_back(out); From fad7d86d8d17d89238ed9a2b2305cb3ed6a32cf4 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Sun, 1 Feb 2026 19:24:27 +0100 Subject: [PATCH 2/2] ci: Remove unused workaround after leveldb subtree bump --- ci/test/03_test_script.sh | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh index 3908b2746f5..e77ecd81a02 100755 --- a/ci/test/03_test_script.sh +++ b/ci/test/03_test_script.sh @@ -44,32 +44,6 @@ echo "=== BEGIN env ===" env echo "=== END env ===" -# Don't apply patches in the iwyu job, because it relies on the `git diff` -# command to detect IWYU errors. It is safe to skip this patch in the iwyu job -# because it doesn't run a UB detector. -if [[ "${RUN_IWYU}" != true ]]; then - # compact->outputs[i].file_size is uninitialized memory, so reading it is UB. - # The statistic bytes_written is only used for logging, which is disabled in - # CI, so as a temporary minimal fix to work around UB and CI failures, leave - # bytes_written unmodified. - # See https://github.com/bitcoin/bitcoin/pull/28359#issuecomment-1698694748 - # Tee patch to stdout to make it clear CI is testing modified code. - tee >(patch -p1) <<'EOF' ---- a/src/leveldb/db/db_impl.cc -+++ b/src/leveldb/db/db_impl.cc -@@ -1028,9 +1028,6 @@ Status DBImpl::DoCompactionWork(CompactionState* compact) { - stats.bytes_read += compact->compaction->input(which, i)->file_size; - } - } -- for (size_t i = 0; i < compact->outputs.size(); i++) { -- stats.bytes_written += compact->outputs[i].file_size; -- } - - mutex_.Lock(); - stats_[compact->compaction->level() + 1].Add(stats); -EOF -fi - if [ "$RUN_FUZZ_TESTS" = "true" ]; then export DIR_FUZZ_IN=${DIR_QA_ASSETS}/fuzz_corpora/ if [ ! -d "$DIR_FUZZ_IN" ]; then