feat(libSceAppInstUtil): answer for an installer service that never installs #8346
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8346"
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 MarrasFederico on 2026-10-20T10:48:25Z.
What
sceAppInstUtilInitialize,sceAppInstUtilTerminateandsceAppInstUtilAppExiststhrewnot implemented. SharpProsperoAppInstUtil.csdocuments the installer service: initialization opens it once per process, termination closes it, andAppExistswrites 0 or non-zero for a title id.AnyPS5 runs one title and cannot install or launch another (
sceSystemServiceLaunchAppthrows), so the service now answers as one that never installs anything:sceAppInstUtilInitialize/sceAppInstUtilTerminateopen and close the service; it can be opened again after termination.sceAppInstUtilAppExistswrites 1 for the running title's id, read from itsparam.jsonorparam.sfo, and 0 for any other id, including a prefix of it.sceAppInstUtilAppIsInInstallingkeeps throwing: its prototype is disputed between SharpProspero'sint*form and the string form of itsPackageInstaller.csand the PS4 headers. It now has its own Unknown function info entry citing all three.The library gets a
CMakeLists.txtto register its test; the library target is built as before.sceAppInstUtilAppInstallAll,sceAppInstUtilAppInstallTitleDirandsceAppInstUtilAppUnInstallstill throw.Tested
Ubuntu 26.04.1, kernel 7.0.0-38, GCC 15.2.0, Release, full build with
BUILD_TESTING=ON. Windows was not compiled. No title was run.guest_app_inst_util, run with anapp0/sce_sys/param.jsonwhose title id isPPSA00000:AppExistswrites 1 forPPSA00000and 0 forPPSA00001,PPSA0000and an empty id;AppExistsanswers as before.main, where every call throws. Matching a prefix of the title id, or not closing the service on termination, makes it fail.tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.pyreports a conflict with #8329, which declares otherlibSceAppInstUtilexports: its edit of the debt entry on line 5 sits next to the section this PR adds. No function is shared; whichever is merged second needs a one-line rebase, and I will rebase this one if #8329 goes first.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)sceAppInstUtilInitialize not implementedon currentmainsince #6519 and run with this PR; PPSA99404 and PPSA99405 get past that stop. Evidence on Windows from DavidSamir and on Linux from babyhuey in this PR; no Game bring-up discussion exists for these titlesImported from boykopovar/AnyPS5. Originally posted by nikowolf123 on 2026-10-20T22:04:02Z.
sceAppInstUtilAppIsInInstalling: the new store goes through an argument whose type is disputedExport.cpp#L44writes*installing = 0. Onmainthis body threw before touching the argument, so theint32_t*prototype declared in #7749 was never exercised. This PR is the first to write through it. Its only source is SharpProspero'sAppInstUtil.cs#L88. The same SharpProspero commit and the PS4 headers take a string instead:PackageInstaller.cs#L121declares itdelegate* unmanaged<byte*, int>.AppIsInstalling(string titleId)passes a NUL-terminated id and reads the answer from the return value.bool sceAppInstUtilAppIsInInstalling(const char* contentId);(flatz, OpenOrbis).SharpProspero's
AppLauncher.cs#L578does pass&inInstalling, but that does not settle it. Under the string form that argument is an empty id, and the loop gives up silently after 2 s.For example, after
sceAppInstUtilInitialize()a caller built against the string form runs:The return value is 0 ("not installing") under both readings. But line 44 zeroes
"UP00", socidreads as""afterwards. If the id is a string literal, the store hits a read-only segment, because the relinker keeps the originalPT_LOADflags (ProgramHeaderLayoutBuilder.cpp#L124-L127). The process then faults wheremainthrew "not implemented". I built this PR'sExport.cppon Linux with such a caller: the buffer came back as""and the literal call ended in SIGSEGV.A fix: leave this one function as it is on
mainuntil a PS5 disassembly or a hardware run settles the prototype. Initialize, Terminate and AppExists don't depend on it.Its cases then come out of
GuestAppInstUtil.cpp(lines 11, 36, 50-51) and out of the Functional entry. The function moves to the Unknown function info entry, which should cite both SharpProspero forms and the PS4 one.Imported from boykopovar/AnyPS5. Originally posted by ycbuzi on 2026-10-21T07:35:21Z.
Windows run of
92ed3d58ffmerged ontomainb77bd58806(d720ef019a), the build the description lists as not done. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release,BUILD_TESTING=ON.Built
libSceAppInstUtilandguest_app_inst_util_testswith no errors or warnings;ctest --repeat until-fail:2onguest_app_inst_util: passes on both repeats. Not run: the negative control againstmain's library, a title.Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-21T10:51:22Z.
Linux title runs for this head (
92ed3d58f), since none were run yet. Three catalog titles started stopping on this call onmaintoday: in my catalog sweeps they reached their usual headless stop onmain27c88a8d, and on158d8ad34they throwsceAppInstUtilInitialize not implementedinstead (same title builds, so something merged in between gets them to this call first).Merged onto
main158d8ad34(clean merge). Ubuntu 24.04 container, GCC 13, Release,BUILD_TESTING=ON. No warnings in thelibSceAppInstUtilfiles;guest_app_inst_utilpasses 5 of 5 (--repeat until-fail:5).Headless with SDL's offscreen driver, 30 s:
main158d8ad34sceAppInstUtilInitialize not implementedDisplayWindowVulkan checkThe
DisplayWindowcheck is where headless runs of the other UI titles stop too, so all three get past the installer service with this change.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-21T11:15:10Z.
Review: CHANGES_REQUESTED
Thanks for the PR; Initialize, Terminate and AppExists look right and the test pins the edge cases well. One blocker:
core/libs/prx/libSceAppInstUtil/Export.cpp:44:sceAppInstUtilAppIsInInstallingwrites*installing = 0, but the prototype is disputed. SharpProspero's ownPackageInstaller.cs(L121, L484-L498) declares itdelegate* unmanaged<byte*, int>, passes a NUL-terminated id and reads the answer from the return value, and the PS4 headers (flatz, OpenOrbis) takeconst char*. Under that reading the store corrupts the caller's id, and faults on a read-only literal (reproduced in the thread by @nikowolf123). Unverified prototypes throw.Fix: restore the
NotImplemented_nid_no_patch(__func__)body for this one function, drop its cases fromGuestAppInstUtil.cpp(lines 11, 36, 50-51) and from the Functional debt entry, and list it under Unknown function info citing both SharpProspero forms and the PS4 one.Everything else can stay as is.
Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-21T11:46:26Z.
The cause of the change on
main, from a bisect of27c88a8d..158d8ad34(first parent, ProsperoStore): the first merge that stops on this call is #6519 (ee676246c), which loads/system/common/lib/*.sprxpaths as the host library.All three titles load
/system/common/lib/libSceAppInstUtil.sprxand look upsceAppInstUtilInitializeby name; the path and the name are in eacheboot.bin. Before #6519 that load failed withENOENTand the titles carried on without the installer service. Now the load succeeds, so they callsceAppInstUtilInitializeand it throws. With this PR they get past it again, as in the table above.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by MarrasFederico on 2026-10-21T12:33:19Z.
@adriadam10 done in
230d43d14, as you described:sceAppInstUtilAppIsInInstallingis back toNotImplemented_nid_no_patch(__func__), its cases are out ofGuestAppInstUtil.cppand of the Functional entry, and it has its own Unknown function info entry citing SharpProspero'sAppInstUtil.cs(int*) andPackageInstaller.cs(string) forms and the PS4const char*headers. The branch is also merged with currentmain;guest_app_inst_utilpasses.@nikowolf123 thanks for reproducing the overwrite, and @babyhuey for the title runs and the bisect to #6519. The three titles only need Initialize/Terminate/AppExists, which stay.
Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-21T12:51:42Z.
Rechecked on
230d43d14merged ontomain7280a17ec(clean merge), same Linux setup:guest_app_inst_utilpasses 5 of 5, and ProsperoStore, NFS Black Box and Sahin still get past the installer service to theDisplayWindowcheck. So none of them callssceAppInstUtilAppIsInInstallingbefore that point.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by DavidSamir on 2026-10-22T01:37:45Z.
A title this unblocks: ProsperoStore PPSA99000 1.000.105, the current catalog build (1.000.104 didn't call into this library). Windows 11, Radeon 680M, WinLibs GCC 15.2.0 r7.
main0c6a5bd59: it aborts after 1 s withwhat(): sceAppInstUtilInitialize not implemented(SIGABRT, 0xc0000409).maina6dcea927with this PR merged in (head230d43d14): it runs the full 60 s and is still running when stopped. There are no key lines. The import audit shows 5 stubs and 0 absent.When I merged it into current
main, the code merged cleanly, butdocs/dev/debt/libSceAppInstUtil.mdconflicts, so the branch needs a merge ofmain.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-22T01:44:09Z.
Two more titles this unblocks, both new in the catalog today: FUTBOL13 (PPSA99405, 01.000.000) and Blur5 (PPSA11016, 1.0.0). On Linux
main94fbb8ceaboth stop onsceAppInstUtilInitialize not implemented. With230d43d14merged ontomain94fbb8cea(the code merges cleanly; for this local test I keptmain's copy of the conflicting debt doc), both get to theDisplayWindowcheck like the other three.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-22T07:39:50Z.
Windows run of the current head (
12d605cde) merged ontomain4a17c7175(clean merge). Windows 11, RTX 3080, WinLibs GCC 15.2, Release, 60 s each:main(557682ca4→6ef5a1c4c)557682ca4; aborts withsceAppInstUtilInitialize not implementedon6ef5a1c4c557682ca4; same abort on6ef5a1c4cv_interp_mov p10 of a flat input with the first provoking vertex is not measured(#1413), its stop from before #6519v_interp_movthrow at 5.1 sv_interp_movthrow at 4.5 sSo on Windows the two titles that ran before #6519 run again with this PR, and the other three move on to #1413.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by DavidSamir on 2026-10-22T13:37:27Z.
Title evidence for this PR, from a Windows regression sweep of 113 homebrew titles: Windows 11, Radeon 680M, WinLibs GCC 15.2, 60 s per title, no input.
A regression this PR fixes. PPSA99403 NFS Black Box 01.000.000 ran 60 s on
main1ff5c8ac5. Onmain4777caca3, the same build of the title (same 1679 imports) aborts at start:A
git bisect --first-parent, rebuilding the relinker and libs at each step, names #6519 (ee676246cf; last goodb6fe513b9a). #6519 is correct: it makessceKernelLoadStartModuleload/system/common/lib/<name>.sprxfrom the hostlibs/<name>.prx. NFS Black Box loadslibSceAppInstUtil.sprxthat way. Before #6519 the load failed and the title skipped its installer path; now it succeeds and reachessceAppInstUtilInitialize.With this PR (head
12d605cde3merged ontomain4777caca3):main4777caca3sceAppInstUtilInitialize[STORE] store folder: nothing to reclaim)sceAppInstUtilInitializesceAppInstUtilInitializev_interp_mov p10 of a flat input with the first provoking vertex is not measured), where its previous build already stoppedsceAppInstUtilInitializeSo on current
mainthis PR unblocks PPSA99403 and PPSA99000, and moves PPSA99404 and PPSA99405 past thesceAppInstUtilInitializestop.I only ran it; I didn't review the code.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by MarrasFederico on 2026-10-22T13:51:13Z.
@DavidSamir thank you, this is exactly the evidence the PR was missing. I've put PPSA99403 and PPSA99000 in the
Unblocksline, with a link to your sweep, and noted that PPSA99404 and PPSA99405 get past thesceAppInstUtilInitializestop. The branch has also just been updated to currentmain3ca07d086d;guest_app_inst_utilpasses on the new head.Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-27T06:33:59Z.
Review: COMMENTED
Merged onto current
main(b7105f728),public_headersfails:This branch's merge-base (
1e740a23a) predates #10706, which added that audit on 2026-10-24: every export must be declared exactly once, in its library's public header. The new test redeclares three functions thatlibSceAppInstUtil/include/Api.hppalready declares. Thelinux/windowsjobs were also skipped on this head, so CI never ran the audit.Fix: include the public header and drop the local block:
With that change the audit passes for this PR. The only remaining error is the
sceKernelGetModuleInfoForUnwindone that is already onmainfrom #9263 (#11718 fixes it). The test passes a GCC 15.2-fsyntax-onlycheck with the test build flags.Checked on Linux (i7-8700, Ubuntu 26.04, GCC 15.2):
core/libs/tests/test_public_headers.py --audit-onlyon headb1e6cc92dmerged ontomainb7105f728.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-30T14:28:41Z.
Review: COMMENTED
Follow-up on the
public_headersfailure from my last review: fixed onf215c37ef.Linux, Ubuntu 26.04, i7-8700, GCC 15.2, Release, full build. Head merged
--no-commitontomainf91137142e.public_headers,guest_app_inst_util,patched_librariesandconventions_unknown_nidspass, 3/3 each.GuestAppInstUtil.cpp(b1e6cc92d) makes the audit fail again with the threesceAppInstUtil*duplicates.The branch conflicts with
mainagain since #13077 (merged today), but only indocs/dev/debt/libSceAppInstUtil.md. #13077 adds morelibSceAppInstUtilexports and declares them ininclude/Api.hpp, and the code merges cleanly. I keptmain's debt file for these runs.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.