fix(libkernel): report EPIPE for a stream send on a connection the peer closed on Windows #8670
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8670"
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-20T20:36:51Z.
What
sosend_generic(uipc_socket.c#L1260-L1264) fails a send on a socket that can send no more withEPIPEbefore it looks atso_error. Winsock reports the same send asWSAECONNABORTEDorWSAECONNRESET, whichsend,sendtoandwritepassed on asECONNABORTEDorECONNRESET.SendErrornow maps both toEPIPEfor a stream socket. The send-after-close checks ofguest_tcp,guest_socket_read_writeandguest_socket_pair, which only ran on Linux, now run on Windows too (the pair test sends until the first failure, because the first send after the peer's close still succeeds on the loopback connection; the Technical debt entry says so).Fixes #8669
Overlap:
git merge-treehas one conflict each with #8483 (both edit the socketpair entry indocs/dev/debt/libkernel.md) and #7850 (open); the other open socket PRs (#8499, #8492, #8474, #8463, #8448, #7090, #7511, #7490) are clean. Whichever lands second rebases.pr_overlapwas not run.Tested
Windows 10 (19045), MinGW-w64 GCC 15.2.0, Release, on current upstream/main + this commit:
guest_socket_read_writeandguest_socket_pairfail without the change toUdp.cpp(exit 0xc0000409) and pass with it;guest_tcppasses either way.guest_sce_net,guest_socket_error,guest_udp,guest_pollandguest_recvmsg_memorypass.python tools/check_conventions.py --base upstream/main: 0 errors, 1 warning (debt-length, the edited socketpair entry was already over 1000 characters).Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryAI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T20:41:58Z.
Review: APPROVED
Reviewed the Windows-specific mapping and regressions.
SendErrorapplies theWSAECONNABORTED/WSAECONNRESETtoEPIPEtranslation only for guest stream sockets; the existing datagram andWSAENOTCONNpaths are unchanged. The socket, read/write and socket-pair tests now exercise the close/send behavior on Windows, including the documented first-send success on the loopback pair. The author reports a Windows negative control and passing focused socket tests; hosted Windows CI is skipped, so I am relying on that reported platform run rather than claiming independent Windows validation. I found no blocking issue in the diff.Imported from boykopovar/AnyPS5. Originally posted by cadenasynyster on 2026-10-20T22:00:35Z.
Independent Windows run of this PR. The review notes that hosted Windows CI is skipped, so this adds a second host.
Environment: Windows 11 10.0.26300, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7 UCRT, Release, BUILD_TESTING=ON. I built only the three affected test targets.
Results:
guest_socket_read_write,guest_tcpandguest_socket_pairall pass.core/libs/prx/libkernel/Socket/src/Udp.cppwith its base version, then rebuilt.guest_socket_read_writeandguest_socket_pairfail with exit 0xc0000409, andguest_tcppasses. This matches the description. I restored the PR'sUdp.cppafterwards.Not run: other platforms, the other socket tests listed in the description, the full repository CTest, and any title or console run.
AI-assisted: yes