fix(cli): suppress OSError EINVAL on macOS kqueue stdin registration#20482
Closed
CN-big-cabbage wants to merge 1 commit into
Closed
fix(cli): suppress OSError EINVAL on macOS kqueue stdin registration#20482CN-big-cabbage wants to merge 1 commit into
CN-big-cabbage wants to merge 1 commit into
Conversation
On macOS with uv-managed Python (cpython-3.11.11-aarch64), kqueue cannot register stdin (fd 0) for EVENT_READ and raises: OSError: [Errno 22] Invalid argument (errno.EINVAL) The existing handler only suppressed errno.EIO (5), so EINVAL (22) fell through to `else: raise`, printing a full traceback on exit. Add errno.EINVAL to the suppressed set — same silent-pass treatment as EIO — since the root cause is the same uv/kqueue incompatibility already documented in the surrounding comment.
Collaborator
13 tasks
Contributor
|
Closing — superseded by #26077 (merged as commit d3d5916), which preventively probes kqueue at startup and falls back to SelectSelector when fd 0 cannot be registered. The widened except-clause matching EINVAL / EBADF / 'Invalid argument' — which most PRs in this cluster including yours added — is also included. Thanks for the fix; closing as duplicate of the merged work. |
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
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.
Problem
On macOS with uv-managed Python (
cpython-3.11.11-macos-aarch64), Hermes crashes with a full traceback on exit:Root cause: kqueue cannot register stdin (
fd 0) forEVENT_READand raisesOSErrorwitherrno.EINVAL(22). The existing handler atcli.py:11937only suppressederrno.EIO(5), soEINVALfell through toelse: raise.Fix
Add
errno.EINVALto the suppressed errno set — same silent-pass treatment asEIO— since the root cause is the same uv/kqueue incompatibility already documented in the surrounding comment.Test plan
hermeson macOS with uv-managed Python (cpython-3.11.11-macos-aarch64)🤖 Generated with Claude Code