Skip to content

fix(process): safely exit forked child with _exit#1285

Merged
wash2 merged 2 commits into
masterfrom
spawn-fork-exit-fix
May 18, 2026
Merged

fix(process): safely exit forked child with _exit#1285
wash2 merged 2 commits into
masterfrom
spawn-fork-exit-fix

Conversation

@mmstick

@mmstick mmstick commented May 18, 2026

Copy link
Copy Markdown
Member

Replaces #1284

Though I cannot replicate it, this may fix some of the reports of the cosmic-app-library failing to open after spawning an application. And may fix the issue with NVIDIA GPUs having the validation error after spawning an application?

  • Use waitpid to wait for the PID of the initial fork in the double fork to exit.
  • Use libc::_exit in that initial fork after writing the PID of the double-forked child. This should ensure it exits without potentially affecting the state of the parent process.

After merging, this should be pulled in by cosmic-app-library, cosmic-files, and cosmic-launcher


  • I have disclosed use of any AI generated code in my commit messages.
    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

Co-Authored-By: Michael Murphy <michael@mmurphy.dev>
@mmstick mmstick requested review from a team May 18, 2026 13:03
@wash2 wash2 merged commit 6f863f1 into master May 18, 2026
15 checks passed
@wash2 wash2 deleted the spawn-fork-exit-fix branch May 18, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants