Skip to content

fix(libkernel): wait for the rest of a MSG_WAITALL stream receive in the guest layer - #11896

Open
ionut27001 wants to merge 1 commit into
boykopovar:mainfrom
ionut27001:fix/libkernel-recv-waitall-measured
Open

ionut27001 wants to merge 1 commit into
boykopovar:mainfrom
ionut27001:fix/libkernel-recv-waitall-measured

Conversation

@ionut27001

@ionut27001 ionut27001 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What

MSG_WAITALL (0x40) on a stream socket is no longer passed to the host. recv, recvfrom and recvmsg take the first data with the existing wait (EAGAIN at once on a nonblocking socket or with MSG_DONTWAIT, otherwise up to SO_RCVTIMEO), then wait for readability and receive the rest in a loop, also on a nonblocking socket and with MSG_DONTWAIT, until the request is full, the peer closes, an error occurs or no data arrives for SO_RCVTIMEO (each wait gets the whole timeout; with no SO_RCVTIMEO set the wait for the rest is unbounded, which matches v1 not returning from case c), and return the partial count. Datagram sockets keep ignoring the flag.

Before, the host decided. Per the Winsock recv documentation, MSG_WAITALL on a nonblocking socket or with MSG_PEEK fails with WSAEOPNOTSUPP, and a blocking MSG_DONTWAIT | MSG_WAITALL is not bounded by SO_RCVTIMEO after the first poll. On Linux a nonblocking socket or MSG_DONTWAIT returned the queued bytes at once (tcp_recvmsg breaks on !timeo once data is copied), where the console waits up to SO_RCVTIMEO; a blocking receive was not bounded by the guest's SO_RCVTIMEO, because the guest keeps that timeout in its own socket state and does not set it on the host socket. The old code was run only through the new test on Windows (see Tested), which hit ctest's 20 s limit, most likely at its first, blocking, receive; the nonblocking, MSG_PEEK and MSG_DONTWAIT descriptions above come from documentation only. Only Windows was available as a host.

MSG_PEEK | MSG_WAITALL on a stream socket is now a plain MSG_PEEK (the usual wait for the first data, EAGAIN when nonblocking with nothing queued, 0 at end of stream), and it throws when that peek gets some but fewer bytes than the request (not measured on a console except that case): it was host-dependent before (EOPNOTSUPP on Windows, a wait for the full request on Linux), and the measured result (the queued bytes repeated) is recorded in the debt entry instead of reproduced. recvmsg already writes the passed flags to msg_flags, which matches the measured 0x40, so it is unchanged. The MSG_WAITALL entry in docs/dev/debt/libkernel.md is cut to what is still open.

Measured in a payload process on a PS5 (firmware 12.70), loopback TCP pair, 8-byte requests (probe p85, v2 log):

  • a. blocking, 3 bytes queued and 5 more 200 ms later: case a_blocking_split ret=8 errno=0 bytes="12345678" ms=200
  • b. 3 bytes queued then the peer's SHUT_WR: case b_peer_shut_first ret=3 errno=0 bytes="123" ms=0, case b_peer_shut_second ret=0 errno=0 bytes=- ms=0
  • c. O_NONBLOCK, SO_RCVTIMEO 1 s, 3 bytes queued: case c_nonblock_3queued ret=3 errno=0 bytes="123" ms=1000; nothing queued: case c_nonblock_empty ret=-1 errno=35 bytes=- ms=0. v1, which per the v2 probe header set no SO_RCVTIMEO, logged nothing after c_setnonblock and has no # end probe line.
  • g. same socket as c: case g_recvfrom_nonblock_3queued ret=3 errno=0 bytes="abc" ms=1001, case g_recvmsg_nonblock_3queued ret=3 errno=0 bytes="xyz" ms=1000, case g_recvmsg_flags value=0x40
  • d. blocking, MSG_DONTWAIT | MSG_WAITALL, SO_RCVTIMEO 2 s, 3 bytes queued: case d_dontwait_waitall_3queued ret=3 errno=0 bytes="123" ms=2000
  • e. MSG_PEEK | MSG_WAITALL, 3 bytes queued: case e_peek_waitall_3queued ret=8 errno=0 bytes="12312312" ms=0, then case e_plain_after_peek ret=3 errno=0 bytes="123" ms=0
  • f. SO_RCVTIMEO 300 ms, 3 bytes queued: case f_timeout_3queued ret=3 errno=0 bytes="123" ms=300; nothing queued: case f_timeout_empty ret=-1 errno=35 bytes=- ms=300

