Repository navigation
fix(libSceNet): print the console's line for a negative sceNetUsleep - #10572
Conversation
After sceNetInit, the console's sceNetUsleep prints "[LIBNET] usleep <count>" to standard output for a negative count before failing with EINVAL, as a payload measured on firmware 13.60 (boykopovar#9076). AnyPS5 failed without printing it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed the implementation and regression diff. The new diagnostic is emitted only after the existing g_net_inited guard and only for negative signed int inputs; it then preserves the existing EINVAL return path. The test captures stdout and checks zero, -1, and INT32_MIN, including exact signed formatting and errno. The evidence and scope are recorded in the debt entry, including the unmeasured pre-init case. GitHub eligibility, conventions, intake, labels, and report checks pass; platform build jobs were skipped by the eligibility gate. I did not rerun the contributor-reported WSL test suite locally.
|
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.
|
MarcZX10
left a comment
There was a problem hiding this comment.
The firmware capture and debt note provide a specific basis for the added negative-count log line, and the implementation preserves the existing initialization check and EINVAL result. The focused test asserts no output for zero, exact signed output for -1 and INT32_MIN, and errno preservation. The PR reports the WSL full-suite result with its unrelated /dev/udmabuf failure identified, plus conventions passing. Hosted eligibility, conventions, intake, labels and report checks pass; the build matrix was skipped by workflow selection. git diff --check on the PR head is clean. I approve.
MarcZX10
left a comment
There was a problem hiding this comment.
The negative-count behavior and captured stdout tests remain sound; the previous approvals addressed the code. I manually followed up on the new overlap report. #5836 changes socket type/options, #7201 changes macOS resolver/socket paths, #8234 changes sceNetShowIfconfigWithMemory, #9727 changes resolver/epoll argument validation, #9733 changes macOS send/receive, #10502 changes socket names/netstat, and #7511 changes kernel socket timeout cases; none edits sceNetUsleep or its new CheckUsleep assertions. However, #6044 renames core/libs/tests/GuestSceNet.cpp to core/libs/tests/networking/GuestSceNet.cpp, so this PR’s test edit needs a coordinated order to avoid being left behind during the move. Please agree on the order with #6044’s author and update the dependency/merge coordination information as needed. The author reports its focused/full tests and conventions; hosted platform builds were skipped.
|
@MarcZX10 Thanks for going through the overlap list. I've asked on #6044 (#6044 (comment)) for this PR to land before the |
|
@MarcZX10 The #6044 order is now explicit in |
MarcZX10
left a comment
There was a problem hiding this comment.
Follow-up on exact head 412c3cd91f3aa7563417fc512813527cb3535646: the prior #6044 blocker is cleared because #6044 is closed without merging and this PR now records Depends on: none.
A new overlap with open #10628 needs coordination before merge. I confirmed with git merge-tree that the current heads conflict in docs/dev/debt/libSceNet.md; the source changes are separate, but the two debt entries need to be retained together. Please agree with #10628's author which PR lands first and how the second will rebase, then record the dependency/order in the checklist as required by CONTRIBUTING. The existing code review and tests remain applicable; hosted checks are green for this PR, with product builds skipped by eligibility.
|
@MarcZX10 @maximilianfv #10628 already lists this PR in its |
MarcZX10
left a comment
There was a problem hiding this comment.
Follow-up on exact head 412c3cd91f3aa7563417fc512813527cb3535646. The overlap with #10628 is now explicitly ordered: #10572 lands first and #10628 declares Depends on: #10572 and will rebase to retain both debt entries. #6044 remains closed without merging, so it creates no dependency. My prior review of the implementation and CheckUsleep regression still applies; the author reports the focused checks and WSL full suite, with the unrelated /dev/udmabuf failure identified. Hosted eligibility/conventions/intake/labels/report pass; platform builds were skipped. The PR is ready for maintainer review.
What
After
sceNetInit, a negative count tosceNetUsleepnow prints[LIBNET] usleep <count>and a newline to standard output before it fails withEINVAL, as the console does. Main already returnedEINVALfor a negative count, but printed nothing.The evidence is the firmware 13.60 payload run from #9076, which recorded this gap in
docs/dev/debt/libSceNet.md:[LIBNET] usleep -1and[LIBNET] usleep -2147483648.0xffffffffffffffffand0xffffffff80000000, so the line prints the signed 32-bit count the call already uses.netutil_main.c) callssceNetInitbefore these cases, so the line is printed after the init check. BeforesceNetInitnothing is printed, as before; that case is unmeasured and stays in the debt entry.Tested
BUILD_TESTING=ON.CheckUsleepinguest_sce_netnow captures standard output:sceNetUsleep(0)prints nothing.sceNetUsleep(-1)andsceNetUsleep(INT32_MIN)print exactly"[LIBNET] usleep -1\n[LIBNET] usleep -2147483648\n", and still fail with errno 22.ctest: 2028/2029. The one failure,agc_driver_multisample_retirement, also fails on main under WSL, where/dev/udmabufis missing; it is unrelated to this change.tools/check_conventions.py: all checks passed.sceNetUsleep. The 30 open PRs that touchlibSceNet/Export.cppdon't add or remove any line mentioningusleeporLIBNET.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)Depends online records; test: organize library tests and label CTest suites #6044 was closed without merging)