Codex App leaves thousands of zombie processes and eventually causes spawn EAGAIN
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 EAGAINfork 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?
- Open the Codex desktop app on macOS.
- Start a local coding task.
- Let Codex execute many shell commands, builds, and test scripts over an extended session.
- Check the process table periodically with:
ps -axo pid,ppid,stat,etime,command
- Observe that terminated subprocesses remain in the
Zstate as<defunct>. - Continue using Codex until enough zombie processes accumulate.
- 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_
1 Comment
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action