mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:08:38 +00:00
qa: check more socket API invariants for each platform we support #36737
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!36737
Loading…
Reference in a new issue
No description provided.
Delete branch "2610_sock_invariants"
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?
This improves our
Socktest coverage following CVE-2026-117350.This leaves out the test for the specific case that led to the OOM until we fix
select()reporting for urgent data, but i'm also trying not to fight the last battle too much. Instead i focused on trying to pin down all invariants Claude and I could come up with that could be reasonably tested. This will help us understand our code better, and get more assurance we do not break some assumption a (security critical) caller may be relying on further down the road.Another goal is to tie the events our fuzzing mock can report to the events each OS actually reports, and when. A follow-up will extend the mock to match what these tests pin down. This wouldn’t have caught the CVE-2026-117350 bug: it was in the very logic the mock replaces, so a fuzz target could only have found it if the mock had been written with that bug in mind. But the next bug may well be somewhere else, and a mock that can report everything the real socket APIs can, lets the fuzzer reach corner cases which may lack a proper unit test.
A lot more coverage could be added. I chose not to add tests specific to the logic used for trusted interfaces (Tor control, the SOCKS5 proxy, I2P SAM) or to a single platform. I also left out the test which led me to find https://github.com/bitcoin/bitcoin/pull/36688#issuecomment-6509375262, as this needs to be fixed first.
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:
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.
LLM Linter (✨ experimental)
Possible typos and grammar issues:
src/test/sock_tests.cpp:overriden→overridden[misspelling]2026-11-03 03:58:39
🔵 Suggestion · Readiness progress probe ignores events reported only by WaitMany()
In the readiness test, an optional SendEvent reported only by the aggregate WaitMany() can escape the send-progress check for a full, non-reset socket.
Location:
src/test/sock_tests.cpp:581(head).🔵 Suggestion · Idle timeout tests do not detect early returns
The
timeouttest (sock_tests.cpp:667-679) only checks that 100ms waits return true and report no events, so an immediate return passes. large_timeout uses whole-second timeouts only (MAX_WAIT_TIMEOUT is in seconds). A broken sub-second path, such as MillisToTimeval's tv_usec branch, would go undetected.Location:
src/test/sock_tests.cpp:667(head).Review coverage was incomplete.
Reviewed:
7b4153b86ed8· Full review report · Previous reportspermalink
🚧 At least one of the CI tasks failed.
Task
test ancestor commits: https://github.com/bitcoin/bitcoin/actions/runs/41545254532/job/125619164838LLM reason (✨ experimental): The build failed because
sock_tests.cppreferences undeclaredAcceptedSockandset_optionsidentifiers.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.
Nice, Concept ACK
Concept ACK
On Linux this test still passes with the cap removed from
WaitMany(). With 2^32 ms, which reachespoll()as 0, the test fails without the cap.This check fails on macOS in 141 of 3200 runs with 8 processes at once.
FillSendBuffer()already requires a would-block before it returns, so could this check go?After #36716, the exception set, where
FAILED_CONNECT_EVENTSexpects Windows to report the failure, is only watched whenErrorEventis requested. Once rebased on master, could this wait requestErrorEventtoo?