fix(libSceNpManager): refuse to poll or wait on a synchronous request #28776
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/28776"
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 NobleBrains on 2026-12-03T14:32:41Z.
What
sceNpPollAsyncandsceNpWaitAsynctreated a request fromsceNpCreateRequestlike an async one: they returned 0 and wroteSCE_NP_ERROR_SIGNED_OUTto*result. Firmware 13.42 returnsSCE_NP_ERROR_INVALID_ID(0x80550015) for a synchronous request and leaves*resultuntouched (run in an emulator, not on a console).Live requests now remember whether they were created as synchronous or async, and both functions refuse the synchronous ones. Async requests behave as before.
This is one part of #9277. The library initialization check (
0x80550002), the SDK-dependent pending and blocking answers for async requests that were never given work, and requests with work in flight are not changed here.Tested
The tests ran on
f7b732db37, before the latest merge ofmain.mainhas not changed libSceNpManager orGuestNpManager.cppsince then.guest_np_managerandguest_np_reachabilitypass (2/2).guest_np_managernow covers poll and wait on a synchronous request, also after abort and delete, and an id reused as the other kind.main6f6f6c8e6bwith this change and the open macOS build fixes #27201, #27739, #27843, #27767, #17425 and #27827.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)🤖 Generated with Claude Code
https://claude.ai/code/session_01GtiotZ92uvDBp76KjCvueG
Summary by CodeRabbit
Bug Fixes
Documentation
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T14:39:52Z.
Review: APPROVED
Reviewed — looks good
The request kind is retained for each live ID, and polling or waiting on a synchronous request returns
INVALID_IDwithout writing the result.What I ran
Reviewed head
b97b3ff5bf7416e3f5b421493208aff2008b4fe7using the prepared file snapshots in the Linux container. The pinned reader could not run because it attempted to append to a read-only log. I inspected the changed lines and relevant request lifecycle context in all three changed files;files.jsonlists three reviewed files and no exclusions.Results
Negative control
Not run; no test execution was performed during this review.
Findings
Blocking
None.
Non-blocking
None.
Sources
The request map records each ID's kind when created, and both API functions check that kind before writing the result: Export.cpp at the reviewed head, request creation, and poll and wait.
Not verified
Tests were not run independently. Windows behavior and title compatibility were not verified. The firmware behavior cited in the description is author-reported emulator evidence, not a console measurement.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T14:43:49Z.
Review: COMMENTED
Built and ran
guest_np_managerandguest_np_reachabilityon Linux with this head integrated. Both passed. The new cases check that polling or waiting on a synchronous request leaves the result untouched, that deletion changes the answer toREQUEST_NOT_FOUND, and that a reused ID takes the kind recorded for its new request.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-04T12:50:41Z.
Review: APPROVED
Verified on Windows 11 with WinLibs GCC 15.2.0 r7 (Release). I used a tree at
main63b98e5bf8(plus two unrelated commits of mine in libc and a LibreSSL test), with this PR applied together with #28881, #28810, #28806, #28776 and #28781, which touch separate files. I ran everystrict_nid_filter,guest_audiodec*,guest_np_manager*,guest_np_reachabilityand HarfBuzz test (31): all pass before the change, and all pass in 3 of 3 runs with it.That fills the "Windows: not run" gap. Negative control, with
libSceNpManager/Export.cppas onmainand the new test kept:guest_np_manageraborts with "NpManager: poll must reject a sync request with InvalidId".guest_np_reachabilitypasses before and after.Not verified: the firmware 13.42 answer itself, which the description says was observed in an emulator, not on a console.
AI-assisted: yes (Claude Code)
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.