mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 09:35:38 +00:00
scripted-diff: [fuzz] Add util/check.h includes for assertions #36074
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!36074
Loading…
Reference in a new issue
No description provided.
Delete branch "2608-test-assert"
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?
In test code,
assertis used. This is perfectly fine, but sometimes confusion arises, when it is unclear whetherNDEBUGcan disable the assertions, or whether to useassertorAssert.Avoid that confusion in test code with a scripted replacement to add the util/check.h include. The changes here will also make it easier to run IWYU.
Scope: This change is only about test code (fuzz), other code can be done later, if there is need to.
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:
src/test/fuzzand treat them as errors by hebasto)MSG_BLOCKby stripping witnesses in place by l0rinc)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.
🚧 At least one of the CI tasks failed.
Task
i686, no IPC: https://github.com/bitcoin/bitcoin/actions/runs/32832295932/job/97753466551LLM reason (✨ experimental): CI failed due to a C++ build error treated as fatal (
-Werror=return-type) inbench/sign_transaction.cppwhere anAssert(false)lambda triggers “control reaches end of non-void function.”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.
Hmm, I guess
Assert(0/false)being a function trips GCC into thinking it can return? Though, the optimized codegen is unaffected on GCC. Funnily clang doesn't warn, but pessimises codegen: https://godbolt.org/z/h79K1scWKI guess that means we could add an explicit
#define AssertUnreachable() assertion_fail(std::source_location::current(), "Unreachable code")🐙 This pull request conflicts with the target branch and needs rebase.
This one doesn't match
\<assert\(because of the space, and it's the only one left in the swept paths.lint_c_assertuses the same regex, so it doesn't catch it either. I addedassert (1);to a covered file and the linter still passes. How about\<assert\s*\(?src/ipc/test/is left out here, andsrc/ipc/test/fuzz/ipc.cpphas sixassert(.lint-tests.pyalready counts that directory as part of the test suite. Is this intentional?Thx, but I've dropped the third and forth commit for now, because:
This is why I only migrated the problematic usages with side effects - but I'm glad you're taking a stab at it systemically, even if just for tests for now
The comma in
'src/ipc/test/',ends up inside the element, so it still matches nothing.🐙 This pull request conflicts with the target branch and needs rebase.
Whoops, fixed. Thx
🐙 This pull request conflicts with the target branch and needs rebase.
rebased on top of the recent iwyu changes to drop hunks already merged, also taken out of draft
🐙 This pull request conflicts with the target branch and needs rebase.
🐙 This pull request conflicts with the target branch and needs rebase.
Concept ACK, though the scripted diffs will conflict with most open PRs.
I expect this to be in review for a while, so maybe we could extract the lint commit into a separate PR - that one is conflict-free and should pass quickly. And once it's in, both scripted diffs here can be done in a single commit: the formatter can just work on the pending diff right after the insertions, instead of formatting the previous commit in a separate step.
Also, since the formatter fixes placement anyway, could the include insertion skip the first-
#includeline-number lookup and just insert at the top of the file?🐙 This pull request conflicts with the target branch and needs rebase.
I went through all conflicts and there are about 6 acks in the list. Also, conflicts should be trivial to resolve in the include list, so I think it is fine. But I am happy to wait until this invalidates less acks.
The changes and scripts should be easy enough to keep bundled here. Also, I think it is easier to review the addition and the sorting separately.
clang-format can't move includes over
//comment lines. So this won't work.Rebased and left as-is for now.
No verified findings are available from this review.
Review coverage was incomplete.
Reviewed:
fa6c603af6ae· Review report · Previous reportspermalink
🚧 At least one of the CI tasks failed.
Task
lint: https://github.com/bitcoin/bitcoin/actions/runs/38883887988/job/116916841745LLM reason (✨ experimental): CI failed because the scripted-diff lint check detected uncommitted changes, including removed
cassertand clang-format modifications.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.
🚧 At least one of the CI tasks failed.
Task
lint: https://github.com/bitcoin/bitcoin/actions/runs/39234357822/job/117999721484LLM reason (✨ experimental): The
scripted_difflint check failed becausesrc/test/httpserver_tests.cppneeded a formatting change—an extra blank line between includes.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.
turned back into draft due to number of conflicts
🐙 This pull request conflicts with the target branch and needs rebase.
Rebased and limited to
fuzzto limit conflicts.ACK
fa6c603af6.This somewhat overlaps with #36808. However, this PR is focused and scripted, whereas #36808 is not ready for review yet. In any case, this PR will make the diff in #36808 smaller and easier to review.