Repository navigation
fix(libSceSystemService): pass LoadExec arguments as the whole guest argv - #5083
Conversation
|
Review note (static): AI-assisted (Claude Code). |
a02109e to
f2e8681
Compare
|
Source review found a Windows-only path-boundary gap in the current LoadExec path: I am holding a separate containment fix because it overlaps this refactor. Could your refactor go first, with the narrow guard and exported-API regression test rebased afterward? This is a source finding only; I have not reproduced it in the guest runtime yet. The investigation, proposed patch and this comment are AI-assisted. |
|
Runtime follow-up: the path-boundary case is now reproduced through the actual Windows Exact overlap follow-up: the complete live hunk/export/new-file scanner reports no overlap, including with #5083. Your current diff changes the outer LoadExec body but leaves The patch and test are AI-assisted; no commercial-title or PS5 hardware result is claimed. |
b2f2a20 to
9d4464a
Compare
|
Updated to
Neither #5236 nor #5158 is a prerequisite of this PR. I suggest they go first, since they are smaller, and I rebase this one after either merges; say so if you prefer another order. Windows 11, WinLibs MinGW-w64 GCC 15.2.0 r7; Ubuntu 26.04 under WSL, GCC 15.2.0; Release, Windows with the change (9 of 9)Windows control: Export.cpp from main, new testLinux with the change (9 of 9)Linux control: Export.cpp from main, new testAI-assisted (Claude Code). |
|
The PR overlap report now lists #5158, #5236 and #5284 against this PR, so the checklist declares the order proposed above: @MarcZX100 for #5284 ( AI-assisted (Claude Code). |
|
Which titles pass an argument vector to
Method: the 65 release archives listed in ps5-homebrew-catalog were downloaded (SHA-256 equal to the catalog records), 63 of them hold an AI-assisted (Claude Code). |
|
Thanks for adding this survey. It gives useful evidence that the array-address call pattern occurs in real homebrew binaries, including explicit AI-assisted: yes; reviewed by MarcZX100. |
|
Linux run of the full RetroArch frontend chain this PR is about: RetroArch (PPSA99169, catalog release) converted with The run uses the title's game mode, the way ES-DE starts a game:
Merging into current One interaction with #5699, which I opened: after a guest |
…argv Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9d4464a to
a1b8012
Compare
|
@YossiYad thank you for the run. It is the title evidence this PR lacked: on Rebased onto
On #5699: agreed. Whichever lands second adds the AI-assisted (Claude Code). |
|
Checked on Linux with the PR merged onto current |
What
sceSystemServiceLoadExecwith a nonempty argument list now starts the new executable with that list as its whole guestargv, with no program name in front.mainpasses the list after the host path, so the guest sees the host path asargv[0]and every argument one position later.This follows the published PS5 RetroArch console transcript: a restart with one argument enters with
argc=1,argv[0]="--ps5-relaunch=1", and a launch from the home screen withargc=1,argv[0]=""(its caller). It is published console evidence, not a console run performed for this PR.fexecve. The PID is kept.maindoes.Title
RetroArch (PPSA99169) needs this when a game returns to ES-DE. YossiYad ran the whole frontend chain on Linux (comment). The title was converted with
--executable picker/picker.bin --executable es-de/es-de.binand started in its game mode, withnova.nes(GPL NES homebrew) and ES-DE as the frontend. After the game quits, RetroArch starts ES-DE throughsceSystemServiceLoadExec.main, ES-DE gets the host path as an extra argument. It printsUnknown option '/…/run/es-de.es-de.bin.elf'and returns at once, its log showsstart: arguments for ES-DE 2, and the title goes back to the picker. A game can never return to ES-DE.start: arguments for ES-DE 1, then starts and renders. It then stops on an unrelated AGC stop (AGC: OliSe Player stops on 'last provoking vertex with explicit per-vertex triangle-strip interpolation is unsupported' #5245).Related:
GuestSystemExit.cppkeeps fix(libc): finish exit handlers after nested exit #5284's nested-exit modes, written in the samefirstArgumentform as the other modes, andlibSceSystemService/CMakeLists.txtkeeps fix(libSceSystemService): contain converted executable paths #5158's test next toloadexec_arguments.libSceSystemServicenow linkslibSceAgcDriveronmain, soloadexec_argumentsalso copies that library beside the converted fixture."exit"branch of the same function. A trial merge conflicts only on the technical-debt line both rewrite, and the checklist declares the order.GuestSystemExit.cpp'smain, where this PR rewrites the argument checks into thefirstArgumentform, and carries fix(libSceSystemService): end LoadExec exit without running guest exit handlers #5236's debt line. A trial merge conflicts on those lines only. Whichever lands second rebases, and its new mode would take the same form.main'sexecv. This PR's Linux replacement keeps descriptors 0 to 2 as they are, so it needs the samedup2beforeclose_range. As agreed with its author, whichever of the two lands second adds it.Tested
Windows 11, Ryzen 7 5800H, WinLibs MinGW-w64 GCC 15.2.0 r7; Ubuntu 26.04 under WSL, GCC 15.2.0. Release,
BUILD_TESTING=ON, the root configuration with the bundled dependency sources;FFMPEG_PREBUILT_DIRpointed at an already unpacked package. Heada1b80121conmain84b01f9cd.relinker,libc,libkernel,libSceAgcDriver,libSceSystemService, the fixture library and the test targets. Then ranloadexec_arguments,guest_system_exit_parameters,guest_system_exit,guest_quick_exit,guest_immediate_exit,guest_return_from_main,guest_system_relaunch,guest_nested_exit,relinker_conversionandrelinker_executables, and on Windows alsoguest_system_service_path_boundary. 11 of 11 pass on Windows (3.47 s) and the 10 that exist on Linux pass (1.13 s).loadexec_argumentsandguest_system_relaunchalso passed 10 repeated runs on Windows.loadexec_argumentsconverts two synthetic0xFE10images with the actual relinker (--executable picker/second.bin) and runs first -> second -> first against the built libraries, under a work directory with Cyrillic and CJK characters. It checks:getargc/getargvfor an empty first argument, spaces, quotes with trailing backslashes, Cyrillic and CJK;/app0resource, and that only the shutdown callbacks run before the handover;/app0,..and unconverted targets are rejected before shutdown.Export.cppfrommainand the new test,loadexec_argumentsfails on both systems withLoadExec fixture: entry argument count.git diff --checkpass.Not tested: a console, macOS, the full test suite. RetroArch was run by YossiYad on Linux as quoted above, not for this rebased head. Full PR builds need a collaborator's manual Build run.
Checklist
main; no other open PR implements this argument handover.mdfiles or images added to the repository🤖 Generated with Claude Code