fix(libkernel): match module info segment records #8676

Merged
MarcZX10 merged 2 commits from upstream-pr/8676 into main 2026-10-21 00:10:46 +00:00
MarcZX10 commented 2026-10-20 20:50:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T20:50:23Z.


What

  • Accept the observed ModuleInfoEx object passed by guest libc to __elf_phdr_match_addr.
  • Match its already-relocated segment ranges using the execute protection bit while retaining the existing dl_phdr_info path.
  • Extend guest_elf_phdr_match_tests with executable, non-executable, and range-boundary cases for the module-info layout.

Fixes #8675

Tested

  • Both changed C++ translation units compile with the existing Release flags.
  • git diff --check and tools/check_conventions.py --base c6145997ef --head HEAD pass.
  • The focused guest_elf_phdr_match_tests target links using cached build prerequisites. Runtime execution aborts at the repository CPU guard because this host lacks AVX2, BMI2, and other required guest instruction support.
  • No PS5 console ABI confirmation is claimed; this covers the exact caller/layout and crash documented in #8675.

Checklist

  • Based on current main; no other open PR implements the same function.
  • One topic per PR; follow-ups go in a new PR.
  • No comments in code except technical debt.
  • Unimplemented paths and technical debt rules unaffected.
  • No notes or unrelated files added.
  • New third-party code: none.
  • Generic behavior, not title-specific.
  • Depends on: none
  • Fixes: #8675
  • Unblocks: none claimed
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4942312926 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8676). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T20:50:23Z. --- ### What - Accept the observed `ModuleInfoEx` object passed by guest libc to `__elf_phdr_match_addr`. - Match its already-relocated segment ranges using the execute protection bit while retaining the existing `dl_phdr_info` path. - Extend `guest_elf_phdr_match_tests` with executable, non-executable, and range-boundary cases for the module-info layout. Fixes #8675 ### Tested - Both changed C++ translation units compile with the existing Release flags. - `git diff --check` and `tools/check_conventions.py --base c6145997ef --head HEAD` pass. - The focused `guest_elf_phdr_match_tests` target links using cached build prerequisites. Runtime execution aborts at the repository CPU guard because this host lacks AVX2, BMI2, and other required guest instruction support. - No PS5 console ABI confirmation is claimed; this covers the exact caller/layout and crash documented in #8675. ### Checklist - [x] Based on current `main`; no other open PR implements the same function. - [x] One topic per PR; follow-ups go in a new PR. - [x] No comments in code except technical debt. - [x] Unimplemented paths and technical debt rules unaffected. - [x] No notes or unrelated files added. - [x] New third-party code: none. - [x] Generic behavior, not title-specific. - [x] Depends on: none - [x] Fixes: #8675 - [x] Unblocks: none claimed - [x] GPUs tested: n/a - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-20 21:03:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T21:03:12Z.


Some 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.

Pull request Shared files not compared
PR 4972 core/libs/prx/libkernel/Module/src/Module.cpp
PR 5021 core/libs/prx/libkernel/Module/src/Module.cpp
PR 6044 core/libs/tests/GuestElfPhdrMatch.cpp
PR 6149 core/libs/prx/libkernel/Module/src/Module.cpp
PR 6519 core/libs/prx/libkernel/Module/src/Module.cpp
PR 6879 core/libs/prx/libkernel/Module/src/Module.cpp
PR 6977 core/libs/prx/libkernel/Module/src/Module.cpp
PR 7201 core/libs/prx/libkernel/Module/src/Module.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6301428756 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8676#issuecomment-6301428756). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-20T21:03:12Z. --- <!-- pr-overlap --> Some 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. | Pull request | Shared files not compared | |---|---| | [PR 4972](https://www.github.com/boykopovar/AnyPS5/pull/4972) | `core/libs/prx/libkernel/Module/src/Module.cpp` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libkernel/Module/src/Module.cpp` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/tests/GuestElfPhdrMatch.cpp` | | [PR 6149](https://www.github.com/boykopovar/AnyPS5/pull/6149) | `core/libs/prx/libkernel/Module/src/Module.cpp` | | [PR 6519](https://www.github.com/boykopovar/AnyPS5/pull/6519) | `core/libs/prx/libkernel/Module/src/Module.cpp` | | [PR 6879](https://www.github.com/boykopovar/AnyPS5/pull/6879) | `core/libs/prx/libkernel/Module/src/Module.cpp` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `core/libs/prx/libkernel/Module/src/Module.cpp` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libkernel/Module/src/Module.cpp` |
Filip722 commented 2026-10-20 21:10:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Filip722 on 2026-10-20T21:10:53Z.


Independent Linux runtime testing of head 05cc68cd9540ee9f0294d72fbf7f537be0ab7443: this removes the startup crash reported in #8675, and LEGO Voyagers now reaches its title/menu screen.

  • Full Release configuration, BUILD_TESTING=ON, bundled dependencies. Built the exact PR's libkernel, guest_elf_phdr_match_tests, and guest_module_info_tests. The host CPU guard remained enabled and unmodified.
  • 2/2 focused CTests passed, with no skips:
ctest --test-dir build -R '^guest_(elf_phdr_match|module_info)$' -V --timeout 30
  • Before/after check using saved libraries from the reported baseline a6a4101e190ec408c3ed471d20f06872cae1b4a3: the PR's expanded regression aborts against the old library and passes against this PR. The standalone reproducer from #8675 changes from SIGSEGV to normal exit with match=1 after querying a real loaded fixture module. The underlying libc binary is identical between these two library sets.
  • LEGO Voyagers PPSA23732, 01.001.000: used a separate copy of the previously tested baseline runtime and replaced only packaged libkernel.prx with the library built from this PR. Verified that all other runtime-library files were unchanged. The game passes the former helper crash, continues asset/audio-bank loading, and reaches a title/menu screen, confirmed by the local user watching the visible launch. It remained running until the deliberate 90-second observation limit (timeout status 124); this was not a spontaneous crash or normal game exit.
  • Conventions passed against PR base c6145997ef43e32b0c2119779fe2b5e863e751a6.

This confirms the reported startup blocker is removed. Gameplay, full-suite execution, GPU validation-layer coverage, other host platforms and console ABI semantics were not tested.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6301567672 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8676#issuecomment-6301567672). Originally posted by [Filip722](https://github.com/Filip722) on 2026-10-20T21:10:53Z. --- Independent Linux runtime testing of head `05cc68cd9540ee9f0294d72fbf7f537be0ab7443`: this removes the startup crash reported in #8675, and LEGO Voyagers now reaches its title/menu screen. - Full Release configuration, `BUILD_TESTING=ON`, bundled dependencies. Built the exact PR's `libkernel`, `guest_elf_phdr_match_tests`, and `guest_module_info_tests`. The host CPU guard remained enabled and unmodified. - **2/2 focused CTests passed**, with no skips: ```sh ctest --test-dir build -R '^guest_(elf_phdr_match|module_info)$' -V --timeout 30 ``` - Before/after check using saved libraries from the reported baseline `a6a4101e190ec408c3ed471d20f06872cae1b4a3`: the PR's expanded regression aborts against the old library and passes against this PR. The standalone reproducer from #8675 changes from SIGSEGV to normal exit with `match=1` after querying a real loaded fixture module. The underlying libc binary is identical between these two library sets. - **LEGO Voyagers PPSA23732, 01.001.000:** used a separate copy of the previously tested baseline runtime and replaced only packaged `libkernel.prx` with the library built from this PR. Verified that all other runtime-library files were unchanged. The game passes the former helper crash, continues asset/audio-bank loading, and reaches a title/menu screen, confirmed by the local user watching the visible launch. It remained running until the deliberate 90-second observation limit (`timeout` status 124); this was not a spontaneous crash or normal game exit. - Conventions passed against PR base `c6145997ef43e32b0c2119779fe2b5e863e751a6`. This confirms the reported startup blocker is removed. Gameplay, full-suite execution, GPU validation-layer coverage, other host platforms and console ABI semantics were not tested. AI-assisted: yes.
MarcZX10 commented 2026-10-20 21:27:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T21:27:12Z.


Thanks for the exact-head Linux run and baseline-library control. The focused CTests and LEGO Voyagers launch result directly verify the reported helper crash is removed; the stated limits on gameplay and other platforms are clear.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6301855498 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8676#issuecomment-6301855498). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T21:27:12Z. --- Thanks for the exact-head Linux run and baseline-library control. The focused CTests and LEGO Voyagers launch result directly verify the reported helper crash is removed; the stated limits on gameplay and other platforms are clear.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!8676
No description provided.