libkernel: recv, recvfrom and recvmsg fail MSG_WAITALL with EOPNOTSUPP where FreeBSD 11.4 waits for the whole request #8473
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-20T13:16:56Z.
Repro
Windows host. A connected stream socket with 4 bytes queued and 4 more arriving 150 ms later:
recv(s, buf, 8, 0x40).Expected (FreeBSD 11.4): returns 8 once the buffer is full (
soreceive_generickeeps waiting whileMSG_WAITALLis set anduio_resid > 0, uipc_socket.c:1855-1860;MSG_WAITALLis 0x40, sys/sys/socket.h:433); returns the bytes received when the peer closes first.Actual: -1 with EOPNOTSUPP (45):
recv_nid_postfix,recvfrom_nid_postfixandrecvmsg_nid_postfixaccept onlyMSG_PEEKandMSG_DONTWAIT.Test:
core/libs/tests/GuestTcp.cpp(WaitAllReceivesTheWholeRequest, new; aborts before the fix).Fix branch: https://github.com/xXPBSXx/AnyPS5/tree/fix/recv-msg-waitall
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by Filip722 on 2026-10-21T09:45:53Z.
Confirmed on Linux: the
MSG_WAITALLrejection is shared, includingrecvmsg(listed as untested in #8474).Tested unchanged upstream
mainb5d763770a8e932b35db9bea1c415e7e0ac50a22in a separate validation checkout. Environment: Debian GNU/Linux 13.7 (trixie), x86-64, kernel7.2.9-x64v3-xanmod1, AMD Ryzen 5 7640HS, GCC/G++ 15.2.0, CMake 3.31.6/Ninja. Full project configuration:Release,BUILD_TESTING=ON,ANYPS5_RELINKER_ONLY=OFF,ANYPS5_USE_SYSTEM_DEPS=OFF; rebuiltlibc,libkernelandlibkernel_sys. Temporary probes linked directly to these freshly built, unpatched runtime libraries, as the repository runtime tests do. No production source changes.Reproduction: created a real IPv4 TCP pair over
127.0.0.1using the guest socket APIs, sent"abcd", scheduled"efgh"150 ms later, then requested 8 bytes with guest flag0x40. Ran each API in a fresh process;recvmsgused the existing tests' 48-byte guestmsghdrlayout and one 8-byte iovec.0x40recv_nid_postfixEOPNOTSUPP), immediatelyabcdefghrecvfrom_nid_postfixabcdefghrecvmsg_nid_postfixabcdefghControl: the same three probes with flags
0each returned 4 bytes (abcd); after joining the sender the remaining 4 bytes wereefgh. Thus the connected transport works and the rejected calls did not consume the data. This exercises the real guest flag check inSocket/src/Udp.cpp, whereGuestReceiveFlagscurrently contains onlyGuestPeek | GuestDontWait.Existing
guest_tcp,guest_socket_pairandguest_recvmsg_memoryalso pass on this build; those passes do not cover acceptance of0x40.Scope: reproduces the defect on unchanged main; I did not apply/test #8474. Blocking IPv4 loopback only; no nonblocking/peek combinations, console, Windows, GPU or title execution tested.
AI-assisted: yes (Codex); I am responsible for the reported investigation and results.