Skip to content

Commit b58eebf

Browse files
committed
Merge bitcoin#34470: Bump leveldb subtree and remove UB workaround in CI
fad7d86 ci: Remove unused workaround after leveldb subtree bump (MarcoFalke) 2f2952c Squashed 'src/leveldb/' changes from cad64b151d..ab6c84e6f3 (MarcoFalke) Pull request description: Bump leveldb subtree and remove UB workaround in CI. This also fixes a GCC-16 warning. ACKs for top commit: l0rinc: code review ACK fad7d86 fanquake: ACK fad7d86 Tree-SHA512: dccd53ca638f1acbd72187032d858453e1cc58b156a52e24356c075ac85be0db47d7b73965131b5fbc7b188cbc34cbfd72a8286e860c3b28258daaf5437546f2
2 parents 8bb277c + fad7d86 commit b58eebf

2 files changed

Lines changed: 1 addition & 26 deletions

File tree

ci/test/03_test_script.sh

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -44,32 +44,6 @@ echo "=== BEGIN env ==="
4444
env
4545
echo "=== END env ==="
4646

47-
# Don't apply patches in the iwyu job, because it relies on the `git diff`
48-
# command to detect IWYU errors. It is safe to skip this patch in the iwyu job
49-
# because it doesn't run a UB detector.
50-
if [[ "${RUN_IWYU}" != true ]]; then
51-
# compact->outputs[i].file_size is uninitialized memory, so reading it is UB.
52-
# The statistic bytes_written is only used for logging, which is disabled in
53-
# CI, so as a temporary minimal fix to work around UB and CI failures, leave
54-
# bytes_written unmodified.
55-
# See https://github.com/bitcoin/bitcoin/pull/28359#issuecomment-1698694748
56-
# Tee patch to stdout to make it clear CI is testing modified code.
57-
tee >(patch -p1) <<'EOF'
58-
--- a/src/leveldb/db/db_impl.cc
59-
+++ b/src/leveldb/db/db_impl.cc
60-
@@ -1028,9 +1028,6 @@ Status DBImpl::DoCompactionWork(CompactionState* compact) {
61-
stats.bytes_read += compact->compaction->input(which, i)->file_size;
62-
}
63-
}
64-
- for (size_t i = 0; i < compact->outputs.size(); i++) {
65-
- stats.bytes_written += compact->outputs[i].file_size;
66-
- }
67-
68-
mutex_.Lock();
69-
stats_[compact->compaction->level() + 1].Add(stats);
70-
EOF
71-
fi
72-
7347
if [ "$RUN_FUZZ_TESTS" = "true" ]; then
7448
export DIR_FUZZ_IN=${DIR_QA_ASSETS}/fuzz_corpora/
7549
if [ ! -d "$DIR_FUZZ_IN" ]; then

src/leveldb/db/db_impl.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,7 @@ Status DBImpl::OpenCompactionOutputFile(CompactionState* compact) {
803803
pending_outputs_.insert(file_number);
804804
CompactionState::Output out;
805805
out.number = file_number;
806+
out.file_size = 0;
806807
out.smallest.Clear();
807808
out.largest.Clear();
808809
compact->outputs.push_back(out);

0 commit comments

Comments
 (0)