Repository navigation
fix(libkernel): accept MSG_NOSIGNAL in send and sendto - #1279
Conversation
|
Linux run, since the description says it wasn't tested there (Ubuntu 24.04, GCC 14.2, this commit applied to current The PR's own tests: The Linux-specific part is what --- a/core/libs/prx/libkernel/Socket/src/Udp.cpp
+++ b/core/libs/prx/libkernel/Socket/src/Udp.cpp
@@ int NativeError() {
case EINVAL: return 22;
+ case EPIPE: return 32;
default: return 5;
--- a/core/libs/tests/GuestTcp.cpp
+++ b/core/libs/tests/GuestTcp.cpp
@@
Require(close_nid_postfix(accepted) == 0);
+#ifndef _WIN32
+ std::int64_t sent = 0;
+ for (int i = 0; i < 100 && sent >= 0; ++i) sent = send_nid_postfix(client, request, sizeof(request), 0x20000);
+ Require(sent == -1 && *__error_nid_postfix() == 32);
+#endif
Require(close_nid_postfix(client) == 0);
The last row shows the AI-assisted: yes (Claude Code). |
send, sendto and sendmsg rejected every flag with EOPNOTSUPP, so callers that pass FreeBSD's MSG_NOSIGNAL (0x20000) could not send at all. Accept it: Windows sockets never raise SIGPIPE, and on Linux it maps to the native MSG_NOSIGNAL. Other flags still fail with EOPNOTSUPP. DOOM (PPSA99666) sends its upload server replies with MSG_NOSIGNAL and closed every connection without an answer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a closed peer Case and test by hikazey in the PR thread. Co-authored-by: hikazey <hikazey@users.noreply.github.com> Co-Authored-By: Claude <noreply@anthropic.com>
|
Checked: build + full ctest (439/439) on current main, Added as our own commit, taken from hikazey's comment (Co-authored-by):
Merging once CI is green on the new head. |
e91e87c to
065280d
Compare
|
.hikaze for dev role in Discord |
sceNetSend and sceNetSendto rejected every flag with EOPNOTSUPP, so a caller passing FreeBSD's MSG_NOSIGNAL (0x20000) could not send at all. The guard now accepts that flag and keeps failing every other one. shadPS4 already passes 0x20000 down to sendto, and the native send already uses MSG_NOSIGNAL on Linux, so widening the guard is enough. The libkernel send and sendto got the same fix in boykopovar#1279.
sceNetSend and sceNetSendto rejected every flag with EOPNOTSUPP, so a caller passing FreeBSD's MSG_NOSIGNAL (0x20000) could not send at all. The guard now accepts that flag and keeps failing every other one. shadPS4 already passes 0x20000 down to sendto, and the native send already uses MSG_NOSIGNAL on Linux, so widening the guard is enough. The libkernel send and sendto got the same fix in boykopovar#1279.
sceNetSend and sceNetSendto rejected every flag with EOPNOTSUPP, so a caller passing FreeBSD's MSG_NOSIGNAL (0x20000) could not send at all. The guard now accepts that flag and keeps failing every other one. shadPS4 already passes 0x20000 down to sendto, and the native send already uses MSG_NOSIGNAL on Linux, so widening the guard is enough. The libkernel send and sendto got the same fix in boykopovar#1279.
What
send,sendtoandsendmsg(which forwards tosendto) failed every call with a nonzeroflagswithEOPNOTSUPP. FreeBSD code commonly passesMSG_NOSIGNAL(0x20000) to avoidSIGPIPEon a closed connection, so such callers could not send at all.MSG_NOSIGNALis accepted. Windows sockets never raiseSIGPIPE, so nothing is passed there; on Linux it maps to the nativeMSG_NOSIGNAL.EOPNOTSUPP, as before.guest_tcp:sendwithMSG_OOB(0x1) still fails withEOPNOTSUPP;sendwithMSG_NOSIGNALsucceeds and the data arrives.guest_udp:sendtowithMSG_NOSIGNALsucceeds. Both tests fail without the change.Tested
Windows 11 Pro (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, NVIDIA GeForce RTX 5070 Ti.
guest_tcp,guest_udp,guest_sce_net,guest_addressespass; all 403 registered tests pass on currentmainwith this,polland perf(recompiler): loop the BDA byte stores and written-page probes #1265 applied (run from the generatedCTestTestfile.cmakecommands, as antivirus blocksctest.exehere).MSG_NOSIGNAL. Without this, every connection was closed without an answer (curl: empty reply). With it, pluspolland the same change as fix(libkernel): accept guest socket addresses whatever their sa_len #1088, the server answeredGET /(HTTP 200) and received a 28.8 MB WAD throughPUT /upload/...; the saved file matches the source's SHA-256.Not tested on Linux.
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)🤖 Generated with Claude Code