fix(net): report EPIPE for a send after shutdown on Windows #1786
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1786"
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 Zurisen on 2026-10-08T19:10:04Z.
What
Fixes #1785. Both Windows error maps, libkernel
NativeErrorand libSceNetnative_error, translateWSAESHUTDOWNto 32 (EPIPE), as FreeBSDsend(2)reports and as the Linux maps already do for the host'sEPIPE. A send, sendto or sendmsg on a socket shut down for writing now fails withEPIPEinstead ofEIO.Winsock also returns
WSAESHUTDOWNfromrecvaftershutdown(SD_RECEIVE), where FreeBSD returns 0. That case reportedEIObefore and reportsEPIPEnow; returning 0 there is a change to the receive paths and is left for a separate pull request.Tested
Windows 11 (10.0.26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, RTX 4070 Laptop:
guest_tcp: after the loopback exchange,shutdown_nid_postfix(client, 1)andsend_nid_postfix(client, ...)fails with errno 32.guest_sce_net:sceNetShutdown(accepted, 1)andsceNetSend(accepted, ...)fails with0x80410120and errno 32. It runs on the accepted socket so that the client's later sends still fail through the reset from #2295, not throughEPIPE.ctestwithANYPS5_REQUIRE_VULKAN=1 --repeat until-fail:3: 557/559 passed ona291ae0f. Both failures also fail on main locally:pr_overlap_encodingpatchessubprocess._text_encoding, which Python 3.10 does not have, andpatched_librariescannot loadlibSceVideoOut.prx, whose NID patching fails on main (#2462).EPIPE, and the sends useMSG_NOSIGNALas the existing cases do.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-08T21:33:38Z.
Update after checking the latest state: Build (Linux and Windows), Conventions, and Progress report have all passed on this head. The overlap warning for #2001 no longer applies; a collaborator closed that broad cleanup PR.\n\nOne contribution-rule follow-up remains: this PR base is
b858fdc48e29c3ab7476782199d8a41999d46d59, while current upstreammainis6cc0503dacc9d9697d23001d4103780ad2e9acba. Please rebase onto currentmainand rerun checks on the updated head before merge.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T09:14:58Z.
Update to my earlier contribution-rule note: upstream
mainhas since advanced tod9484c719b2a5ac6201e27f8657e0fb0f01e648c, while this PR remains based onb858fdc48e29c3ab7476782199d8a41999d46d59. The Linux, Windows, Conventions and Progress checks on the current head pass, but please rebase onto currentmainand rerun them before merge. The merged #2113 policy means the full Build results here were collaborator-triggered; after a rebase, request another full run from a collaborator if needed.Imported from boykopovar/AnyPS5. Originally posted by Zurisen on 2026-10-09T16:22:19Z.
Rebased onto
d70b8998; 506/507 pass locally on Windows (pr_overlap_encodingalso fails on main with Python 3.10). The new head needs a full Build run.Imported from boykopovar/AnyPS5. Originally posted by Zurisen on 2026-10-10T00:10:08Z.
Rebased onto
a291ae0fto resolve the conflict with #2295 inGuestSceNet.cpp. #2295 sends unread data to the accepted socket so that closing it resets the connection and the client's later sends fail at once. A shutdown on the client would make those sends fail withEPIPEinstead, so the shutdown check now runs on the accepted socket:sceNetShutdown(accepted, 1), thensceNetSend(accepted, ...)fails with errno 32. Without the libSceNet change that check fails; with it,guest_sce_netandguest_tcppass.Full suite locally on Windows: 557/559. The two failures also fail on main here:
pr_overlap_encoding(Python 3.10) andpatched_libraries, which cannot loadlibSceVideoOut.prxbecause of #2462.