fix(libSceNpUniversalDataSystem): fail the event and property calls before Initialize, as the 13.42 module does #22049
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22049"
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-17T03:06:37Z.
What
The event and property functions ran whether or not
sceNpUniversalDataSystemInitializehad succeeded. The 13.42 module, run in a host harness (https://github.com/boykopovar/AnyPS5/pull/12803#issuecomment-6517047831 and theEvent checksentry indocs/dev/debt/libSceNpUniversalDataSystem.md), returns0x80553117from them beforeInitialize, even for null arguments. #21983 added the initialized state this uses.0x80553117untilInitializesucceeds, and again afterTerminateclears the state.sceNpUniversalDataSystemPostEventwas not covered by that run and is unchanged.GuestNpUniversalDataSystemQueries.cpp: all 30 return0x80553117beforeInitializeand afterTerminate, without writing their outputs.Terminatecannot be destroyed until the nextInitialize, and stays allocated if there is none. The 13.42 run did not cover whatTerminatedoes to existing objects, so the debt entry records this.GuestNpTrophyData.cpp,GuestNpTrophyStats.cpp,GuestNpTrophyUnlocks.cppand the hosttests/Events.cppuse UDS events, so they initialize UDS first, as a title does;np_uds_events_testsnow also buildssrc/System.cpp, which holds that state.Tested
Linux (Debian 13, GCC 14.2.0, Release). Head
91ed23e528, rebased ontomain11c9e7764ewithout conflicts; only the debt wording changed. The runs after the first two bullets are from earlier heads.91ed23e528, merged with #22046 and #22013 ontomain11c9e7764e:ctest -R '^(guest_sysarch|guest_memory|guest_mmap_fixed_anonymous|guest_virtual_query_arguments|np_uds_events|guest_np_uds_.*|guest_np_trophy_.*)$': 16 passed, andguest_mmap_executableskipped itself (exit 77) in this environment.bddb4bb554, merged with my eight other updated branches ontomainbd9a6c00a6:ctestover the 23 tests these branches touch (guest_kernel_ioctl_fionread,guest_kernel_ioctl_device_type,guest_kernel_fcntl*,guest_kernel_app_archive_*,guest_kernel_sys_ksem,guest_kqueue,guest_equeue_events,guest_socket_events,guest_system_configuration,guest_socket_pair,guest_recvmsg_memory,guest_kernel_sys_cpuset,np_uds_events,guest_np_uds_*andguest_np_trophy_*): all pass.ctest -R '^(np_uds_events|guest_np_uds.*|guest_np_trophy_(data|stats|unlocks).*)$': 6/6 passed.main's library sources and this branch's tests,guest_np_uds_queriesfails at the first not-initialized check (line 86).ctest(5896 tests,-j 12) with this branch and my other twelve branches of this round merged ontomain521fb7fec4: 5880 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(atbddb4bb554): #23418 changesEventPropertyObject.cppnext to the check this adds, and #21557 (Event.cpp, conflicting withmain) changes the same functions' bodies to copy guest pointers safely; this adds a check at each function's start, so the conflicts are textual and whichever lands second needs a rebase. #20813 and #19606, listed before, are 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 PrivacyOnion on 2026-11-17T03:12:22Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
2369bd2fa7:tools/check_conventions.pypassed.guest_np_trophy_data_tests,guest_np_trophy_stats_tests,guest_np_trophy_unlocks_tests,guest_np_uds_queries_tests,np_uds_events_testsbuilt cleanly.np_uds_events,guest_np_trophy_unlocks,guest_np_trophy_data,guest_np_trophy_stats,guest_np_uds_queries):core/libs/prx/libSceNpUniversalDataSystem/src/Event.cpp,core/libs/prx/libSceNpUniversalDataSystem/src/EventPropertyArray.cpp,core/libs/prx/libSceNpUniversalDataSystem/src/EventPropertyObject.cpp,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
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T05:29:24Z.
Review: APPROVED
Reviewed — looks good
The reviewed change at
0ccc7258f8740a3c55b129240e0b28d28b24672dconsistently gates the event and property APIs on UDS initialization, with no verified blocking defects in the files read.What I ran
No commands were run. I inspected the prepared diff and repository source through
repo_read.py; no build, test, or precheck was run during this review.Results
Findings
Blocking
None verified in the files read.
Non-blocking
None.
Sources
Behavior and implementation claims are based on the reviewed diff and source at the pinned head.
Not verified
I read the description, commits, manifest, full diff, and repository source for
CMakeLists.txt,Event.cpp,EventPropertyArray.cpp,EventPropertyObject.cpp,NpUniversalDataSystem.hpp,System.cpp,Events.cpp,GuestNpTrophyData.cpp,GuestNpTrophyStats.cpp, andGuestNpUniversalDataSystemQueries.cpp. The debt note was present in the diff but its full repository text was not read.core/libs/tests/GuestNpTrophyUnlocks.cppwas excluded by the prepared review materials. No build, tests, CI checks, Windows or macOS behavior, or console behavior were independently verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T11:35:00Z.
Review: APPROVED
Reviewed — looks good
The reviewed head is
91ed23e528aad12ea404d42e59f57f973095c927; the initialization guards and the added before/after lifecycle checks are consistent in the inspected code, and the supplied description reports relevant tests passing.What I ran
No commands were run. I read the prepared diff and review documents, plus the changed UDS state implementation, its header, the changed query test, and the event test setup. The supplied test results are author-reported, not runs performed for this review.
Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Did not read the full text of every changed file. Specifically, the changed CMake file,
Event.cpp,EventPropertyArray.cpp,EventPropertyObject.cpp, trophy test files, and debt change file were not read directly; their diffs were inspected where included above.core/libs/tests/GuestNpTrophyUnlocks.cppwas excluded by rule. No tests were run in this review; Windows, macOS, and console behavior were not verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-03T14:08:30Z.
Review: APPROVED
I read the diff at
91ed23e528. Windows 11 with GCC 15.2 and Linux (Ubuntu 24.04 in WSL2, GCC 13.3), merged intomainat6c6b29320fetogether with other open PRs (so not an isolated build).guest_np_uds_queries,np_uds_eventsand the threeguest_np_trophy_*tests that changed: pass on both.guest_np_uds_queriesfails with "UDS call 0 returned 0x00000000 before Initialize". On Linux, with the changed sources of the tested CPU PRs put back tomain's,guest_np_uds_queriesfails too.Not checked: a console.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T15:52:08Z.
Review: COMMENTED
I ran
guest_np_uds_queriesand the trophy unlocks, data, and stats CTests with the patch applied on Linux. All four passed, covering the initialization requirement in the UDS queries and the initialized trophy callers.AI-assisted: yes.