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

Closed
ionut27001 wants to merge 1 commit from upstream-pr/11896 into main
ionut27001 commented 2026-10-27 12:09:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ionut27001 on 2026-10-27T12:09:56Z.


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 ef5ae8ee90 on main 75f3702aed:

  • 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

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #12682, which replaces #11872 (order: #12682 first; this then rebases and routes the wait for the rest through its cancellation, signal and close handling). #12688 and #12700 also change Udp.cpp; this rebases onto whichever of them land first
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5033652742 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11896). Originally posted by [ionut27001](https://github.com/ionut27001) on 2026-10-27T12:09:56Z. --- ### 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 ef5ae8ee90 on main 75f3702aed: - `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 <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #12682, which replaces #11872 (order: #12682 first; this then rebases and routes the wait for the rest through its cancellation, signal and close handling). #12688 and #12700 also change `Udp.cpp`; this rebases onto whichever of them land first - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-27 12:22:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T12:22:17Z.

Review: CHANGES_REQUESTED


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5666948139 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11896#pullrequestreview-5666948139). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T12:22:17Z. **Review:** CHANGES_REQUESTED --- 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.
adriadam10 commented 2026-10-29 01:56:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-29T01:56:58Z.

Review: CHANGES_REQUESTED


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5691960436 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11896#pullrequestreview-5691960436). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-29T01:56:58Z. **Review:** CHANGES_REQUESTED --- 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 commented 2026-10-29 02:36:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T02:36:22Z.

Review: CHANGES_REQUESTED


Re-checked — new head, changes requested

I rechecked exact head ef5ae8ee90 against current main 3a2b919816; 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5692196021 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11896#pullrequestreview-5692196021). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T02:36:22Z. **Review:** CHANGES_REQUESTED --- # Re-checked — new head, changes requested I rechecked exact head ef5ae8ee9074486c4715f8b10c75ffdb87c735cf against current main 3a2b91981651569163768854a1fcdc7193b6667b; 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. ~~~sh 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 | <details><summary>Raw output</summary> ~~~text 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 ~~~ </details> ## 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 - [#11896 Udp.cpp at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/ef5ae8ee9074486c4715f8b10c75ffdb87c735cf/core/libs/prx/libkernel/Socket/src/Udp.cpp) - [#11896 current dependency declaration](https://github.com/boykopovar/AnyPS5/blob/ef5ae8ee9074486c4715f8b10c75ffdb87c735cf/.github/pull_request_template.md) - [#11872 closure note identifying #12682 as its replacement](https://github.com/boykopovar/AnyPS5/pull/11872#issuecomment-6485783317) - [#12682 replacement head](https://github.com/boykopovar/AnyPS5/commit/3b0d2c6feb8bc25ff5b5ebec8784e03fad507a69) ## 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.
adriadam10 commented 2026-10-29 18:13:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-29T18:13:16Z.

Review: CHANGES_REQUESTED


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5702740050 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11896#pullrequestreview-5702740050). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-29T18:13:16Z. **Review:** CHANGES_REQUESTED --- 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.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!11896
No description provided.