mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:50:37 +00:00
Warn on and add missing [[noreturn]] #35911
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!35911
Loading…
Reference in a new issue
No description provided.
Delete branch "missing_noreturn"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Missing
[[noreturn]]attributes can cause compiler false positives and other issues; see discussion in https://github.com/bitcoin/bitcoin/pull/35896#discussion_r3726612556. Add missing attributes, and turn on compiler warnings.Some
[[noreturn]]additions may appear redundant, however they suppress warnings for various compiler versions, see discussion in https://github.com/bitcoin/bitcoin/pull/35911#discussion_r4658191746, and could be dropped in future, when support for those compilers is removed.Related:
https://github.com/bitcoin-core/libmultiprocess/pull/339.
https://github.com/bitcoin-core/leveldb-subtree/pull/64.
https://github.com/arun11299/cpp-subprocess/pull/132.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Conflicts
Reviewers, this pull request conflicts with the following ones:
-Wunusedby fanquake)If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
Nice. lgtm. Left some style nits, but feel free to ignore.
This looks like a compiler bug?
nit: Can probably split/clang-format this long line into 3 or so?
nit: Should probably use
std::exithttps://en.cppreference.com/cpp/utility/program/exitto avoid confusing with the one from C23?
But either is fine and I don't think this matters.
Could also add upstream, but doesn't matter for this pull.
🚧 At least one of the CI tasks failed.
Task
test ancestor commits: https://github.com/bitcoin/bitcoin/actions/runs/31089666107/job/92577355450LLM reason (✨ experimental): CI failed at build time because clang with
-Werrorrejected fuzz test code insrc/test/fuzz/fuzz.cpp(invalidnoreturnfunction return and unreachable code).Hints
Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
Opened https://github.com/arun11299/cpp-subprocess/pull/132.
Oh, I missed: This one is wrong:
Opened https://github.com/bitcoin-core/leveldb-subtree/pull/64 for the leveldb changes.
🚧 At least one of the CI tasks failed.
Task
lint: https://github.com/bitcoin/bitcoin/actions/runs/31093313597/job/92589235946LLM reason (✨ experimental): CI failed because the lint check
subtreedetected that a subtree directory was modified without the required subtree merge.Hints
Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
Added a commit for this.
Documentation says:
So this might give us false positives, but those could be suppressed?
https://gcc.gnu.org/onlinedocs/gcc-4.2.2/gcc/Warning-Options.html
Your documentation is about 20 years out of date. The modern docs say:
Mabye a bug in clang: https://github.com/bitcoin/bitcoin/actions/runs/31093885302/job/92591251807?pr=35911#step:11:3252:
Concept ACK.
Could you submit commit 2b6dee1f51651ecf7245552b467417cc72a28fe3 in a separate PR? That way, we can review and land it sooner to unbreak the nightly CI.
It is part of #35896.
Split this up.
🚧 At least one of the CI tasks failed.
Task
lint: https://github.com/bitcoin/bitcoin/actions/runs/31164196113/job/92821231499LLM reason (✨ experimental): CI failed because the linter’s “subtree” check detected modified subtree directories without a corresponding subtree merge.
Hints
Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
Concept ACK
Not sure it's worth trying to pull any changes out here, so this will remain drafted until the next libmultiprocess subtree update.
Looks like this still fails to compile on Windows for both clang-cl and MSVC? IIRC I tried this last week on godbolt and for some reason inlining the impl into the header worked around the bug.
Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive linked from the Review report for their assessments.
🟠 Minor · IPC
[[noreturn]]declarations conflict with returning proxy overridessubmitSolutionOld7andmakeMiningOld2now promise[[noreturn]], but their generated IPC proxies can return after a normal remote reply; no current C++ caller through a proxy was found.Location:
src/interfaces/mining.h:81(head).Review coverage was incomplete.
Reviewed:
e15168a20a14· Review report · Previous reportspermalink
🐙 This pull request conflicts with the target branch and needs rebase.
Rebased and should now be reviewable.
Rebased again, after #36036.
Assuming that the added attributes were prompted by compiler warnings, I wonder which exact compiler was used.
I’m asking because on Fedora 45 with Clang 23.1.5, I was able to build without any compiler warnings after applying the following partial revert of the first commit:
They have just been added to functions that don't return; irrespective of whether any particular compiler, or version of, may or may not have warned.
Not sure how this passes now, but I don' think we want to merge this in its current form. Devs will just have to fight the compiler matrix, without knowing what to do:
assert(false)doesn't work on Clang-Cl.Assert(false)doesn't' work on GCC.std::abortare unclear if they mean unreachable code or just a "normal" abort, because the program can't continue for whatever reason. Also, they don't have any debug prints.I've fixed this in https://github.com/bitcoin/bitcoin/pull/36087
Sure. Rebased on that branch.
🐙 This pull request conflicts with the target branch and needs rebase.
🚧 At least one of the CI tasks failed.
Task
lint: https://github.com/bitcoin/bitcoin/actions/runs/44286334548/job/134739857781LLM reason (✨ experimental): CI failed lint checks:
assert_falsyflagsassert(false)insrc/test/fuzz/util/wallet.h, and the scripted-diff check also failed.Hints
Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
🐙 This pull request conflicts with the target branch and needs rebase.
Rebased.
basically the same question from before ( https://github.com/bitcoin/bitcoin/pull/35911#pullrequestreview-5831762867):
A human reader will already see the
throw, so for them this attribute doesn't add anything. And similarly for a compiler it doesn't add anything either, because it will be cast away from the lambda?(Same for other lambdas, and virtual functions, etc)
Took at look, and Clang <=21 (
Ubuntu clang version 21.1.8 (6ubuntu1)), and I assume the equivalent version of Apple Clang, will warn without the attributes (some output below). I would rather leave a few (possibly redundant) annotations in place, and then just drop them once support for < Clang 22 is dropped?🚧 At least one of the CI tasks failed.
Task
Alpine (musl): https://github.com/bitcoin/bitcoin/actions/runs/45035866867/job/137249377761LLM reason (✨ experimental): The build failed because
-Werrorpromoted GCC’ssuggest-attribute=noreturnwarnings insrc/test/util/net.cppto errors.Hints
Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
In Win Cross, Alpine, 32bit Arm i686 & previous releases:
ok, I see. Seems fine then
Added a link to this to the PR description.
ACK
75b8304271nit: it's a bit awkward to mark a
virtualmethod as[[noreturn]]when an override can be implemented to return.The libmultiprocess generated
ProxyClientmethod overrides can return. I don't think anything in-tree callsmakeMiningOld2(orsubmitSolutionOld7) via IPC, but if that changes, a newer client (withnoreturn) that calls an older server (that may return) can cause UB. The IPC interface is experimental, but at the same time the only reason we have theseOldfunctions to handle version mismatches gracefully. Perhaps it makes sense to just not mark these kinds of functions asvirtual?nit: I think this can be done with a lot less code churn by just moving
LLVMFuzzerInitializenext toinitialize?git diff on
75b8304271Thanks, simplified this.
re-ACK
1de12da093cc @ryanofsky
The implementation of
MakeWalletLoader()depends on theENABLE_WALLETconfiguration variable.We could use a pragma here:
__GNUC__is not defined byclang-cl.exeon Windows, so the pragma is skipped. As a result, a Release build configured with-DBUILD_FUZZ_BINARY=ONemits a-Wmissing-noreturnwarning forinitialize().Added.
Rebased for #37047 and addressed comments.
Clang 22.1 and later handles such cases correctly and emits no warning.
Yes. See https://github.com/bitcoin/bitcoin/pull/35911#discussion_r4658607989.
Should we add a TODO comment? Otherwise, it will be easy to forget to drop them when the time comes.
I'm not sure if it's needed (this is also a few years away), and they are not only for Clang. Otherwise feel free to propose a diff.
I think we need a similar exception for builds without asmap:
git diff on
9acce2abd8