fix(libSceNpCppWebApi): answer finish, abort and getId for never-started transactions as the module does #11235
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11235"
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 AlexFigas on 2026-10-25T22:26:03Z.
What
AnyPS5 never starts an NpCppWebApi transaction:
startand the API calls fail withSCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN. ThelibSceNpCppWebApi.prxbundled with PPSA21564 (sce_module/, the library's own code) shows what a transaction in that state answers:Transaction<...>(17 instantiations, e.g. 0x3d07f0 and 0x372bb0) isvxorps xmm0, xmm0, xmm0; vmovups [rdi], xmm0; ret, which zeroes the two words at +0 and +8.start(e.g. 0x3cfcd0) is the only function that sets them, and only on success.ret.TransactionBase::finishin all 18 instantiations starts withcmp qword ptr [rdi + 8], 0/cmp qword ptr [rdi], 0. When either word is zero it returns0x80553508.TransactionBase::abort(0xd80, 0x3c0320, 0x3bbc20, 0x3c14e0, 0x3bcde0, 0x3b98a0) makes the same checks and returns0x80553508.TransactionBase::getId(0x12f0, 0x3c05e0, 0x3bbee0, 0x3bd0a0, 0x3b9b60) makes the same checks and returns 0. The result is 64-bit (rax).This PR changes these exports:
Vector<IntrusivePtr<InGameCatalog::V5::Container>>andTitleCloudStorage::V1::GetMultiDataStatusesResponseBody. These threw before. The constructor now zeroes the first 0x10 bytes, and the destructor does nothing, as in the module.abort(6 instantiations) andgetId(5). These threw before. They now return0x80553508and 0.getIdis declaredstd::int64_t.finish(18 instantiations). The two that threw and the 16 that returned 0 now return0x80553508. A transaction never starts here, so a successfulfinishwas a made-up result. Thefinishoverrides ofDownStreamTransactionjump to a shared body and are not changed.The debt entries now list only the
DownStreamTransactionfinishoverrides as silent stubs, and no longer listabort/getIdas throwing.Tested
On Ubuntu 24.04 under WSL2 (GCC 13.3, Release), rebased onto
main74acfad65b,ctest --test-dir build -R np_cpp_web_apipasses all 4 tests, 3 runs each.guest_np_cpp_web_api_signed_outnow expects0x80553508fromfinishin the existing request flows. It also checks:finishand the sixaborts return0x80553508;getIds return 0.Also run:
python3 tools/check_conventions.py --base origin/mainpasses.python3 core/libs/tests/test_public_headers.py --audit-onlyverifies 368 libraries and 12368 exports.python3 tools/pr_overlap.py --branch feat/npcppwebapi-never-started-transactionsreports no overlap. #9015, which inserted a debt line after line 20, the line this PR edits, merged first, and this branch is rebased onto it keeping both lines; #10832 was closed.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T22:30:22Z.
Review: APPROVED
Reviewed exact head
3e333ce0fc5dd45de42f49cd064a0d21a315054c. The recorded bundled-module behavior is internally consistent: a never-started transaction has two zero words, andfinish/abortreturn0x80553508whilegetIdreturns zero. The implementation replaces the prior success/throwing behavior accordingly, and the test checks both newly implemented constructor layouts, all listed abort/getId instantiations, and signed-out request flows. Current-main conventions and diff-check pass; hosted product tests were skipped by path policy, and I did not rerun the author-reported WSLguest_np_cpp_web_apisuite locally.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T06:40:43Z.
Review: CHANGES_REQUESTED
The code review remains sound, but the current overlap report flags this PR’s
docs/dev/debt/libSceNpCppWebApi.mdedits against both open #9015 and #10832. CONTRIBUTING.md requires the authors to agree on merge order and declare the prerequisite withDepends on; the checklist currently saysDepends on: none. Please coordinate with both authors, update that checklist line to the agreed order, and refresh the debt-file merge if either must land first. The two production code files have no stated overlap finding. Current hosted eligibility/intake/conventions/labels/report checks pass; product jobs are skipped by path policy. I did not rerun the author-reported WSL test suite.