16 Commits
Author SHA1 Message Date
Adrià 6eae433fad Merge pull request #11801 from jotitadev/fix/macos-waitpid-child-signals
fix(libkernel): report a child's stop and kill signals correctly on macOS hosts
2026-10-28 17:35:55 +01:00
AdriàandClaude Sonnet 5.5 db6d1c5dd2 fix(main): keep the stopped spawn child alive until its continued status is read
Run 40579197008 (main 771d8b5bf7) failed guest_posix_spawn. Under load the child
of CheckStoppedChild exits right after SIGCONT, so waitpid(WCONTINUED) reports the
exit instead of 0x13 (reproduced with 24 CPU spinners via ctest --repeat). The
child now sleeps 2 s after the stop.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-27 22:42:08 +01:00
Adrià 46fe6f2437 Merge pull request #11358 from krishalivaibhav/fix/macos-posix-spawn-environ
fix(libSceLibcInternal): declare environ for the spawn test on macOS
2026-10-27 22:01:08 +01:00
Jota 5e75bae0ce fix(libkernel): keep the host signal numbers in waitpid on macOS hosts
waitpid translated the stop and termination signal of a child from the
Linux numbering to the FreeBSD one on every non-Windows host. Darwin
already numbers its signals like FreeBSD, so on macOS the translation
broke them: a child stopped by SIGSTOP (17) was reported as stopped by
20, SIGBUS (10) as 30, SIGSYS (12) as 31, and a child killed by SIGUSR1 (30)
made waitpid report a missing guest equivalent.

macOS now passes the host signal through. The spawn test finds its own
executable with _NSGetExecutablePath on macOS instead of /proc/self/exe,
and also checks a child killed by SIGUSR1, whose number differs between
Linux and FreeBSD and which macOS used to reject.
2026-10-27 05:05:29 -03:00
José AlissonandClaude Opus 5.5 fd2f9aca2f test(libSceLibcInternal): pass the spawn test's environment as UTF-8 on Windows
The child environment was copied from _environ, which holds the ANSI code
page, so any non-ASCII variable made posix_spawn reject it as invalid UTF-8.
Read the wide environment block and convert each entry to UTF-8 instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 09:59:12 -03:00
krishalivaibhavandClaude Opus 5.5 4580ed6301 fix(libSceLibcInternal): declare environ for the spawn test on macOS
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 13:38:53 +05:30
Adrià FranchandClaude Sonnet 5.5 2bfcf6166a fix(libSceLibcInternal): give the spawned test child the parent environment plus its role
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-25 13:57:38 +01:00
Adrià Franch 4a913acbd6 fix(libSceLibcInternal): declare waitpid in the spawn test through the libkernel header 2026-10-25 13:57:18 +01:00
fogydes bde7cc210a fix(libkernel): report ECHILD to a Windows waiter another thread reaps first 2026-10-25 13:57:18 +01:00
fogydes 0514307ab8 fix(libkernel): translate waitpid child statuses to the guest numbering 2026-10-25 13:57:18 +01:00
fogydes 723d932f73 feat(libSceLibcInternal): implement posix_spawn process creation and reaping 2026-10-25 13:57:17 +01:00
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
Adrià 6e27fc8f07 Merge pull request #6233 from milescoviello/fix/spawn-missing-program
fix(libSceLibcInternal): fail posix_spawn with ENOENT when the program is not there
2026-10-18 22:37:14 +02:00
T3cm0andClaude Opus 5.5 f9b7b230fc feat(libSceLibcInternal): implement the remaining posix_spawnattr accessors
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 20:41:26 -05:00
milescovielloandClaude Opus 5.5 a7c68a3919 fix(libSceLibcInternal): fail posix_spawn with ENOENT when the program is not there
Dusklight (PPSA99305) aborts on main as soon as its Select disc image
item is chosen: SDL's file dialog probes "zenity --version" through
posix_spawnp, and posix_spawnp throws "process creation not implemented".

FreeBSD 11.4's posix_spawn returns the error of the child's exec, and
an exec of a program that is in no directory of PATH (_PATH_DEFPATH
when PATH is unset) fails with ENOENT. Both calls now return ENOENT
without writing the process ID when the program is not in the guest
file system, and keep throwing when it is. SDL then reports the file
dialog as unsupported and the title stays on its menu.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 18:31:37 +00:00
DavidandClaude Fable 5.1 2fe382c658 feat(libSceLibcInternal): implement the posix_spawn attribute and file action calls
XPSemu (PPSA97358) imports eleven posix_spawn calls from
libSceLibcInternal.prx, one reference each, and no call site is known.
Predicted stop (import order, not measured), behind isnanf (idx 296):
`FAIL: unresolved ELF import 44hlATrd47U from libSceLibcInternal.prx`
(posix_spawnattr_init, idx 347), followed by p--TkNVsXjA, LG6O0oW9bQU,
Sj7y+JO5PcM, Ud8CbISKRGM, Hq9-2AMG+ks, IUfBO5UIZNc, Heh4KJwyoX8 (348-355),
UV4m0bznVtU, Ani6e+T-y6Q and 3Nr9caNHhyg (379-381).

The nine object calls follow FreeBSD release/11.4.0 (8c639945a445)
lib/libc/gen/posix_spawn.c: posix_spawnattr_init allocates a zeroed
attribute object (ENOMEM on failure), _destroy frees it, _setflags and
_setsigdefault store the value; posix_spawn_file_actions_init allocates an
empty list (-1 on failure, as in 11.4), _destroy frees it with its
entries, and _addopen (path copied), _adddup2 and _addclose append in
order after returning EBADF for a negative descriptor. Null or
uninitialized objects, which FreeBSD dereferences, throw.

posix_spawn and posix_spawnp throw "process creation not implemented",
as execvp does: FreeBSD validates no argument before rfork/vfork, and no
child process can be created here. TechnicalDebt records them.
guest_posix_spawn covers the attribute round trips, the recorded action
sequence, the EBADF cases and the throws. NIDs computed with
tools/nid_names.py and present in aerolib.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-13 07:56:19 +00:00