Repository navigation
Conversation
…iceLoadExec LoadExec of /app0/eboot.bin now restarts the title with the given arguments instead of throwing. Linux replaces the process with execv after the runtime shutdown; Windows starts the new process, which waits for the old one to end before the title runs, so the two never hold direct memory at once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10902d8 to
a93116d
Compare
klosixgaming-arch
left a comment
There was a problem hiding this comment.
Solid implementation of sceSystemServiceLoadExec for 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:
- Comprehensive testing covering argument passing, special characters, UTF-8 handling, and edge cases
- Good documentation in TechnicalDebt about platform differences and unverified behavior
- Proper synchronization to prevent both processes from holding direct memory simultaneously on Windows
Minor notes:
- The PR is marked as draft - appropriate given the complexity
- Consider whether the
ANYPS5_LOAD_EXEC_PREVIOUS_PROCESSenvironment variable name should be documented for users who might need to debug restart issues
This looks ready to merge once CI passes and any rebase conflicts are resolved.
klosixgaming-arch
left a comment
There was a problem hiding this comment.
Excellent implementation of sceSystemServiceLoadExec for title restart. This is a complex feature that requires careful handling of both Linux and Windows process models.
Strengths:
- Clean separation into dedicated
LoadExec.cpp/LoadExec.hppfiles - Proper platform-specific implementations:
execvon Linux, new process creation with inherited handle on Windows - Comprehensive test coverage including edge cases (quotes, backslashes, UTF-8 characters, empty arguments)
- Good handling of signal reset and descriptor cleanup on Linux
- Thorough documentation of limitations in TechnicalDebt.md
Technical notes:
- The Windows approach using an inherited SYNCHRONIZE handle via environment variable is a clever solution to the lack of process replacement
- Proper UTF-8 validation before starting the new process prevents encoding issues
- Test cases properly verify argument passing, signal reset, and previous process termination
This will improve compatibility with titles that use sceSystemServiceLoadExec for restart functionality. Ready to merge.
|
Which title calls |
adriadam10
left a comment
There was a problem hiding this comment.
Thanks for the thorough work and the Windows/Linux test coverage. As @oneandonlydean asked, this needs a concrete title before it can go in:
- Which title calls
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. - Without that, the process handling added here (
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.
|
No title on main reaches |
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 AGC: on Windows (NVIDIA) a new host import's pages are marked written after ImportWatched's window, so write-backs drop GPU results #1434 (addressed by the open fix(agc): compare Windows host imports after late driver writes #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 (feat(libSceSystemService): implement Disable/ReenableMediaPlay #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