fix(libSceNet): print the console's line for a negative sceNetUsleep #10572
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10572"
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 ZSWolt on 2026-10-24T10:31:08Z.
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; #6044 was closed without merging)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T10:34:57Z.
Review: APPROVED
Reviewed the implementation and regression diff. The new diagnostic is emitted only after the existing
g_net_initedguard and only for negative signedintinputs; it then preserves the existingEINVALreturn 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.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T10:43:58Z.
Review: APPROVED
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
EINVALresult. The focused test asserts no output for zero, exact signed output for-1andINT32_MIN, and errno preservation. The PR reports the WSL full-suite result with its unrelated/dev/udmabuffailure identified, plus conventions passing. Hosted eligibility, conventions, intake, labels and report checks pass; the build matrix was skipped by workflow selection.git diff --checkon the PR head is clean. I approve.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T11:27:36Z.
Review: CHANGES_REQUESTED
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 editssceNetUsleepor its newCheckUsleepassertions. However, #6044 renamescore/libs/tests/GuestSceNet.cpptocore/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.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T14:01:47Z.
Review: CHANGES_REQUESTED
Follow-up on exact head
412c3cd91f3aa7563417fc512813527cb3535646: the prior #6044 blocker is cleared because #6044 is closed without merging and this PR now recordsDepends on: none.A new overlap with open #10628 needs coordination before merge. I confirmed with
git merge-treethat the current heads conflict indocs/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.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T14:12:40Z.
Review: APPROVED
Follow-up on exact head
412c3cd91f3aa7563417fc512813527cb3535646. The overlap with #10628 is now explicitly ordered: #10572 lands first and #10628 declaresDepends on: #10572and will rebase to retain both debt entries. #6044 remains closed without merging, so it creates no dependency. My prior review of the implementation andCheckUsleepregression still applies; the author reports the focused checks and WSL full suite, with the unrelated/dev/udmabuffailure identified. Hosted eligibility/conventions/intake/labels/report pass; platform builds were skipped. The PR is ready for maintainer review.