[Bug] ChatGPT Desktop App leaks defunct (zombie) child processes during local agent/code execution tasks
What version of the Codex App are you using (From “About Codex” dialog)?
26.730.61639
What subscription do you have?
Plus
What platform is your computer?
macOS sonoma 14.0 (23A344)
What issue are you seeing?
▎ Child Process Leak (<defunct> Zombie Processes): The ChatGPT Desktop App on macOS fails to reap child processes after running local Agent/code execution tasks. Hundreds of <defunct> processes accumulate under the ChatGPT
▎ process until the OS user process limit (ulimit -u) is reached, causing zsh: fork failed: resource temporarily unavailable errors across the system.
What steps can reproduce the bug?
Bug Description
When running local Agent tasks or code execution using the ChatGPT Desktop Application (Mac), the app spawns child processes (e.g., bash/python processes). After the child processes terminate, the main ChatGPT parent process
(/Applications/ChatGPT.app/Contents/MacOS/ChatGPT) fails to reap them (e.g., missing wait() / waitpid() or SIGCHLD handling).
Over time, hundreds of <defunct> zombie processes accumulate under the ChatGPT PPID until the OS user process limit (ulimit -u) is exhausted, throwing:
zsh: fork failed: resource temporarily unavailable.
---
### Environment
- OS: macOS (Darwin aarch64 / Apple Silicon)
- Application: ChatGPT Desktop App (
/Applications/ChatGPT.app) - Version: [Insert your ChatGPT App Version here, e.g. 1.2024.x]
---
### Steps to Reproduce
- Open ChatGPT Desktop App on macOS.
- Run multiple code execution tasks or local Agent tasks that invoke sub-shells/tools.
- Open a terminal and check zombie child processes hanging under the ChatGPT PPID:
```bash
ps -A -o ppid,stat,command | grep "<defunct>"
- Observe hundreds of <defunct> processes accumulated under the main ChatGPT process PID.
What is the expected behavior?
---
Expected Behavior
The parent ChatGPT process should handle SIGCHLD or asynchronously call waitpid() to reap terminated child processes immediately after task completion.
---
Actual Behavior
Child processes remain as <defunct> in the macOS process table indefinitely until the ChatGPT Desktop Application is completely quit (Cmd + Q).
---
Workaround & Impact
- Impact: High. Fails terminal execution (fork failed: resource temporarily unavailable) across the system once maxproc limit is reached.
- Temporary Workaround: Quit ChatGPT Desktop App completely (Cmd + Q).
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