fix(libc): find a relinked module whose name differs in case #5434
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5434"
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 milescoviello on 2026-10-13T19:40:29Z.
What
On Linux, a title that loads a bundled module under a name whose case differs from the shipped file gets
ENOENT. Borderlands 4 (PPSA01494) loads its UI library withsceKernelLoadStartModule("/app0/prx/libRenoirCore.PS5.prx")but ships it asprx/librenoircore.ps5.prx. Onmainit logs:That handle is
0x80020002,ENOENT.Guest paths are resolved case-insensitively (
ResolveHostPath), but only against names that exist. With the runtime layout indocs/user/USAGE.md,app0/prxholds the relinker'slibrenoircore.ps5.prx.guest.prxand not the original module. So the requested name resolves to itself, andRelinkedModulePath_nid_no_patch(#4688) then looks forlibRenoirCore.PS5.prx.guest.prxwith its exact spelling. When the original.prxis still inapp0, the resolver fixes the case first, which is why this only shows without it. Windows and macOS hosts ignore the case anyway, so only Linux is affected.RelinkedModulePath_nid_no_patchnow falls back to the same ASCII case-insensitive match asResolveHostPathwhen the exact<name>.guest.prxis missing, and throws for an ambiguous match as that does.dlopen(and sosceKernelLoadStartModule),stat,openandsceKernelCheckReachabilityall use it. The libc debt entry for guest path resolution now mentions it.guest_filesystemgainsTestRelinkedModuleNameCase. With onlylibrenoircore.ps5.prx.guest.prxin a directory, it checks four things onlibRenoirCore.PS5.prx:sceKernelStatandstatreport the converted file,sceKernelCheckReachabilitysucceeds, andsceKernelOpenopens it. A name that is not there still getsENOENT.Tested
Ubuntu 24.04, GCC 13.3 (CI's compiler), Release with CI's configure flags, on
maindacd78525, RTX 4070 Ti (NVIDIA 580.142):main'sGeneral.cppand the new test,guest_filesystemfails at the firstsceKernelStat(ENOENT); with the change it passes 20/20.guest_*tests pass in two runs, and the 16 relinker and module tests pass.--to-intel, with the converted modules inapp0/sce_moduleandapp0/prxas the relinker writes them, and run on Linux for 85 to 240 s. It starts, plays its logo movies and stays on its loading screen. TheCould not loadline above comes from a run onmain18c438b10, with only #5387's unrelatedsysctlbynamechange in libkernel. The title makes that call late in loading, so not every run reaches it within the time limit. In the runs with this change the line did not appear.Not checked on a console.
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
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-14T01:34:04Z.
Rebased onto
main34355eeea. The only conflict wasdocs/dev/debt/libc.md, next to the newtznameentry; both entries are kept. After the rebase, the build is clean,guest_filesystempasses 5/5 and all 354guest_*tests pass (Ubuntu 24.04, GCC 13.3, Release).AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T05:10:17Z.
The full build is green on this head. Before it goes in it needs one run by someone other than the author on the title this is for (title ID, GPU/OS, before/after on current
main); could someone who has it post one?Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-14T05:12:15Z.
Thanks, @oneandonlydean. To make a run quick for anyone with Borderlands 4 (PPSA01494, any GPU; the stop is in module loading, before any GPU work):
--to-inteland lay outapp0asdocs/user/USAGE.mddescribes, soapp0/prxholdslibrenoircore.ps5.prx.guest.prx.main, the log hasCould not load /app0/prx/libRenoirCore.PS5.prx result 0, handle result -2147352574within the first seconds.AI-assisted: yes