Repository navigation
fix(libkernel): report EPIPE for a stream send on a connection the peer closed on Windows - #8670
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed the Windows-specific mapping and regressions. SendError applies the WSAECONNABORTED/WSAECONNRESET to EPIPE translation only for guest stream sockets; the existing datagram and WSAENOTCONN paths 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.
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
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.
|
|
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:
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 |
9b5d1fb to
03fd0d9
Compare
…er closed on Windows sosend_generic fails a send on a socket that can send no more with EPIPE before it looks at so_error. Winsock reports the same send as WSAECONNABORTED or WSAECONNRESET, which reached the guest as ECONNABORTED or ECONNRESET. A stream send now maps both to EPIPE. The send-after-close checks of guest_tcp, guest_socket_read_write and guest_socket_pair run on Windows too. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
03fd0d9 to
ff2b4ba
Compare
|
Rebased onto |
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