fix(libSceNpUniversalDataSystem): fail a repeated Initialize as the 13.42 module does #21983
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/21983"
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 brajankw on 2026-11-17T00:45:11Z.
What
sceNpUniversalDataSystemInitializekept no state, so a call after a successful call returned 0. The 13.42 module returns0x80553118for every call after a success, before it checks any argument (thesceNpUniversalDataSystemInitializeentry indocs/dev/debt/libSceNpUniversalDataSystem.md, from the module run in https://github.com/boykopovar/AnyPS5/pull/12803#issuecomment-6517047831). #16324 implemented the other return codes and left this one open.Initializetests a process-wide flag first and returnsSCE_NP_UNIVERSAL_DATA_SYSTEM_ERROR_ALREADY_INITIALIZED(0x80553118) when it is set, for any argument. It sets the flag only after its argument checks pass, assceNpUniversalDataSystemIntInitializealready does with its own state.sceNpUniversalDataSystemTerminateclears the flag and still returns 0, as it did onmain;sceNpUniversalDataSystemIntTerminateclears its own flag the same way. Without the clear, the new state would make everyInitializeafter aTerminatefail. The harness run did not coverTerminate, so the debt fragment now records that what it returns and whetherInitializesucceeds after it are unverified.GuestNpUniversalDataSystemQueries.cpp: after the successful call,Initializewith the valid parameters, with size0x18and withnullptreach return0x80553118; afterTerminate,Initializesucceeds once more and fails again after that.Initialize(it readsparamthroughGuestCopyIn_nid_no_patch); the two conflict textually and whichever lands second needs a rebase.Tested
Linux (Debian 13, GCC 14.2.0, Release), on
main258ab7b6bd.ctest -R '^guest_np_uds': 2/2 passed (guest_np_uds_queries,guest_np_uds_records).main'slibSceNpUniversalDataSystemsources and this branch's test,guest_np_uds_queriesfails withUDS query check failed at line 52, the first repeatedInitialize.ctest(5891 tests,-j 12) with this branch merged together with four unrelated fixes of mine: 5875 passed. The 16 failures are the set that fails onmainin the same environment: sixagc_drivercases (agc_driver_image_table_packed_guardspasses when run on its own) and ten that need a.gitdirectory, network or a passwd entry for the user.python3 tools/check_conventions.py --base origin/main: passed.python3 tools/pr_overlap.py --branch: #19606 only, the textual conflict above.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 PrivacyOnion on 2026-11-17T00:51:16Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
0c37572c31:tools/check_conventions.pypassed.guest_np_uds_queries_testsbuilt cleanly.guest_np_uds_queries):core/libs/prx/libSceNpUniversalDataSystem/src/NpUniversalDataSystem.hpp,core/libs/prx/libSceNpUniversalDataSystem/src/System.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me