libuv: fix kqueue assertion crash on Darwin#523677
Draft
mkg20001 wants to merge 2 commits into
Draft
Conversation
There was a problem hiding this comment.
The PR's base branch is set to master, but this PR causes 37992 rebuilds.
It is therefore considered a mass rebuild.
Please change the base branch to the right base branch for your changes (probably staging).
libuv's kqueue poller (`uv__io_poll` in `kqueue.c`) asserts that when `kevent()` returns -1, `errno` must be `EINTR`. However, `kevent()` can also return `EBADF` when a file descriptor is closed while still in the kqueue changelist, or `ENOENT` when removed between changelist submit and the kevent call. This surfaces as an `Abort trap: 6` (SIGABRT) on Darwin when running pnpm in the Nix build sandbox with Node.js 24.15.0+, due to changes in ArrayBuffer transfer semantics that alter FD lifecycle timing. The fix relaxes the assertion to accept EBADF and ENOENT in addition to EINTR, all of which are transient conditions that the existing retry logic already handles correctly. Reproducer: `pnpm install --force` with 1400+ packages in nix sandbox. Upstream: libuv/libuv#976 Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4bba260 to
991253a
Compare
Now that libuv's kqueue assertion is fixed, openclaw no longer needs the nodejs_22 workaround for pnpm and can use pnpm_11 with its default Node.js (24.15.0). Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Description
Fixes a
SIGABRT(Abort trap: 6) crash caused by libuv's kqueue poller assertingerrno == EINTRafterkevent()fails.kevent()can also returnEBADF(closed fd still in changelist) orENOENT(fd removed between changelist submit and kevent call). This triggers most reliably with Node.js 24.15.0+ running pnpm with large package sets (1400+ packages) inside the Nix build sandbox, due to changes in ArrayBuffer transfer semantics (nodejs/node#61372) that alter file descriptor lifecycle timing.The assertion (
src/unix/kqueue.c:279) is present in libuv 1.52.1 (latest). The patch relaxes it to acceptEBADFandENOENTalongsideEINTR— all transient conditions that the existing retry logic already handles correctly.Root cause chain:
kevent()returnsEBADFinstead ofEINTRassert(errno == EINTR)fires → SIGABRTUpstream references:
Assisted-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.