-
Notifications
You must be signed in to change notification settings - Fork 297
fix: /dev/ptmx leak on macOS #882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+97
−31
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Jan 28, 2026
Tyriar
previously approved these changes
Jan 28, 2026
Member
Tyriar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test failing, unrelated?
8ed87a2 to
565182e
Compare
Tyriar
previously approved these changes
Jan 28, 2026
dmitrivMS
approved these changes
Jan 28, 2026
1 task
speakman
added a commit
to speakman/happy
that referenced
this pull request
Feb 10, 2026
node-pty v1.1.0 has an off-by-one bug in pty_posix_spawn() on macOS where low_fds[0] (allocated via posix_openpt()) is never closed due to a buggy cleanup loop (`count > 0` vs the correct `i <= count`). This leaks 1 PTY master fd per pty.spawn() call, eventually exhausting all 511 PTY pairs on macOS (kern.tty.ptmx_max). Upstream fix: microsoft/node-pty#882 (merged 2026-01-28). Also fixes the abort handler to kill the entire process group (-pid) with SIGTERM instead of sending SIGHUP to just the launcher PID, ensuring the Claude binary grandchild is also terminated.
This was referenced Feb 10, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For microsoft/vscode#182212
The ptmx leak was from
low_fds[0]that was always opened and never closed. Drive by improvement for error propagation and failure case cleanups.