fix: compilation error with modern gcc for leveldb subtree#7393
Conversation
In copy constructor 'constexpr leveldb::DBImpl::CompactionState::Output::Output(const leveldb::DBImpl::CompactionState::Output&)',
inlined from 'constexpr _Tp* std::construct_at(_Tp*, _Args&& ...) [with _Tp = leveldb::DBImpl::CompactionState::Output; _Args = {const leveldb::DBImpl::CompactionState::Output&}]' at /usr/include/c++/16/bits/stl_construct.h:110:9,
inlined from 'static constexpr void std::allocator_traits<std::allocator<_Up> >::construct(allocator_type&, _Up*, _Args&& ...) [with _Up = leveldb::DBImpl::CompactionState::Output; _Args = {const leveldb::DBImpl::CompactionState::Output&}; _Tp = leveldb::DBImpl::CompactionState::Output]' at /usr/include/c++/16/bits/alloc_traits.h:716:21,
inlined from 'constexpr void std::vector<_Tp, _Alloc>::_M_realloc_append(_Args&& ...) [with _Args = {const leveldb::DBImpl::CompactionState::Output&}; _Tp = leveldb::DBImpl::CompactionState::Output; _Alloc = std::allocator<leveldb::DBImpl::CompactionState::Output>]' at /usr/include/c++/16/bits/vector.tcc:594:26,
inlined from 'constexpr void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = leveldb::DBImpl::CompactionState::Output; _Alloc = std::allocator<leveldb::DBImpl::CompactionState::Output>]' at /usr/include/c++/16/bits/stl_vector.h:1417:21,
inlined from 'leveldb::Status leveldb::DBImpl::OpenCompactionOutputFile(CompactionState*)' at leveldb/db/db_impl.cc:808:31:
leveldb/db/db_impl.cc:57:10: error: 'out.leveldb::DBImpl::CompactionState::Output::file_size' may be used uninitialized [-Werror=maybe-uninitialized]
57 | struct Output {
| ^~~~~~
leveldb/db/db_impl.cc: In member function 'leveldb::Status leveldb::DBImpl::OpenCompactionOutputFile(CompactionState*)':
leveldb/db/db_impl.cc:804:29: note: 'out' declared here
804 | CompactionState::Output out;
Original leveldb's commit is ad9b1c989380538bfb19c5c65df0d3f72d8ed62b
Backported to Bitcoin Core by bitcoin#34470
Though, that too many unrelated changes meanwhile.
That's temporary fix until leveldb's version won't be properly updated.
✅ No Merge Conflicts DetectedThis PR currently has no conflicts with other open PRs. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughIn Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Review complete (commit 75b19b3) |
thepastaclaw
left a comment
There was a problem hiding this comment.
Code Review
Verified PR #7393 against the checked-out source. The change is a single initialization of CompactionState::Output::file_size before the Output object is copied into compact->outputs; successful compaction overwrites it before install, and failed compaction paths do not call InstallCompactionResults, so the change fixes the GCC warning without changing persisted LevelDB behavior.
…b subtree 75b19b3 fix: compilation error with modern gcc for leveldb subtree (Konstantin Akimov) Pull request description: ## Issue being fixed or feature implemented Dash Core's build fails with gcc-16: In copy constructor 'constexpr leveldb::DBImpl::CompactionState::Output::Output(const leveldb::DBImpl::CompactionState::Output&)', inlined from 'constexpr _Tp* std::construct_at(_Tp*, _Args&& ...) [with _Tp = leveldb::DBImpl::CompactionState::Output; _Args = {const leveldb::DBImpl::CompactionState::Output&}]' at /usr/include/c++/16/bits/stl_construct.h:110:9, inlined from 'static constexpr void std::allocator_traits<std::allocator<_Up> >::construct(allocator_type&, _Up*, _Args&& ...) [with _Up = leveldb::DBImpl::CompactionState::Output; _Args = {const leveldb::DBImpl::CompactionState::Output&}; _Tp = leveldb::DBImpl::CompactionState::Output]' at /usr/include/c++/16/bits/alloc_traits.h:716:21, inlined from 'constexpr void std::vector<_Tp, _Alloc>::_M_realloc_append(_Args&& ...) [with _Args = {const leveldb::DBImpl::CompactionState::Output&}; _Tp = leveldb::DBImpl::CompactionState::Output; _Alloc = std::allocator<leveldb::DBImpl::CompactionState::Output>]' at /usr/include/c++/16/bits/vector.tcc:594:26, inlined from 'constexpr void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = leveldb::DBImpl::CompactionState::Output; _Alloc = std::allocator<leveldb::DBImpl::CompactionState::Output>]' at /usr/include/c++/16/bits/stl_vector.h:1417:21, inlined from 'leveldb::Status leveldb::DBImpl::OpenCompactionOutputFile(CompactionState*)' at leveldb/db/db_impl.cc:808:31: leveldb/db/db_impl.cc:57:10: error: 'out.leveldb::DBImpl::CompactionState::Output::file_size' may be used uninitialized [-Werror=maybe-uninitialized] 57 | struct Output { | ^~~~~~ leveldb/db/db_impl.cc: In member function 'leveldb::Status leveldb::DBImpl::OpenCompactionOutputFile(CompactionState*)': leveldb/db/db_impl.cc:804:29: note: 'out' declared here 804 | CompactionState::Output out; ## What was done? Original leveldb's commit is ad9b1c989380538bfb19c5c65df0d3f72d8ed62b Backported to Bitcoin Core by bitcoin#34470 Though, that too many unrelated changes meanwhile. That's temporary fix until leveldb's version won't be properly updated. ## How Has This Been Tested? Together with dashpay#7392 I finally compile dash core with gcc 16 again. ## Breaking Changes N/A ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACK 75b19b3 Tree-SHA512: 985042f04a4df7b20aaa773d302401af948099ae8c29d6669f0441e654b9c8847942e75574c52d1652411e321b80b1861f93c163792636d1246bea9edc99c249
2dd6190 fix: keep DKG session header self-contained (PastaClaw) 01fc719 chore: prepare v23.1.7 release (pasta) c4eafd2 Merge #7393: fix: compilation error with modern gcc for leveldb subtree (pasta) 1cdc55a Merge #7392: backport: bitcoin#30633 (pasta) cb6afcb net: avoid ThreadSocketHandler busy-loop on receive-paused peers (pasta) b6e881a governance: bound govsync bloom filter hash-function count (pasta) 0a681db instantsend: cap islock inputs and bound the pending-lock queues (pasta) 1132a25 bls: guard AsyncVerifyContributionShare against a null verification vector (pasta) 31142da llmq: harden DKG message-intake against unauthenticated retention and crashes (pasta) Pull request description: # chore: merge master into develop ## Issue being fixed or feature implemented Merge the v23.1.7 release branch history from `master` back into `develop` after the release. ## What was done? - Merged `upstream/master` (`01fc719f90`, `chore: prepare v23.1.7 release`) into `upstream/develop` (`547bf5eee2`). - Resolved merge conflicts in release metadata/manpages, DKG hardening, InstantSend queue bounding, and BLS test coverage. - Preserved the v23.1.7 release updates and the hardening/build-fix commits now present on `master`. - Applied review fixes for the merge result: - kept DKG peer-misbehavior reason strings required by the new functional test coverage; - removed the stale duplicate `CDKGPrematureCommitment::GetSignHash()` definition after `dkgmessages.h` introduced inline message helpers; - fixed the new BLS unit test to start its local worker with an explicit worker count; - relaxed DKG intake structural checks to enforce safe upper bounds while leaving exact reduced-quorum member counts to the DKG session. ## How Has This Been Tested? - `git diff --check HEAD^1..HEAD` - `rg '^(<<<<<<<|>>>>>>>)'` - `code-review dashpay/dash upstream/develop chore/merge-master-into-develop-20260701` No local compile was run because this worktree has no configured build directory. ## Breaking Changes None expected. This is a release merge-back from `master` to `develop`. ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: kwvg: utACK 2dd6190 Tree-SHA512: 8ad430edaf451a8f33d4047702092c0f181e5e50fec61052dae446aee89371f3a18f2db0a52b287e80bb4806da485213e91f7a13cc0849d4cbbecd4c43101f9d
Issue being fixed or feature implemented
Dash Core's build fails with gcc-16:
What was done?
Original leveldb's commit is ad9b1c989380538bfb19c5c65df0d3f72d8ed62b Backported to Bitcoin Core by bitcoin#34470 Though, that too many unrelated changes meanwhile. That's temporary fix until leveldb's version won't be properly updated.
How Has This Been Tested?
Together with #7392 I finally compile dash core with gcc 16 again.
Breaking Changes
N/A
Checklist: