Repository navigation
fix: update NAPI to fix V8 foreground task crashes and GC stalls - #170
Merged
Merged
Conversation
Advance the napi submodule from a65e9cb8 to NAPI main at dfc50c75. - wasmerio/napi#113 stops the V8 provider from touching a foreground task after handing it to Edge's enqueue hook. Native Edge crashed in PostTaskCommon (SIGSEGV/SIGBUS) when the hook refused a task during env cleanup, mostly in vm and worker_threads tests at exit. - wasmerio/napi#117 runs at most one fallback foreground task per event loop checkpoint, so self-reposting GC tasks no longer stall the V8 WASIX event loop. The bump also brings wasmerio/napi#87, #88, #90, #91, #92, #103 and #104. Public header changes are comments only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
syrusakbary
added a commit
that referenced
this pull request
Oct 27, 2026
Brings in the napi bump with the V8 foreground-task fixes (#170), the worker termination fix (#171) and the HTTP/2 use-after-free fixes (#172). The napi pins conflicted: this branch needs the realm-env provider (wasmerio/napi#112) and main moved napi forward. napi now points at e23b3b1, the head of wasmerio/napi#112, which has napi main merged in and so includes both. Co-Authored-By: Claude Opus 5.5 <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.
Summary
Advance the
napisubmodule froma65e9cb8to NAPImainatdfc50c75. It brings two V8 provider fixes that Edge depends on:EnqueueForegroundTaskFromEngine). When the hook refused a task, for example once env cleanup had started, the provider freed it a second time. Native Edge crashed inPostTaskCommon(SIGSEGV/SIGBUS), mostly innode:vmandnode:worker_threadstests at process exit.host_tasks_admittedbit as "take another turn without waiting on libuv", so no Edge change is needed.The bump also brings wasmerio/napi#87, #88, #90, #91, #92, #103 and #104. Public header changes are comments only.
Testing
macOS arm64, Release, Edge
main(18b0ce9e) with this pin:make test-only(V8 native)make test-intl,make test-lang(V8 native)make validate-wasix-imports,make test-wasix-import-validatormake test-wasix-v8-only(-j 8)make test-wasix-v8-processmake framework-test-v8-wasix js-astro-ssr-standaloneBefore the merge, I compared Edge against napi
mainwith and without both fixes:node:vm,node:worker_threads,node:module,node:timers,node:processandnode:v8categories (not in CI), crashes fell from 5–9 per round to 1–2. Crash reports insidePostTaskCommonfell from 13 to 0. No test failed only with the fixes applied.Notes for reviewers
napitobdc85884; that commit is included here.unofficial_napi_terminate_executionfromEdgeWorkerStopAllForEnvduringprocess.exit(), andtest-worker-stack-overflow-stack-size.DrainForegroundTasksFromState(src/edge_runtime_platform_v8.cc) returns early on a pending exception, it drops the rest of its batch without calling each task's cleanup. The provider's env release waits for those tasks, so it can hang. I haven't reproduced the hang.🤖 Generated with Claude Code