libkernel: the first stream send after a socketpair peer closed succeeds and a datagram recv reports ECONNRESET on Windows #15661
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 Opensource55 on 2026-11-04T00:50:49Z.
What happens
After the peer of a guest
socketpaircloses on a Windows host, the first streamsendsucceeds where the console returnsEPIPE(32), and a datagramrecvwith an empty queue reportsECONNRESETwhere the console reportsENOTCONN(57); both deviations are documented in the socketpair entry ofdocs/dev/debt/libkernel.md.Title, test or build step
guest_socket_pair (ctest #3552) on Windows; no title is known to reach this; the gap is recorded in docs/dev/debt/libkernel.md (socketpair entry)
AnyPS5 commit
main
4f41f4c375System
Windows 10 Pro for Workstations 22H2 (10.0.19045.6456), MinGW-W64 GCC 15.2.0 (UCRT, Release build), AMD Ryzen 9 5950X; no GPU involved
Host report
Steps to reproduce
On a Windows build of main
4f41f4c375(host-layer test, no title involved):GuestSocketPair.cppadds the two cases: close one end of a stream pair, thensendonce from the other end with the no-signal flag; close one end of a datagram pair, thenrecvfrom the other end with nothing queued.git checkout 4f41f4c375 -- core/libs/prx/libkernel/Socket/src/Udp.cpp && ninja -C build guest_socket_pair_testsbuild\tests\guest_socket_pair_tests.exeaborts at the first-send assertion (Require(send_nid_postfix(...) == -1 && *__error_nid_postfix() == 32)), exit via SIGABRT.Udp.cpp, rebuild, run: rc 0 on three consecutive runs;ctest -R socketpasses 30 of 30 in 6.7 s.Log
What was checked
sys/kern/uipc_usrreq.c:uipc_detachcallsunp_disconnect, whoseSOCK_STREAMbranch callssoisdisconnectedon both ends, sososend_genericanswersEPIPE; theSOCK_DGRAMbranch clears only the closing end's state and sets no error on the survivor (unp_dropwithECONNRESETis theuipc_abortpath). The console'sENOTCONNfor the datagram receive is the behavior documented indocs/dev/debt/libkernel.md, so the receive fix is Windows-gated and the POSIX hosts keep their native answers.Fixes:at this issue once it is confirmed): https://github.com/Opensource55/AnyPS5/tree/fix/socketpair-close-semantics