Title: Terminating a worker while it evaluates the parent of a top-level-await module aborts the process · Issue #67550 · nodejs/node · GitHub
Open Graph Title: Terminating a worker while it evaluates the parent of a top-level-await module aborts the process · Issue #67550 · nodejs/node
X Title: Terminating a worker while it evaluates the parent of a top-level-await module aborts the process · Issue #67550 · nodejs/node
Description: Version v26.13.0, v24.15.0, v22.22.3 Platform Darwin 25.6.0 arm64 Subsystem esm, worker_threads What steps will reproduce the bug? tla.mjs: await 0 parent.mjs: import { parentPort } from 'node:worker_threads' import './tla.mjs' parentPor...
Open Graph Description: Version v26.13.0, v24.15.0, v22.22.3 Platform Darwin 25.6.0 arm64 Subsystem esm, worker_threads What steps will reproduce the bug? tla.mjs: await 0 parent.mjs: import { parentPort } from 'node:work...
X Description: Version v26.13.0, v24.15.0, v22.22.3 Platform Darwin 25.6.0 arm64 Subsystem esm, worker_threads What steps will reproduce the bug? tla.mjs: await 0 parent.mjs: import { parentPort } from 'node:...
Opengraph URL: https://github.com/nodejs/node/issues/67550
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Terminating a worker while it evaluates the parent of a top-level-await module aborts the process","articleBody":"### Version\n\nv26.13.0, v24.15.0, v22.22.3\n\n### Platform\n\nDarwin 25.6.0 arm64\n\n### Subsystem\n\nesm, worker_threads\n\n### What steps will reproduce the bug?\n\ntla.mjs:\n\n```js\nawait 0\n```\n\nparent.mjs:\n\n```js\nimport { parentPort } from 'node:worker_threads'\nimport './tla.mjs'\n\nparentPort.postMessage('running')\nconst end = Date.now() + 5000\nwhile (Date.now() \u003c end);\n```\n\nmain.mjs:\n\n```js\nimport { Worker } from 'node:worker_threads'\nimport { once } from 'node:events'\n\nconst worker = new Worker(new URL('./parent.mjs', import.meta.url))\nawait once(worker, 'message')\nawait worker.terminate()\nconsole.log('terminated without crashing')\n```\n\n`node main.mjs`\n\n### How often does it reproduce? Is there a required condition?\n\nEvery time. parent.mjs has no top-level await, but it imports a module that does. So V8 runs parent.mjs's body from `AsyncModuleExecutionFulfilled` after tla.mjs settles, and the worker is terminated while that body is running. If you remove the `await` from tla.mjs, the worker terminates cleanly.\n\n### What is the expected behavior? Why is that the expected behavior?\n\n`worker.terminate()` stops the worker, and main.mjs prints `terminated without crashing`.\n\n### What do you see instead?\n\n```\n#\n# Fatal error in , line 0\n# Check failed: !is_null().\n#\n----- Native stack trace -----\n\n 1: node::NodePlatform::GetStackTracePrinter()::$_0::__invoke()\n 2: V8_Fatal(char const*, ...)\n 3: v8::internal::SourceTextModule::ExecuteAsyncModule(v8::internal::Isolate*, v8::internal::DirectHandle\u003cv8::internal::SourceTextModule>) (.cold.1)\n 4: v8::internal::SourceTextModule::AsyncModuleExecutionFulfilled(v8::internal::Isolate*, v8::internal::Handle\u003cv8::internal::SourceTextModule>)\n 5: v8::internal::Builtin_CallAsyncModuleFulfilled(int, unsigned long*, v8::internal::Isolate*)\n 6: Builtins_CEntry_Return1_ArgvOnStack_BuiltinExit\n 7: Builtins_PromiseFulfillReactionJob\n 8: Builtins_RunMicrotasks\n ...\n24: node::worker::Worker::Run()\n```\n\nThe process exits with code 133. On v22 and v24 the message is `Check failed: (location_) != nullptr.`\n\n### Additional information\n\n`ExecuteModule` fails with the termination exception and leaves `exception` empty. `AsyncModuleExecutionFulfilled` then calls `exception.ToHandleChecked()` on it. V8 fixed this in https://github.com/v8/v8/commit/be84cdeee94e (\"[d8] Handle termination exception in async modules\"), which returns early when execution is terminating, and main has it through the V8 update. v22.x, v24.x and v26.x don't have it, so it needs a cherry-pick.\n\nProbably the same crash as #53238 and #62114, both closed without a repro.\n","author":{"url":"https://github.com/ronag","@type":"Person","name":"ronag"},"datePublished":"2026-11-17T17:09:45Z","url":"https://github.com/nodejs/node/issues/67550"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b67bfad4-855d-4b56-fb3d-7925874b407d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 90C6:1F59E8:1AF733B:23CC8D7:6B033645 |
| html-safe-nonce | bd9253cb69925a7278a62d5b0391171ce9069ea97b3254b6bafe0b47a0b1bfc1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MEM2OjFGNTlFODoxQUY3MzNCOjIzQ0M4RDc6NkIwMzM2NDUiLCJ2aXNpdG9yX2lkIjoiMTIzNDU2NTkxODQxNjM4NTYwNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2ea6c1c63b8c830f40ca07eea206c77c471d1f526f30faabec20fb65d170663a |
| hovercard-subject-tag | issue:6449963845 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/67550/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b6a978c017fd260b88bf395cd927f7c6387a317f99b77e2d03357803e235ab27/nodejs/node/issues/67550 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b6a978c017fd260b88bf395cd927f7c6387a317f99b77e2d03357803e235ab27/nodejs/node/issues/67550 |
| og:image:alt | Version v26.13.0, v24.15.0, v22.22.3 Platform Darwin 25.6.0 arm64 Subsystem esm, worker_threads What steps will reproduce the bug? tla.mjs: await 0 parent.mjs: import { parentPort } from 'node:work... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ronag |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width