fix(libSceLibcInternal): fail posix_spawn with ENOENT when the program is not there #6233
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6233"
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 milescoviello on 2026-10-15T06:05:35Z.
What
Dusklight (PPSA99305, catalog 1.0.0) aborts on
maind92a8dad3as soon as Select disc image is chosen on its first menu, with no disc image in its folder:With a temporary print in
posix_spawnp(not part of this PR), the title calls it twice with filezenity, argumentszenity --versionand three file actions. Its next log line names SDL's file dialog:File selection failed: File dialog driver unsupported (supported values for SDL_HINT_FILE_DIALOG_DRIVER are 'zenity' and 'portal'). The port's own patch says the console has no file dialog (dusklight.patch); it takes a disc image from its folder instead.FreeBSD 11.4's
posix_spawnreturns the error the child's exec leaves, and writes the process ID only when the exec succeeds (_posix_spawn_thr,do_posix_spawn).posix_spawnpsearchesPATH, or_PATH_DEFPATHwhen it is unset, and fails withENOENTwhen no directory holds the program (_execvpe,execvPe).Both calls now look for the program in the guest file system the same way. When it is not there they return
ENOENTwithout writing the process ID; when it is there they still throw, since no process is created. This is the same modelsystemalready uses (a sandbox without/bin/sh). The attributes and file actions are not applied, and whether the console lets the child be created at all is unverified;docs/dev/debt/libSceLibcInternal.mdrecords both.guest_posix_spawnnow spawns an existing and a missing program by path, through aPATHsearch (including an empty entry, which means the working directory) and withPATHunset.Tested
Ubuntu 24.04, GCC 13.3, Release, on
maind92a8dad3:guest_posix_spawnpasses 3/3. Withmain'sSpawn.cppand the new checks, it fails 3/3 withposix_spawn: process creation not implementedfor the missing program.guest_*tests pass or skip; the 5guest_video_out_*skips are their own no-display check.--to-inteland run with pad input from 8 s (RTX 4070 Ti, NVIDIA 595.99): onmainit aborts at 8–9 s in 3 of 3 runs, at the first Cross press. With this change, 6 of 7 runs reach the 30–45 s limit: the title logsFile selection failed, stays on its menu, and opens and moves through its Settings window (seen in screenshots). One run exited with code 0 at 11 s. Choosing the title's own Quit item gives the same exit; I did not capture which item that run chose.tools/check_conventions.py --base upstream/mainpasses, andtools/pr_overlap.py --branch fix/spawn-missing-programfinds no overlap.On Windows 11 (RTX 3070, NVIDIA 610.60, MinGW), @DavidSamir ran Dusklight with this PR merged onto
main4eb91eacd.mainaborts at the first Cross withposix_spawnp: process creation not implemented. With this PR, a Cross-only run logsFile selection failed79 times and is still running at its 150 s limit, and a mixed button sequence exits with code 0 at 16 s after reaching the menu's Quit, whose handler only setsIsRunning = false(comment). That also accounts for my one code-0 run.Not checked on a console.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:17:09Z.
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.
docs/dev/debt/libSceLibcInternal.mdcore/libs/tests/GuestPosixSpawn.cppcore/libs/prx/libSceLibcInternal/Spawn.cppdocs/dev/debt/libSceLibcInternal.mdImported from boykopovar/AnyPS5. Originally posted by DavidSamir on 2026-10-15T23:18:40Z.
Windows result for this PR, with Dusklight (PPSA99305, catalog 1.0.0).
Setup: Windows 11, RTX 3070 (NVIDIA 610.60), MinGW build. This PR's head 3d42bdf0c5 merged onto
main4eb91eacdf. Relinked with--windows --registry, then run with pad input throughAPS5_PAD_INPUT_FILE, starting about 12 s after launch.main(b7cedd900d;Spawn.cppis the same on4eb91eacdf): aborts at 7 s, at the first Cross press.File selection failed: File dialog driver unsupported (supported values for SDL_HINT_FILE_DIALOG_DRIVER are 'zenity' and 'portal')3 times and stays on its menu. It then exits with code 0 at 16 s, loggingexit status 0: asking the shell to close the title.File selection failed79 times and is still running when the 150 s limit stops it. It has nowhat()line and no exit.On the code-0 exit you saw once: the prelaunch menu at the pinned dusklight commit 34a144a49 has Select Disc Image, Settings, Mods and Quit. Quit's handler only sets
IsRunning = false(prelaunch.cpp). The Cross-only run never leaves Select Disc Image and never exits. So in my runs the code-0 exit comes from the mixed sequence reaching Quit, not from this change.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-15T23:21:39Z.
@DavidSamir thanks for the Windows run, and for tracing the code-0 exit to the menu's Quit. That explains my one odd run too. I added your result to the description.
AI-assisted: yes (Claude Code)