Skip to content

fix(libSceLibcInternal): allow omitted spawn PID outputs - #11869

Merged
oneandonlydean merged 3 commits into
boykopovar:mainfrom
santhoshkumar-dev:codex/spawn-optional-pid
Nov 2, 2026
Merged

oneandonlydean merged 3 commits into
boykopovar:mainfrom
santhoshkumar-dev:codex/spawn-optional-pid

Conversation

@santhoshkumar-dev

Copy link
Copy Markdown
Contributor

What

A successful posix_spawn or posix_spawnp with a null PID output currently crashes when the host path stores the child PID. Supply a call-local output when the caller omits it, allowing both host paths to create and retain the child for later waitpid reaping.

This follows FreeBSD 11.4's conditional PID store. Console acceptance of an omitted PID output has not been measured and is recorded in library debt.

The separate fixture exercises both guest wrappers, reaps the real child and checks exit status 43, and checks missing-program and null-argument errors with no PID output. It uses a private working directory and accounts for the Windows launcher's extra executable argument.

Tested

Submitted and tested head 31b57368e60ad9d2bd42cc26663b8145137011de, based on main 3fea2a937ba9fbab2f06c51691fe0c5763659aa3.

  • Linux regression-only head db8cb1ba82410385ea338b8d05a59b680ef11c08 reproduced a segmentation fault on the first successful spawn with a null PID output.
  • Windows 11 x64 / WinLibs GCC 15.2.0 r7 and local Ubuntu 24.04.1 x86-64 under WSL2 / GCC 13.3.0 / glibc 2.39: Ninja Release, bundled dependencies, BUILD_TESTING=ON, ANYPS5_ENABLE_SPIRV_TOOLS=OFF. The complete libs target and both selected spawn executables build on each platform.
  • On each platform the public-header audit passes, and existing guest_posix_spawn plus new guest_posix_spawn_optional_pid each pass three consecutive runs, zero skips.

These results cover library builds and the listed focused tests. No full application/test-suite, macOS, title or physical-console run is claimed.

Final upstream 3fea2a937ba9fbab2f06c51691fe0c5763659aa3 merges cleanly; no files changed by this contribution changed after the tested base. Open/closed/merged history was checked, with no replacement found. Conventions and whitespace pass, and this merges cleanly with #11841, #11866 and the three maintained FreeType PRs.

The overlap scan's uncomparable shared files with #5021 and #10749 were checked manually. #5021 has the same existing CMake/debt conflicts with main and with this contribution, outside the optional-PID changes; #10749's shared debt file merges cleanly both ways.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 14837 docs/dev/debt/libSceLibcInternal.md L342

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.

Pull request Shared files not compared
PR 5021 core/libs/prx/libSceLibcInternal/CMakeLists.txt
docs/dev/debt/libSceLibcInternal.md
PR 13782 core/libs/prx/libSceLibcInternal/CMakeLists.txt
docs/dev/debt/libSceLibcInternal.md
PR 14212 docs/dev/debt/libSceLibcInternal.md
PR 14373 core/libs/prx/libSceLibcInternal/CMakeLists.txt
docs/dev/debt/libSceLibcInternal.md
PR 14936 core/libs/prx/libSceLibcInternal/CMakeLists.txt
docs/dev/debt/libSceLibcInternal.md

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the synchronous PID handoff on both POSIX and Windows paths, the local fallback lifetime, and the regression test for both wrappers, child reaping, missing executable and null arguments. The PR reports repeated focused Linux and Windows runs; hosted Windows now passes, all policy checks pass, and current main is the tested base. The exact diff has no additional issue. I did not independently run the two platform builds.

@babyhuey

Copy link
Copy Markdown
Contributor

Windows run of this head 31b57368e60, merged onto main 8ff4baf5348 (clean merge, local only), with the selection CI's skipped Windows product job uses: Windows 11, Ryzen 7 5800X, RTX 3080, WinLibs GCC 15.2, Release, BUILD_TESTING=ON. The tree was configured fresh after the merge, then select_tests.py select / ninja -f select.ninja selected / --target libs / select_tests.py ctest --parallel 4 --timeout 120.

AI-assisted: yes (Claude Code)

@santhoshkumar-dev

Copy link
Copy Markdown
Contributor Author

A respectful nudge for a maintainer look whenever the queue allows — I know how many open PRs this project carries, and I appreciate that every one eventually gets read despite the volume.

@oneandonlydean @adriadam10: this one is approved with all checks green, so it should be a quick land whenever it reaches the top of the pile. No rush intended — and sincerely, thank you both for the endless work you put into this project. It does not go unnoticed.

@oneandonlydean
oneandonlydean merged commit 8697910 into boykopovar:main Nov 2, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants