feat(libSceSystemService): restart the running title in sceSystemServiceLoadExec #1525
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1525"
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 emaurel on 2026-10-08T11:03:40Z.
What
sceSystemServiceLoadExec("/app0/eboot.bin", argv)restarts the running title with the given arguments instead of throwing. Only"exit"was handled before.src/core/libraries/system/systemservice.cpp). The restarted title keeps the hostargv[0]. Neither point is confirmed on a PS5 title; both are recorded in TechnicalDebt.LibcRunShutdown), descriptors above 2 are marked close-on-exec, the signal mask and ignored signals are reset, andexecv("/proc/self/exe", ...)replaces the process. The PID stays the same.SYNCHRONIZEhandle to the old one, named byANYPS5_LOAD_EXEC_PREVIOUS_PROCESS. libSceSystemService waits on it while loading, before the title runs. The old process runs the shutdown and then terminates. The two processes therefore never hold direct memory at the same time, which matters because it is committed in full (USAGE.md). Arguments are passed as UTF-8, the same encoding the entry stub uses, and are quoted by theCommandLineToArgvWrules. Arguments that are not UTF-8 throw before anything is started.Tested
-DBUILD_TESTING=ONguest_load_exec_restartrestartsguest_system_exit_testswithtwo words,quote"d,trailing\,back\\"slash,üand an empty argument. The restarted process checks that each argument arrives byte for byte, and that the old process had ended before it ran. The test's shutdown callback sleeps 500 ms, so a missing wait would be caught.agc_driver_srgb8_color_target, which is #1434 (addressed by the open #1441): it fails in 20 of 30 runs onmainon this machine, and in 0 of 30 with that issue'sSleep(50)experiment. Its binary loads only libc, libkernel and libSceAgcDriver, none of which this PR changes.SIGPIPEand blocksSIGUSR1; the restarted process checks that both are back to their defaults.--coverage, the test runs 32 of the 34 lines of the Linux half ofLoadExec.cpp. The two lines not run are apthread_sigmaskfailure path and the unreachable closing brace.VK_DRIVER_FILES,GALLIUM_OVERRIDE_CPU_CAPS=avx) passes 434 of 435, with 22 GPU tests skipped.guest_video_out_wqhd_detectionhit its 20 s timeout under-j4. Run alone it passes with this change, and it also timed out without it.python3 tools/check_conventions.py --base upstream/mainpasses.Checklist
main; no other open pull request implements the same functions (#1269 also editslibSceSystemService/Export.cpp, forDisableMediaPlay/ReenableMediaPlayonly)NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-10-08T11:15:15Z.
Review: COMMENTED
Solid implementation of
sceSystemServiceLoadExecfor title restart. The cross-platform approach (execv on Linux, CreateProcess with synchronization on Windows) is well thought out and handles the tricky aspects like signal reset, descriptor management, and process termination ordering.Strengths:
Minor notes:
ANYPS5_LOAD_EXEC_PREVIOUS_PROCESSenvironment variable name should be documented for users who might need to debug restart issuesThis looks ready to merge once CI passes and any rebase conflicts are resolved.
Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-10-08T11:21:47Z.
Review: APPROVED
Excellent implementation of
sceSystemServiceLoadExecfor title restart. This is a complex feature that requires careful handling of both Linux and Windows process models.Strengths:
LoadExec.cpp/LoadExec.hppfilesexecvon Linux, new process creation with inherited handle on WindowsTechnical notes:
This will improve compatibility with titles that use
sceSystemServiceLoadExecfor restart functionality. Ready to merge.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T09:22:13Z.
Which title calls
sceSystemServiceLoadExec("/app0/eboot.bin", ...)on main? This adds a lot of process handling, so it needs a title that stops there: the ID and the log line. Otherwise I'll close it until one does.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-09T23:52:53Z.
Review: CHANGES_REQUESTED
Thanks for the thorough work and the Windows/Linux test coverage. As @oneandonlydean asked, this needs a concrete title before it can go in:
sceSystemServiceLoadExec("/app0/eboot.bin", ...)and stops there onmain? Please add the PPSA id and the log line (theNotImplemented_nid_no_patchabort). Neither the PR body nor the linked PRs name one ("No title or homebrew was tested"), and the argument layout (no program name, null-terminated) is only taken from shadPS4, so a real call site would also confirm it.LoadExec.cpp, descriptor/signal reset, Windows handle hand-off) can't be justified. If no title reaches it yet, we'd rather keep the throw until one does.Once a title is named, I'm happy to re-review.
Imported from boykopovar/AnyPS5. Originally posted by emaurel on 2026-10-10T08:46:12Z.
No title on main reaches
sceSystemServiceLoadExec("/app0/eboot.bin", ...)as far as I know, so I'm closing this. I'll reopen it with the title ID and the log line if I find one.Pull request closed