fix(libc): find a relinked module by stem when the exact name misses (carries #6226) #8626
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8626"
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 xXPBSXx on 2026-10-20T18:53:18Z.
What
Carries #6226 (@lendinglibrary) onto current
main, keeping the original commit and its author (a3c4cdcdbb), and adds one commit that addresses the review points on #6226 (the author has not pushed since 15 October). The problem and the Unity IL2CPP evidence are those described in #6226: a title asks for a module by its console name, the relinker names the converted module after the ELF it was built from, soRelinkedModulePathmisses andsceKernelLoadStartModulefails with0x80020002; after the exact<name>.guest.prxand the case-insensitive lookup both miss, the lookup takes the sibling with the same stem that ends with.guest.prx.Changes on top of the original commit:
Engine.Render.prxno longer matchesEngine.Core.prx.guest.prx); the review on #6226 asked for this (cut at the first dot before).guest_module_fixture.other.prx).mainb85d972f42; the only conflict was the shared line indocs/dev/debt/libc.md(the original addition is kept).Fixes: none.
#6226stays open so its author can answer; if the author prefers to push the review fixes there, this PR can be closed.Tested
Windows 10 (19045), MinGW-w64 GCC 15.2.0, Release, on
main+ this branch:guest_dynamic_loader_variant_names: fails (failed at GuestDynamicLoaderVariants.cpp:22, exit 0xc0000409) with the cut at the first dot (new case kept) and passes with the last extension;guest_dynamic_loaderandguest_filesystempass, 3 of 3 runs.python tools/check_conventions.py --base upstream/main: 0 errors, 1 warning (debt-length: the libc.md entry over 1000 characters comes from the original commit).git merge-treeof this branch with #6226 has three conflicts (the same code, expected); withupstream/mainit is clean.pr_overlapwas not run.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryAI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T19:07:59Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/tests/GuestDynamicLoaderVariants.cppcore/libs/prx/libc/src/General.cppL677-680Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
docs/dev/debt/libc.mdcore/libs/prx/libc/src/General.cppcore/libs/prx/libkernel/CMakeLists.txtdocs/dev/debt/libc.mdcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libc/src/General.cppcore/libs/prx/libkernel/CMakeLists.txtcore/libs/tests/GuestDynamicLoaderVariants.cppdocs/dev/debt/libc.mdcore/libs/prx/libkernel/CMakeLists.txtdocs/dev/debt/libc.mddocs/dev/debt/libc.mdcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtdocs/dev/debt/libc.mdcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libc/src/General.cppcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtdocs/dev/debt/libc.mddocs/dev/debt/libc.mddocs/dev/debt/libc.mdcore/libs/prx/libkernel/CMakeLists.txtdocs/dev/debt/libc.mddocs/dev/debt/libc.mdImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T19:30:53Z.
Code review location:
core/libs/prx/libkernel/CMakeLists.txt; line 278This fixture no longer exercises the shortest-match or dangling-symlink-before-valid-candidate paths after the last-extension change. For the request
guest_module_fixture.prx,SameRelinkedStemstrips.GUEST.PRXand then only the last extension:guest_module_fixture.sprx.elf.GUEST.PRXyields stemguest_module_fixture.sprx, and the symlink name ending in.zprx.elf.GUEST.PRXyieldsguest_module_fixture.zprx. Neither matchesguest_module_fixture; only the copied.elf.GUEST.PRXfile matches. Could the decoy and symlink instead be named e.g.guest_module_fixture.sprx.GUEST.PRXandguest_module_fixture.zprx.GUEST.PRX? Those share the requested stem under this rule and would make the selection/error-path coverage real.Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-20T20:18:02Z.
Good catch, thank you. After the cut at the last extension the decoy and the dangling link no longer had the request's stem, so the shortest-name rule was not exercised any more. I renamed them as you suggested (
guest_module_fixture.sprx.GUEST.PRX,guest_module_fixture.zprx.GUEST.PRX; commitc98377710f). To check that they compete again I flipped the length comparison inRelinkedModulePath's stem lookup:guest_dynamic_loader_variant_namesthen fails at the firstdlopen, and it passes with the real comparison (Windows 10, MinGW-w64 GCC 15.2, Release). The dangling-link variant only exists on non-Windows hosts and I did not run it.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T01:22:52Z.
@xXPBSXx I merged current
maininto this branch (2de93860ab). Besides a keep-both inGeneral.cpp, the merge commit adds one guard inMatchNames.#7467 added an early return to
MatchNamesWindowsfor case-insensitive directories (the NTFS default). That path looks up each name exactly and never reachesSameRelinkedStem, so on Windows this PR's stem fallback would never run. The merge now takes the Windows fast path only when no requested name hasstemset:ResolveHostPathnever setsstem, so #7467's fast path is unchanged for ordinary lookups. OnlyRelinkedModulePathgoes back to the iterator.guest_dynamic_loader_variant_namespassing on Windows CI will confirm it.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T06:29:26Z.
Note: I force-pushed the merge commit as
8cb7251b2eto correct its committer identity. The tree is identical to the previous head2de93860ab, so nothing in the code changed. CI on the new head is next.