The new test guest_socket_wait_all (target guest_socket_wait_all_tests) covers c, d, f, g, the msg_flags read-back, the empty nonblocking EAGAIN, MSG_PEEK | MSG_WAITALL with nothing queued (EAGAIN) and the deliberate throw for MSG_PEEK | MSG_WAITALL with 3 of 8 bytes queued (the bytes stay queued) on a loopback TCP pair with a 200 ms SO_RCVTIMEO; a and the first receive of b stay covered by guest_tcp. The three receives now share one WSAEMSGSIZE mapping on Windows, which also accepts sequenced-packet sockets for recv and recvfrom as recvmsg already did; Windows has no SOCK_SEQPACKET socket (socketpair throws), so this cannot be observed.

Tested

Windows 11, WinLibs GCC 15.2.0 (Release, Ninja), commit ef5ae8e on main 75f3702:

  • ctest -R ^guest_socket_wait_all$ passed twice (about 1.5 s each).
  • ctest -R "guest_tcp|guest_udp|socket|guest_unix|guest_net": 43 of 43 passed.
  • With Udp.cpp restored from main and rebuilt, guest_socket_wait_all times out (ctest's 20 s limit), most likely in the first blocking receive, where the host MSG_WAITALL receive is not bounded by the guest's SO_RCVTIMEO.
  • Linux and macOS were not built or run.

Checklist

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Windows coverage is useful, and the core loop returns partial bytes on timeout/EOF as described. I also built the exact Udp.cpp and guest_socket_wait_all_tests source locally. The binary could not complete under QEMU because this environment's process-memory read helper fails with ENOSYS (process_vm_readv failed with errno 38); I do not count that as a runtime pass. The hosted Windows test passes; Linux and macOS product tests were not run.

[P1] Preserve cancellation and signal handling in the new wait loop. WaitReady calls poll/WSAPoll directly, and on POSIX retries EINTR without consulting the guest I/O cancellation state. When composed with open PR #11872, this is a new blocking phase after a partial receive that bypasses the cancellation-aware ThreadCancel::Native/IoInterrupted path in that PR's WaitForTransfer. A deferred cancellation or caught signal can therefore remain stuck in the post-partial MSG_WAITALL wait. Please coordinate the stack with #11872, route this wait through its cancellation/signal machinery, and add a regression that cancels/interrupts a MSG_WAITALL receive after its first partial bytes.

[P2] Declare the overlapping PR order. The body says this conflicts with #11872 and that whichever lands second will rebase, but that is not an agreed order. CONTRIBUTING.md requires contributors to agree on ordering for conflicting changes and list the dependency. Please coordinate with the #11872 author and record the agreed Depends on order before merge.

The new partial MSG_PEEK | MSG_WAITALL path deliberately throws when fewer bytes are queued, while the measured console repeats queued bytes. Please add a focused assertion for that explicit unsupported path so it remains a deliberate throw, or implement the measured behavior. Linux runtime validation is also still needed because this changes the POSIX receive path.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 4563 core/libs/prx/libkernel/CMakeLists.txt
PR 4630 docs/dev/debt/libkernel.md
PR 5021 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
PR 6149 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 6740 docs/dev/debt/libkernel.md
PR 6936 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 7088 core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
PR 7090 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
PR 7105 docs/dev/debt/libkernel.md
PR 7121 docs/dev/debt/libkernel.md
PR 7135 docs/dev/debt/libkernel.md
PR 7149 docs/dev/debt/libkernel.md
PR 7156 core/libs/prx/libkernel/CMakeLists.txt
PR 7192 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 7447 docs/dev/debt/libkernel.md
PR 7464 docs/dev/debt/libkernel.md
PR 7485 core/libs/prx/libkernel/Socket/src/Udp.cpp
PR 7507 core/libs/prx/libkernel/Socket/src/Udp.cpp
PR 7509 docs/dev/debt/libkernel.md
PR 7532 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 7565 docs/dev/debt/libkernel.md
PR 7804 docs/dev/debt/libkernel.md
PR 8041 core/libs/prx/libkernel/CMakeLists.txt
PR 8448 core/libs/prx/libkernel/Socket/src/Udp.cpp
PR 8463 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
PR 8477 core/libs/prx/libkernel/CMakeLists.txt
PR 8497 docs/dev/debt/libkernel.md
PR 8605 core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
PR 9019 core/libs/prx/libkernel/CMakeLists.txt
PR 9156 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 9199 docs/dev/debt/libkernel.md
PR 9242 docs/dev/debt/libkernel.md
PR 9293 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 9297 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 9302 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 9326 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 9383 core/libs/prx/libkernel/CMakeLists.txt
PR 9389 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 9491 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 9557 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 9566 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 9684 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 9713 core/libs/prx/libkernel/Socket/src/Udp.cpp
PR 9843 docs/dev/debt/libkernel.md
PR 9882 docs/dev/debt/libkernel.md
PR 9938 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 9947 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 9948 core/libs/prx/libkernel/Socket/src/Udp.cpp
PR 10025 docs/dev/debt/libkernel.md
PR 10192 docs/dev/debt/libkernel.md
PR 10319 docs/dev/debt/libkernel.md
PR 10442 docs/dev/debt/libkernel.md
PR 10552 docs/dev/debt/libkernel.md
PR 10558 docs/dev/debt/libkernel.md
PR 10645 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
PR 10749 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 10789 docs/dev/debt/libkernel.md
PR 10806 core/libs/prx/libkernel/CMakeLists.txt
PR 10953 core/libs/prx/libkernel/CMakeLists.txt
PR 10979 core/libs/prx/libkernel/CMakeLists.txt
PR 11002 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 11042 docs/dev/debt/libkernel.md
PR 11215 docs/dev/debt/libkernel.md
PR 11219 core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
PR 11223 core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
PR 11247 core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
PR 11281 core/libs/prx/libkernel/Socket/src/Udp.cpp
PR 11445 core/libs/prx/libkernel/Socket/src/Udp.cpp
PR 11446 core/libs/prx/libkernel/CMakeLists.txt
PR 11624 docs/dev/debt/libkernel.md
PR 11625 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 11628 docs/dev/debt/libkernel.md
PR 11661 docs/dev/debt/libkernel.md
PR 11689 docs/dev/debt/libkernel.md
PR 11698 docs/dev/debt/libkernel.md
PR 11831 core/libs/prx/libkernel/CMakeLists.txt
PR 11849 docs/dev/debt/libkernel.md
PR 11851 core/libs/prx/libkernel/CMakeLists.txt
PR 11891 core/libs/prx/libkernel/CMakeLists.txt
PR 11894 core/libs/prx/libkernel/CMakeLists.txt
PR 12078 core/libs/prx/libkernel/CMakeLists.txt
PR 12104 docs/dev/debt/libkernel.md
PR 12139 core/libs/prx/libkernel/CMakeLists.txt
PR 12170 docs/dev/debt/libkernel.md
PR 12202 docs/dev/debt/libkernel.md
PR 12544 core/libs/prx/libkernel/CMakeLists.txt
PR 12560 docs/dev/debt/libkernel.md
PR 12646 core/libs/prx/libkernel/Socket/src/Udp.cpp
PR 12688 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
PR 12700 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
PR 12741 docs/dev/debt/libkernel.md
PR 12826 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 12854 docs/dev/debt/libkernel.md
PR 12922 docs/dev/debt/libkernel.md
PR 12925 docs/dev/debt/libkernel.md
PR 12965 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
PR 12970 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 13224 docs/dev/debt/libkernel.md
PR 13336 docs/dev/debt/libkernel.md
PR 13504 docs/dev/debt/libkernel.md
PR 13506 docs/dev/debt/libkernel.md
PR 13560 core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
PR 13582 docs/dev/debt/libkernel.md
PR 13587 docs/dev/debt/libkernel.md
PR 13664 core/libs/prx/libkernel/Socket/src/Udp.cpp
PR 13695 core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
PR 13752 core/libs/prx/libkernel/Socket/src/Udp.cpp
PR 13790 docs/dev/debt/libkernel.md
PR 13798 docs/dev/debt/libkernel.md
PR 13824 docs/dev/debt/libkernel.md
PR 13832 docs/dev/debt/libkernel.md
PR 13854 docs/dev/debt/libkernel.md
PR 13866 docs/dev/debt/libkernel.md
PR 13892 docs/dev/debt/libkernel.md
PR 13895 docs/dev/debt/libkernel.md
PR 13896 docs/dev/debt/libkernel.md
PR 13950 docs/dev/debt/libkernel.md
PR 13953 docs/dev/debt/libkernel.md
PR 13964 docs/dev/debt/libkernel.md
PR 13995 docs/dev/debt/libkernel.md
PR 14039 docs/dev/debt/libkernel.md
PR 14043 core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
PR 14085 docs/dev/debt/libkernel.md
PR 14103 docs/dev/debt/libkernel.md
PR 14105 docs/dev/debt/libkernel.md
PR 14108 docs/dev/debt/libkernel.md
PR 14111 core/libs/prx/libkernel/CMakeLists.txt
docs/dev/debt/libkernel.md
PR 14128 docs/dev/debt/libkernel.md
PR 14183 core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
PR 14190 docs/dev/debt/libkernel.md
PR 14206 core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
PR 14212 docs/dev/debt/libkernel.md

@Felipebmaitan

Copy link
Copy Markdown
Contributor

@ionut27001 I am coordinating #11872 (POSIX read/receive cancellation, head bcf5df1) with this PR under CONTRIBUTING.md.

Proposed order: #11872 first, then #11896. Marc identified the post-partial WaitReady integration issue in your review. I propose #11872 first so the new wait loop can use established IoInterrupted/native wake/drain ownership rather than raw poll/WSAPoll retries. Every post-partial wait needs cancellation/signal/close participation, including Windows where CancelIoEx cannot wake an unrelated raw WSAPoll. Partial bytes must remain reportable and HostWrite/descriptor ownership must last through native drain. Please retain per-call flag/timeout contracts and keep console-derived behavior separate unless established for the same entry point. Combined regression checks should cancel, signal and close after a deterministic first partial transfer. I have not run this combination.

Would you agree to that order and record #11872 in your Depends on line for the ordering? If your PR needs to go first, please say so; I can handle the later conflict resolution on #11872 instead. This is a proposal awaiting your confirmation, not an existing agreement.

AI-assisted coordination.

@MarcZX10

Copy link
Copy Markdown
Contributor

The proposed order (#11872 first, then this follow-up) is technically coherent because the post-partial wait needs the cancellation-aware transfer machinery. I cannot treat that order as agreed until #11872’s author confirms it; please coordinate with them and record the same Depends on order in both PRs as appropriate. I am keeping the cancellation/signal review request open pending that integration and regression evidence.

…the guest layer

MSG_WAITALL on a stream socket is no longer passed to the host. recv,
recvfrom and recvmsg take the first data with the usual wait, then wait
for the rest, also on a nonblocking socket and with MSG_DONTWAIT, and
return the partial count on timeout, as a payload process on a PS5
(firmware 12.70) does. A peer close ends the wait with the partial count
(FreeBSD 11.4 soreceive_generic; the console was measured only with the
close before the receive). MSG_PEEK with MSG_WAITALL on a stream socket
throws when the peek returns some but fewer bytes than the request; with
nothing queued it behaves as a plain MSG_PEEK.
@ionut27001
ionut27001 force-pushed the fix/libkernel-recv-waitall-measured branch from f2f5410 to ef5ae8e Compare October 27, 2026 14:11
@ionut27001

Copy link
Copy Markdown
Contributor Author

@Felipebmaitan agreed: #11872 first, then this one. The body now says Depends on: #11872. After #11872 merges I will rebase, route the wait for the rest through its cancellation and signal handling, and add a regression that cancels, signals and closes during a MSG_WAITALL receive after its first partial bytes.

The test now also asserts the deliberate throw for MSG_PEEK | MSG_WAITALL with 3 of 8 bytes queued, and that the bytes stay queued. Rebased onto main; the test passes twice and the socket tests pass on Windows.

@adriadam10 adriadam10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the measurements and the Windows run. The change itself matches them (cases c, d, f, g in the new test), but it can't land yet:

  • core/libs/prx/libkernel/Socket/src/Udp.cpp:772 WaitReady calls poll/WSAPoll directly, and Receive (Udp.cpp:844) loops on it after the first bytes. That wait can't be cancelled, interrupted by a signal or woken by close, which is what @MarcZX10's open review asks for.
  • As agreed in the thread, this follows #11872: once it merges, rebase, route the wait for the rest through its cancellation/signal/close handling, and add the regression that cancels, signals and closes during a MSG_WAITALL receive after its first partial bytes (partial count still returned).

Everything else (flag handling, MSG_PEEK | MSG_WAITALL throw, debt entry, test registration) looks fine as is.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-checked — new head, changes requested

I rechecked exact head ef5ae8e against current main 3a2b919; the PR merges cleanly with main, but its declared prerequisite #11872 has since closed as superseded by #12682, and the two current heads conflict when combined.

What I ran

Environment: Linux x86_64, kernel 6.1.0-54-amd64, Python 3.11.2.

git diff --check upstream/main...refs/remotes/review/11896
python3 tools/check_conventions.py --base upstream/main --head refs/remotes/review/11896
git merge-tree --write-tree upstream/main refs/remotes/review/11896
git merge-tree --write-tree refs/remotes/review/12682 refs/remotes/review/11896
gh pr checks 11896 --repo boykopovar/AnyPS5

I inspected the current dependency declaration, the closure note on #11872, and the changed files on both PR heads. I did not rerun the socket tests locally.

Results

Check Result
Merge preview with current main Clean
Diff check Passed
Conventions Passed
Pairwise preview with replacement #12682 Conflicts in Udp.cpp and docs/dev/debt/libkernel.md
Hosted Windows job Passed
Hosted conventions, eligibility, labels, report Passed
Hosted Linux and specialized jobs Skipped
Local socket tests Not run
Raw output
Current-main merge preview:
6877f55002b2a534d6c0de5a887f04026664fff6

Diff check:
(no output; exit status 0)

Convention checker:
All conventions checks passed.

Pairwise merge preview:
0459f67d023698e096d420903d78747329c93dce
100644 1131f91a2ae9c3cfa6619268c9bf18e5937331a0 1	core/libs/prx/libkernel/Socket/src/Udp.cpp
100644 dcaa98e609a3488192bec384bf2a7201c6daf121 2	core/libs/prx/libkernel/Socket/src/Udp.cpp
100644 2aa0e1997b2ae964371669bea7d93c7450851b15 3	core/libs/prx/libkernel/Socket/src/Udp.cpp
100644 bb9b37c8e63e109df8ab04027be0541ef7c7a6f2 1	docs/dev/debt/libkernel.md
100644 ebc5431552ce51cad3907cdb24e5195d898524b1 2	docs/dev/debt/libkernel.md
100644 ff35a0d857440c68c74c419f7951ef1d13c1d0e2 3	docs/dev/debt/libkernel.md

Auto-merging core/libs/prx/libkernel/CMakeLists.txt
Auto-merging core/libs/prx/libkernel/Socket/src/Udp.cpp
CONFLICT (content): Merge conflict in core/libs/prx/libkernel/Socket/src/Udp.cpp
Auto-merging docs/dev/debt/libkernel.md
CONFLICT (content): Merge conflict in docs/dev/debt/libkernel.md

Hosted checks:
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/40518796924/job/122239970338
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/40518796924/job/122240454110
relinker	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/40518796924/job/122240540630
relinker-asan	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/40518796924/job/122240660677
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/40518796924/job/122241780183
conventions	pass	17s	https://github.com/boykopovar/AnyPS5/actions/runs/40518795589/job/122239734762
eligibility	pass	9s	https://github.com/boykopovar/AnyPS5/actions/runs/40518796924/job/122239731863
labels	pass	7s	https://github.com/boykopovar/AnyPS5/actions/runs/40518795489/job/122239863391
report	pass	50s	https://github.com/boykopovar/AnyPS5/actions/runs/40518796875/job/122239731403
windows	pass	5m1s	https://github.com/boykopovar/AnyPS5/actions/runs/40518796924/job/122239851399

Negative control

Assertion Change Result
The follow-up composes with its prerequisite branch Compared the current #11896 and #12682 heads using git merge-tree This integration assertion fails: conflicts remain in Udp.cpp and docs/dev/debt/libkernel.md

Findings

Blocking

  • The checklist still says Depends on: #11872, but #11872 closed at 01:56Z with its author stating that #12682 supersedes it. The current #12682 head is open and is the replacement for the cancellation layer this follow-up said it needed. I also checked the two current heads together: they conflict in Udp.cpp and docs/dev/debt/libkernel.md. Please update the dependency to #12682 and coordinate the follow-up order against that replacement; after it lands, rebase this PR and rerun the focused wait-all tests.

Non-blocking

The PR's merge preview against current main is clean, and its current hosted Windows check passes. Those checks do not resolve the stale dependency or the pairwise conflict with the replacement PR.

Sources

Not verified

I did not rerun guest_socket_wait_all_tests locally or test Linux/macOS runtime behavior. The PR's Windows check passed, but the hosted Linux and specialized jobs were skipped.

To get this to a good state

Update the dependency line to #12682 and coordinate the rebase after that replacement is ready. Then rerun guest_socket_wait_all_tests on the resulting exact head; I will repeat the merge, diff, conventions, and test checks there.

@MarcZX10

Copy link
Copy Markdown
Contributor

Re-checked — new head, source link corrected

The closure-note URL in my review was mistyped, and I removed the template-file link because the dependency declaration is in the PR description.

Sources

@Felipebmaitan

Copy link
Copy Markdown
Contributor

Dependency/order tracker update: the read work formerly in #11872 is now #12682; transport is separately published as #12688; writes formerly in #11969 are now #12700. The old two PRs are closed as superseded with their original branches and review history preserved. The previously requested integration seams/order remain in the tracker: #11872 (comment). Historical confirmations refer to the old read ID; no new author agreement or combined runtime validation is implied. Please confirm the corresponding order for this PR using the replacement IDs. No source changes to this PR are made here.

@MarcZX10

MarcZX10 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Re-checked — dependency order clarified

The prior agreement was #11872 first, then #11896; its replacement for the read/cancellation prerequisite is #12682. This confirms that predecessor only and does not establish the combined result with the newer transport/write stack.

What I ran

Environment: Linux 6.1.0-54-amd64 x86_64, GitHub CLI 2.23.0; no compiler or tests were run.

gh pr view 11896 --json headRefOid,baseRefName,state
gh pr diff 11896 --name-only
gh pr view 12682 --json headRefOid,baseRefName,state
gh pr diff 12682 --name-only
gh pr view 12688 --json headRefOid,baseRefName,state
gh pr diff 12688 --name-only
gh pr view 12700 --json headRefOid,baseRefName,state
gh pr diff 12700 --name-only

Results

Check Result
PR #11896 head Open, based on main, head ef5ae8ee9074486c4715f8b10c75ffdb87c735cf
Replacement heads #12682 3b0d2c6feb8bc25ff5b5ebec8784e03fad507a69; #12688 7b3caa041c14768910e5eba81baca4d2e0495b7b; #12700 7a2c024aca0d8baef8a42a885fef268d63fdf77c
Shared file #11896 and all three replacement diffs include core/libs/prx/libkernel/Socket/src/Udp.cpp
Unedited changed-file output relevant to the overlap
PR 11896:
core/libs/prx/libkernel/Socket/src/Udp.cpp

PR 12682:
core/libs/prx/libkernel/Socket/src/Udp.cpp

PR 12688:
core/libs/prx/libkernel/Socket/src/Udp.cpp

PR 12700:
core/libs/prx/libkernel/Socket/src/Udp.cpp

Negative control

Not applicable: this was an ordering check; no code or test assertion was changed or exercised.

Findings

Blocking

The current #11896 description still says Depends on: #11872, which is closed as superseded. Please update it to #12682. In addition, all three replacement diffs touch Udp.cpp; after the dependency is integrated, compare the exact resulting heads, resolve any overlap, and rerun the focused wait-all tests before requesting another review.

Non-blocking

The old author confirmation establishes #11872 first only. It does not establish author agreement or runtime validation for the replacement transport/write heads.

Sources

Not verified

I did not run pairwise merge previews or the socket tests, and no combined runtime behavior is verified here.

To get this to a good state

Update the dependency to #12682. Rebase and resolve the overlapping Udp.cpp changes after the relevant replacement layers settle, then rerun guest_socket_wait_all and request review on the exact integrated head.

@ionut27001

Copy link
Copy Markdown
Contributor Author

@MarcZX10 @Felipebmaitan @adriadam10 Confirmed with the new IDs: #12682 lands first. This PR then rebases onto it, waits for the rest of a MSG_WAITALL receive through its cancellation, signal and close handling, and adds the regression that cancels, signals and closes after the first partial bytes. The Depends on line now names #12682.

#12688 and #12700 also change Udp.cpp. I'll rebase onto whichever of them have landed by then, compare the resulting head and rerun guest_socket_wait_all before asking for another review.

@adriadam10 adriadam10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still blocked on the same point, and it can't be fixed from this branch until the prerequisite lands:

  • core/libs/prx/libkernel/Socket/src/Udp.cpp:772 WaitReady calls poll/WSAPoll directly and Receive (Udp.cpp:844) loops on it after the first bytes, so that wait can't be cancelled, interrupted by a signal or woken by close.
  • Order as agreed: #12682 merges first; then rebase, route the wait for the rest through its cancellation/signal/close handling, and add the regression that cancels, signals and closes during a MSG_WAITALL receive after the first partial bytes (partial count still returned). Rebase onto #12688/#12700 as well if they land first.

The rest (flag handling, MSG_PEEK | MSG_WAITALL throw, debt entry, test registration) looks fine as is.

@Gruzzberry

Copy link
Copy Markdown
Contributor

Gruzzberry's #13756 (sendto/recvfrom EFAULT) edits nearby lines in Udp.cpp. Yours was opened first, so proposing yours goes first and #13756 rebases. Shout if you would rather swap.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build docs libkernel needs rebase Conflicts with main, rebase needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants