fix(libkernel): export execvp #2827

Merged
Get-fix merged 1 commit from upstream-pr/2827 into main 2026-10-10 22:49:40 +00:00
Get-fix commented 2026-10-10 16:14:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Get-fix on 2026-10-10T16:14:06Z.


What

VLC (PPSA85300) imports execvp (0NJDcQ2B8vE) from libkernel and fails to load because no library exports it. This is the stop #2123 left for its own PR. Replacing the process image is not supported, so execvp throws execvp: executable replacement not implemented, as sceSystemServiceLoadExec does for executable replacement. VLC cannot reach either of its two call sites: its fork and vfork fail with ENOSYS (libc_missing.c), so the child process that would call execvp is never created. The new guest_execvp test checks the throw.

Tested

Windows 11 (WinLibs GCC 15.2.0 r7), Release, full build with BUILD_TESTING=ON on main 57f96fd2:

  • guest_execvp and guest_waitpid pass 5/5. With a silent return -1 or a different message planted, guest_execvp fails.
  • Of the 71 libkernel tests that build on Windows, 70 pass. guest_raise_exception fails the same way on main without this change (0xc0000409, #1488).
  • tools/check_conventions.py and tools/check_test_registration.py pass.
  • VLC v0.3 (catalog sha256), with the same converted executable and libraries, swapping only libkernel.prx, two runs each: main stops at FAIL: unresolved ELF import 0NJDcQ2B8vE from libkernel.prx (execvp); this branch stops at FAIL: unresolved ELF import wdUufa9g-D8 from libkernel.prx (dup2, #2478). With #2478 as well, it stops at Wn6I3wVATUE (daemon).

babyhuey's run on #1772 shows PS5MC (PPSA99420) reaching the same execvp stop after getifaddrs; PS5MC was not run here. Not tested on Linux. The same branch and results are posted in #1578.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4812636412 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2827). Originally posted by [Get-fix](https://github.com/Get-fix) on 2026-10-10T16:14:06Z. --- ### What VLC (PPSA85300) imports `execvp` (`0NJDcQ2B8vE`) from libkernel and fails to load because no library exports it. This is the stop #2123 left for its own PR. Replacing the process image is not supported, so `execvp` throws `execvp: executable replacement not implemented`, as `sceSystemServiceLoadExec` does for executable replacement. VLC cannot reach either of its two call sites: its `fork` and `vfork` fail with `ENOSYS` ([`libc_missing.c`](https://github.com/ZiZc3/VLC/blob/f3253020a64368153233ede29183014c0b6c8979/ps5/compat/libc_missing.c#L290-L292)), so the child process that would call `execvp` is never created. The new `guest_execvp` test checks the throw. ### Tested Windows 11 (WinLibs GCC 15.2.0 r7), Release, full build with `BUILD_TESTING=ON` on `main` 57f96fd2: - `guest_execvp` and `guest_waitpid` pass 5/5. With a silent `return -1` or a different message planted, `guest_execvp` fails. - Of the 71 libkernel tests that build on Windows, 70 pass. `guest_raise_exception` fails the same way on `main` without this change (`0xc0000409`, #1488). - `tools/check_conventions.py` and `tools/check_test_registration.py` pass. - VLC v0.3 (catalog sha256), with the same converted executable and libraries, swapping only `libkernel.prx`, two runs each: `main` stops at `FAIL: unresolved ELF import 0NJDcQ2B8vE from libkernel.prx` (`execvp`); this branch stops at `FAIL: unresolved ELF import wdUufa9g-D8 from libkernel.prx` (`dup2`, #2478). With #2478 as well, it stops at `Wn6I3wVATUE` (`daemon`). [babyhuey's run on #1772](https://github.com/boykopovar/AnyPS5/pull/1772#issuecomment-6097664778) shows PS5MC (PPSA99420) reaching the same `execvp` stop after `getifaddrs`; PS5MC was not run here. Not tested on Linux. The same branch and results are posted in [#1578](https://github.com/boykopovar/AnyPS5/issues/1578#issuecomment-6099557304). ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-10 16:14:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T16:14:17Z.


Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6099563483 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2827#issuecomment-6099563483). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T16:14:17Z. --- Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
github-actions[bot] commented 2026-10-10 16:14:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T16:14:27Z.


Progress report (57f96fd → d686f70)

📉 System libraries: 84.49% (-0.03%, +1 declared functions)

🆕 1 declared as stubs
Library Name
libkernel execvp_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6099565052 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2827#issuecomment-6099565052). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T16:14:27Z. --- <!-- progress-report --> ### Progress report (57f96fd → d686f70) 📉 **System libraries**: 84.49% (-0.03%, +1 declared functions) <details> <summary>🆕 1 declared as stubs</summary> | Library | Name | | - | - | | libkernel | `execvp_nid_postfix` | </details>
babyhuey commented 2026-10-10 18:39:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-10T18:39:01Z.


Linux and the other two titles, on current main. d686f705 merged onto main 9c5d67fb (clean, now with #1772 and #2478 in), Linux (Ubuntu 24.04, GCC 13) and Windows 11 (MinGW-w64 GCC 15.2 from WinLibs), Release, catalog builds with sce_module/libc.prx unwrapped (#2605).

  • guest_execvp passes 5/5 on both (--repeat until-fail:5).
  • Three titles stop at 0NJDcQ2B8vE on main (Windows: FAIL: unresolved ELF import 0NJDcQ2B8vE (execvp) from libkernel.prx), and all three get past it with this PR, to the same next stop on both:
Title with this PR
VLC (PPSA85300) Wn6I3wVATUE (daemon)
PS5MC (PPSA99420) -nvxBWa0iDs (gethostname)
OpenRCT2 Native Port (PPSA99728) oxMp8uPqa+U (pthread_set_name_np)

Example for PS5MC with this PR: Linux app.elf: symbol lookup error: app.elf: undefined symbol: -nvxBWa0iDs, Windows FAIL: unresolved ELF import -nvxBWa0iDs (gethostname) from libSceLibcInternal.prx.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6100887374 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2827#issuecomment-6100887374). Originally posted by [babyhuey](https://github.com/babyhuey) on 2026-10-10T18:39:01Z. --- Linux and the other two titles, on current `main`. d686f705 merged onto `main` 9c5d67fb (clean, now with #1772 and #2478 in), Linux (Ubuntu 24.04, GCC 13) and Windows 11 (MinGW-w64 GCC 15.2 from WinLibs), Release, catalog builds with `sce_module/libc.prx` unwrapped (#2605). - `guest_execvp` passes 5/5 on both (`--repeat until-fail:5`). - Three titles stop at `0NJDcQ2B8vE` on `main` (Windows: `FAIL: unresolved ELF import 0NJDcQ2B8vE (execvp) from libkernel.prx`), and all three get past it with this PR, to the same next stop on both: | Title | with this PR | |---|---| | VLC (PPSA85300) | `Wn6I3wVATUE` (`daemon`) | | PS5MC (PPSA99420) | `-nvxBWa0iDs` (`gethostname`) | | OpenRCT2 Native Port (PPSA99728) | `oxMp8uPqa+U` (`pthread_set_name_np`) | Example for PS5MC with this PR: Linux `app.elf: symbol lookup error: app.elf: undefined symbol: -nvxBWa0iDs`, Windows `FAIL: unresolved ELF import -nvxBWa0iDs (gethostname) from libSceLibcInternal.prx`.
adriadam10 commented 2026-10-10 22:49:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T22:49:38Z.


Checked build and ctest on current main: guest_execvp and guest_waitpid pass, and guest_execvp doesn't link without the change. Matches the throw convention for unsupported process replacement, TechnicalDebt line is in the right section; Linux/Windows runs and title stops confirmed by @babyhuey. Merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6103022103 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2827#issuecomment-6103022103). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T22:49:38Z. --- Checked build and ctest on current main: `guest_execvp` and `guest_waitpid` pass, and `guest_execvp` doesn't link without the change. Matches the throw convention for unsupported process replacement, TechnicalDebt line is in the right section; Linux/Windows runs and title stops confirmed by @babyhuey. Merging.
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!2827
No description provided.