openai / openai/codex

Codex App leaves thousands of zombie processes and eventually causes spawn EAGAIN

Open
#38,505 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug performance
Dominant language
Rust
Stars
125k
Forks
19.5k
PR merge metrics
PR metrics pending

Description

What version of the Codex App are you using (From “About Codex” dialog)?

26.730.61639

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Darwin 22.6.0 arm64 arm

What issue are you seeing?

The Codex desktop app appears to leave terminated tool subprocesses as zombie processes on macOS.

After using Codex for several hours and running many shell commands/tests, new commands begin failing with errors such as:

spawn sh EAGAIN
fork failed: resource temporarily unavailable

I inspected the process table and found approximately 2,280 zombie (Z, <defunct>) processes. All of them had the same parent process:

/Applications/ChatGPT.app/Contents/MacOS/ChatGPT

The Codex App version is 26.730.61639.

The project processes themselves, including Vite, Electron, Node.js, and esbuild, were still in normal S/S+ states. The zombies were all direct children of the ChatGPT/Codex desktop process.

It appears that child processes created for tool or shell execution are exiting but are not being reaped by the desktop parent process. The zombie count increases over time until the macOS process limit is reached.

Expected behavior:
Exited tool subprocesses should be reaped immediately, and long Codex sessions should not exhaust the process table.

Actual behavior:
Zombie processes accumulate during the session and eventually prevent Codex and other applications from spawning new processes.

Workaround:
Fully quitting and reopening the Codex/ChatGPT desktop app clears the zombie processes. Closing only the task or window does not resolve it.

What steps can reproduce the bug?
  1. Open the Codex desktop app on macOS.

  2. Start a local coding task.

  3. Let Codex execute many shell commands, builds, and test scripts over an extended session.

  4. Check the process table periodically with:

    ps -axo pid,ppid,stat,etime,command

  5. Observe that terminated subprocesses remain in the Z state as <defunct>.

  6. Continue using Codex until enough zombie processes accumulate.

  7. Eventually, shell and test commands fail with:

    spawn sh EAGAIN

    or:

    fork failed: resource temporarily unavailable

In my case, approximately 2,280 zombie processes accumulated. Every zombie process had the Codex/ChatGPT desktop process as its parent:

/Applications/ChatGPT.app/Contents/MacOS/ChatGPT

Fully quitting and reopening the desktop app clears the zombie processes temporarily.

What is the expected behavior?

No response

Additional information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the macOS failure by running many shell commands in the Codex desktop app, then inspect ps -axo pid,ppid,stat,etime,command and confirm that exited children remain defunct. Trace the desktop app's subprocess lifecycle and process-parent behavior; done means exited tool processes are reaped and extended sessions no longer accumulate zombies or trigger spawn sh EAGAIN.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, rust
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.