Repository navigation
fix(libSceNet): wake UDP receives on abort and close - #24065
Romannachwievor wants to merge 1 commit into
Conversation
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 369900d7ba:
- Conventions:
tools/check_conventions.pypassed. - Build:
guest_sce_net_testsbuilt cleanly. - CTest (
guest_sce_net,guest_net_inet_pton_source_faults):1/2 Test #4874: guest_net_inet_pton_source_faults ... Passed 0.01 sec 2/2 Test #4873: guest_sce_net ....................... Passed 1.68 sec 100% tests passed, 0 tests failed out of 2 - Negative control: with
core/libs/prx/libSceNet/Export.cppreverted tomainand the new tests kept, the suite fails:Restoring the change makes it pass again.1/2 Test #4874: guest_net_inet_pton_source_faults ... Passed 0.01 sec 2/2 Test #4873: guest_sce_net ....................... Passed 1.67 sec 100% tests passed, 0 tests failed out of 2 - Code reading:
- Verified ShutdownSocket_nid_no_patch handles null native pointer safely and executes proper shutdown sequences across Windows, Linux, and macOS platforms.
- Verified macOS ENOTCONN fallback logic correctly inspects sockaddr_storage address family (AF_INET and AF_INET6) and rewrites unspecified/ANY addresses to loopback before connect and shutdown.
- Verified lock scoping in sceNetSocketClose and sceNetSocketAbort: g_mutex is held during lookup and extraction of native and type, and released prior to calling ShutdownSocket_nid_no_patch and g_cv.NotifyAll() to avoid lock inversion.
- Verified AGENTS.md compliance: no unauthorized comments added, debt fragment correctly formatted in docs/dev/debt/changes/fix-net-abort-unconnected-udp-macos.md, and Conventional Commits followed.
- Verified test coverage in GuestSceNet.cpp covering bound and unbound datagram socket abort/close behaviors across IPv4 and IPv6 families without regressing Linux or Windows behavior.
Looks Good To Me
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
Nothing in the inspected change shows a verified blocking defect; the change remains incompletely verified because no checks were run in this review.
What I ran
Reviewed head 369900d7ba4e9f33184ae2dd4674bdeae32d7523 using the prepared diff and pinned reader. No build or tests were run. Files read: review/description.md, review/commits.md, review/manifest.json, review/diff.patch, core/libs/prx/libSceNet/Export.cpp (lines 260–320, 1388–1440, 1770–1825), core/libs/tests/GuestSceNet.cpp (lines 760–845, 2960–2990), and docs/dev/debt/changes/fix-net-abort-unconnected-udp-macos.md. The change’s complete text was included for all three changed files; no changed files were excluded in manifest.json. review/files.json was not available through the reader.
Results
| Check | Result | Note |
|---|---|---|
| Source review | passed | Targeted changes and callers inspected |
| Build and tests | not run | Author-reported runs are not independent verification |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The macOS and Windows runtime behavior, Linux behavior, and the author-reported test results were not independently verified. The full source text for each changed file was available, but only the targeted ranges above were read. The excluded-file listing was unavailable.
To get this to a good state
Nothing is required.
|
Linux run, since the description says the Linux attempt stopped before reaching the tests. Linux x86-64, GCC, head
So on Linux the reworked test passes with and without the change and nothing regresses. The TSan report is the same on both sides, the This says nothing about the fix itself, which is under AI-assisted: yes |
|
Tested
AI-assisted: yes (Claude Code); the runs are automated, this summary was written from their reports. |
|
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.
|
|
@oneandonlydean, the AI-assisted: yes (Claude Code) |
|
Windows run of 369900d merged onto main 2b0d3ee: Thread contextThe fix itself is under Measured (Windows, merge onto main)
Line 810 of
Inferred / suggestions
Existing runs
Host
AI-assisted: yes |
ligmaSec
left a comment
There was a problem hiding this comment.
Built and ran guest_sce_net on Linux with this head integrated. It passed, including the blocked UDP receive cases that are woken by abort and by socket close.
AI-assisted: yes.
What
On macOS, wake blocked UDP receives when an unconnected socket is aborted or closed. The native shutdown fallback connects the datagram socket to loopback before shutting it down.
Tested
guest_sce_net_tests --unbound-datagram-receivepassed three times on the change, covering IPv4/IPv6, bound/unbound sockets, Abort/Close. Without the helper, the bound receive remained blocked. Fullguest_sce_netstill fails atCheckConnectTimeoutExpiry(errno 61).userfaultfd failed (Operation not permitted)andrecvmsg: process_vm_readv failed with errno 38; the fix was not reached.build-full, maina4d1053d4b+ fix(libcurl): build the curl backend for the macOS target architecture #17425 + build(audio): link one SDL copy on macOS #11049, without this change): fullguest_sce_netfails at the same place (line 1241,connect timeout expiry: no connect stayed pending, errno 61). That is the known macOS backlog issue macOS: a listen backlog of 0 does not bound the pending accept queue, so guest_sce_net's connect-expiry case cannot pass #22443 (PR fix(libSceNet): model the guest listen queue past its backlog on macOS #22623), not this change. The Linux code path is unchanged: the extra connect and shutdown run only under__APPLE__.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)