René's URL Explorer Experiment


Title: `ObjectWrap` cleanup hooks break pre-built addons on Node.js 26.0.0-26.3.1 runtimes · Issue #65262 · nodejs/node · GitHub

Open Graph Title: `ObjectWrap` cleanup hooks break pre-built addons on Node.js 26.0.0-26.3.1 runtimes · Issue #65262 · nodejs/node

X Title: `ObjectWrap` cleanup hooks break pre-built addons on Node.js 26.0.0-26.3.1 runtimes · Issue #65262 · nodejs/node

Description: Version Node.js headers 26.4.0 or newer Node.js runtime 26.0.0 up to and including 26.3.1 Platform Not platform specific, but used: Linux 7.0.0-28-generic #28~24.04.1-Ubuntu x86_64 x86_64 x86_64 GNU/Linux Subsystem src, addons What steps...

Open Graph Description: Version Node.js headers 26.4.0 or newer Node.js runtime 26.0.0 up to and including 26.3.1 Platform Not platform specific, but used: Linux 7.0.0-28-generic #28~24.04.1-Ubuntu x86_64 x86_64 x86_64 GN...

X Description: Version Node.js headers 26.4.0 or newer Node.js runtime 26.0.0 up to and including 26.3.1 Platform Not platform specific, but used: Linux 7.0.0-28-generic #28~24.04.1-Ubuntu x86_64 x86_64 x86_64 GN...

Opengraph URL: https://github.com/nodejs/node/issues/65262

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`ObjectWrap` cleanup hooks break pre-built addons on Node.js 26.0.0-26.3.1 runtimes","articleBody":"### Version\n\nNode.js headers 26.4.0 or newer\nNode.js runtime 26.0.0 up to and including 26.3.1\n\n### Platform\n\n```text\nNot platform specific, but used:\nLinux 7.0.0-28-generic #28~24.04.1-Ubuntu x86_64 x86_64 x86_64 GNU/Linux\n```\n\n### Subsystem\n\nsrc, addons\n\n### What steps will reproduce the bug?\n\nThe crash depends on header and runtime version. So you will need headers from e.g. Node.js 26.4.0 and two runtimes (e.g. 26.2.0 and 26.4.0)\n\n1. Sample that just uses `ObjectWrap`\naddon.cc:\n```c++\n#include \u003cnode.h>\n#include \u003cnode_object_wrap.h>\n\nusing namespace v8;\n\nclass Thing : public node::ObjectWrap {\n public:\n  static void New(const FunctionCallbackInfo\u003cValue>& args) {\n    (new Thing())->Wrap(args.This());\n  }\n};\n\nvoid Init(Local\u003cObject> exports) {\n  Isolate* isolate = Isolate::GetCurrent();\n  Local\u003cContext> context = isolate->GetCurrentContext();\n  Local\u003cFunctionTemplate> tpl = FunctionTemplate::New(isolate, Thing::New);\n  tpl->InstanceTemplate()->SetInternalFieldCount(1);\n  exports->Set(context,\n               String::NewFromUtf8(isolate, \"Thing\").ToLocalChecked(),\n               tpl->GetFunction(context).ToLocalChecked()).Check();\n}\n\nNODE_MODULE(NODE_GYP_MODULE_NAME, Init)\n``` \n\nindex.js:\n```javascript\nconst { Thing } = require('./addon.node');\n\nlet junk = [];\nfor (let i = 0; i \u003c 300000; i++) {\n  new Thing();                          // wrapped object, immediately unreachable\n  junk.push({ a: i });                  // keep allocation rate high so V8 collects on its own\n  if (junk.length > 1000) junk = [];\n}\nconsole.log('survived');\n``` \n\n2. Compile against 26.4.0 (or newer if you want)\n```sh\ng++ -std=c++20 -fPIC -shared \\\n    -I\u003c/path/to/node-v26.4.0-linux-x64/include/node> \\\n    -DNODE_GYP_MODULE_NAME=addon \\\n    -o addon.node addon.cc\n```\n\n3. Run same binary against two different Node.js versions\n```sh\n# this one will run fine\n\u003cpath/to/node_26.4> index.js\n\n# this one will crash\n\u003cpath/to/node_26.2> index.js\n```\n\n### How often does it reproduce? Is there a required condition?\n\n\nDeterministically with 5/5 runs. \nSee this table for when it crashes:\n| hdr \\ rt |  26.0.0 | 26.3.1 | 26.4.0 | 26.7.0 |\n|----------|---------|--------|--------|--------|\n| 26.0.0   | ok      | ok     | ok     | ok     |\n| 26.3.1   | ok      | ok     | ok     | ok     |\n| 26.4.0   | crash   | crash  | ok     | ok     |\n| 26.7.0   | crash   | crash  | ok     | ok     |\n\nI.e. it crashes with headers >= 26.4.0 when runtime \u003c= 26.3.1.\n\nA explicit trigger of the gc via `global.gc()` will not cause the failure, it has to be an allocation-driven one.\n\n### What is the expected behavior? Why is that the expected behavior?\n\nA pre-built addon that is built against headers of one 26.x release should keep working on another 26.x runtime\n\n### What do you see instead?\n\n```\n  #  node[278507]: void node::RemoveEnvironmentCleanupHook(Isolate *, CleanupHook, void *) at ../src/api/hooks.cc:130\n  #  Assertion failed: (env) != nullptr\n\n----- Native stack trace -----\n\n 1: 0x813228 node::Assert(node::AssertionInfo const&) [node]\n 2: 0x891b90 node::RemoveEnvironmentCleanupHook(v8::Isolate*, void (*)(void*), void*) [node]\n 3: 0x73f036ca4045 node::ObjectWrap::RemoveCleanupHook() [/home/user/reproducer/addon.node]\n 4: 0x73f036ca393a node::ObjectWrap::~ObjectWrap() [/home/user/reproducer/addon.node]\n 5: 0x73f036ca41ec Thing::~Thing() [/home/user/reproducer/addon.node]\n 6: 0x73f036ca420c Thing::~Thing() [/home/user/reproducer/addon.node]\n 7: 0x73f036ca3fdd node::ObjectWrap::WeakCallback(v8::WeakCallbackInfo\u003cnode::ObjectWrap> const&) [/home/user/reproducer/addon.node]\n 8: 0xe18a09  [node]\n 9: 0xeb3f61  [node]\n10: 0xec4582  [node]\n11: 0xec425f  [node]\n12: 0x194cdf7  [node]\n13: 0xeb0372  [node]\n14: 0xea3914  [node]\n15: 0xea373c  [node]\n16: 0xea30cf  [node]\n17: 0xe7f25d  [node]\n18: 0x133d781  [node]\n19: 0x73f02763ea76 \nAborted (core dumped)\n``` \n\n### Additional information\n\nThe causing code change in 26.4.0 is the `RemoveCleanupHook();` line added to destructor in commit 7ac3fe1992e189502c9153adbd34a6e38643e208. The call interacts with the improvement of the `RemoveEnvironmentCleanupHook` function in 1723773d4133fc71215a9cbb7e2b9a2a11fc3688.\n\nWhen the destructor is called due to headers being 26.4.0 or newer, but the runtime being \u003c= 26.3.1, then it can trigger the `CHECK_NOT_NULL(env);` of the `RemoveEnvironmentCleanupHook` function. \n\nRefs: #63642 #63985 ","author":{"url":"https://github.com/dyalevog","@type":"Person","name":"dyalevog"},"datePublished":"2026-08-13T11:45:44Z","url":"https://github.com/nodejs/node/issues/65262"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:17dcda39-6a12-4530-e94a-dcd11d3375e4
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC686:3BA6B9:5AF138:792474:6AED1BF9
html-safe-noncee8b8e257d74c7472aa7ca6bff3912c42393ff81b0c851e5063ad07022acbf3b3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNjg2OjNCQTZCOTo1QUYxMzg6NzkyNDc0OjZBRUQxQkY5IiwidmlzaXRvcl9pZCI6Ijg1NzQ0NzU1NTkwOTE2NDEzMzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac266a63f96e0aac728e0d4c1a2dbf6355308df054b00f2223eb856d43338ce250
hovercard-subject-tagissue:5141020394
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/65262/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d4c43726551c97d8a3c093e145158b09998f54f0001f91ca4d8662bf4592fcbf/nodejs/node/issues/65262
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d4c43726551c97d8a3c093e145158b09998f54f0001f91ca4d8662bf4592fcbf/nodejs/node/issues/65262
og:image:altVersion Node.js headers 26.4.0 or newer Node.js runtime 26.0.0 up to and including 26.3.1 Platform Not platform specific, but used: Linux 7.0.0-28-generic #28~24.04.1-Ubuntu x86_64 x86_64 x86_64 GN...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedyalevog
hostnamegithub.com
expected-hostnamegithub.com
None120085d0bcec1f427e3ab45302c8b95f873d26ad21984dc86d62ab2c10158f41
turbo-cache-controlno-preview
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasee12fd03aa775dceadc5a793c3a0791e43ca256bb
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/nodejs/node/issues/65262#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F65262
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F65262
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/issues/65262
Reloadhttps://github.com/nodejs/node/issues/65262
Reloadhttps://github.com/nodejs/node/issues/65262
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues655 (655)https://github.com/nodejs/node/issues
Pull requests666 (666)https://github.com/nodejs/node/pulls
Actionshttps://github.com/nodejs/node/actions
Projectshttps://github.com/nodejs/node/projects
Security and qualityhttps://github.com/nodejs/node/security
Insightshttps://github.com/nodejs/node/pulse
https://github.com/nodejs/node
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/65262
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/65262
ObjectWrap cleanup hooks break pre-built addons on Node.js 26.0.0-26.3.1 runtimeshttps://github.com/nodejs/node/issues/65262#top
addonsIssues and PRs related to native addons.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22addons%22
c++Issues and PRs that require attention from people who are familiar with C++.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22c%2B%2B%22
https://github.com/dyalevog
dyalevoghttps://github.com/dyalevog
on Aug 13, 2026https://github.com/nodejs/node/issues/65262#issue-5141020394
7ac3fe1https://github.com/nodejs/node/commit/7ac3fe1992e189502c9153adbd34a6e38643e208
1723773https://github.com/nodejs/node/commit/1723773d4133fc71215a9cbb7e2b9a2a11fc3688
#63642https://github.com/nodejs/node/pull/63642
#63985https://github.com/nodejs/node/pull/63985
Flarnahttps://github.com/Flarna
addonsIssues and PRs related to native addons.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22addons%22
c++Issues and PRs that require attention from people who are familiar with C++.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22c%2B%2B%22
on Aug 13, 2026https://github.com/nodejs/node/issues/65262#event-29397993810
https://github.com/roy-trgscreen
roy-trgscreenhttps://github.com/roy-trgscreen
on Aug 20, 2026https://github.com/nodejs/node/issues/65262#issuecomment-5361894197
#63642https://github.com/nodejs/node/pull/63642
#65446https://github.com/nodejs/node/issues/65446
everett1992https://github.com/everett1992
on Aug 28, 2026https://github.com/nodejs/node/issues/65262#event-30188193091
src: fix use-after-free in CleanupHookThunkRunhttps://github.com/everett1992/node/commit/6dd9a727d06f34c3873ee30b0b507d4d4d4eb541
6dd9a72https://github.com/everett1992/node/commit/6dd9a727d06f34c3873ee30b0b507d4d4d4eb541
src: fix use-after-free in CleanupHookThunkRunhttps://github.com/everett1992/node/commit/dd2fa31b1d99e5a6710e08ce4139da7c2e344598
dd2fa31https://github.com/everett1992/node/commit/dd2fa31b1d99e5a6710e08ce4139da7c2e344598
nodejs-github-bothttps://github.com/nodejs-github-bot
on Sep 4, 2026https://github.com/nodejs/node/issues/65262#event-30569356761
src: fix use-after-free in CleanupHookThunkRunhttps://github.com/nodejs/node/commit/03e2b9bc42ae9c7ed4fbab5509d70fa934863c44
03e2b9bhttps://github.com/nodejs/node/commit/03e2b9bc42ae9c7ed4fbab5509d70fa934863c44
aduh95https://github.com/aduh95
on Sep 7, 2026https://github.com/nodejs/node/issues/65262#event-30701504444
src: fix use-after-free in CleanupHookThunkRunhttps://github.com/nodejs/node/commit/8cfe7ae316bad7fa6a34760c97f190c5c5d736fe
8cfe7aehttps://github.com/nodejs/node/commit/8cfe7ae316bad7fa6a34760c97f190c5c5d736fe
src: fix use-after-free in CleanupHookThunkRunhttps://github.com/nodejs/node/commit/4eb613360ae1b7534c3149c9763c608a851cf00c
4eb6133https://github.com/nodejs/node/commit/4eb613360ae1b7534c3149c9763c608a851cf00c
everett1992https://github.com/everett1992
on Sep 10, 2026https://github.com/nodejs/node/issues/65262#event-30924559499
src: fix use-after-free in CleanupHookThunkRunhttps://github.com/everett1992/node/commit/fa73926c5f6185eeb1293226f4597f49ee15b42c
fa73926https://github.com/everett1992/node/commit/fa73926c5f6185eeb1293226f4597f49ee15b42c
aduh95https://github.com/aduh95
on Sep 15, 2026https://github.com/nodejs/node/issues/65262#event-31161527637
src: fix use-after-free in CleanupHookThunkRunhttps://github.com/nodejs/node/commit/f66ed89136800e575f624946816cdcf3e28e3aa2
f66ed89https://github.com/nodejs/node/commit/f66ed89136800e575f624946816cdcf3e28e3aa2
panvahttps://github.com/panva
on Sep 20, 2026https://github.com/nodejs/node/issues/65262#event-31479689958
src: fix use-after-free in CleanupHookThunkRunhttps://github.com/panva/node/commit/df46f87997337521f0ad0597dc8c0217b0a576b0
df46f87https://github.com/panva/node/commit/df46f87997337521f0ad0597dc8c0217b0a576b0
aduh95https://github.com/aduh95
on Sep 21, 2026https://github.com/nodejs/node/issues/65262#event-31519157921
src: fix use-after-free in CleanupHookThunkRunhttps://github.com/nodejs/node/commit/5570a84048811920fc8dab615dda36bb9d5f88f9
5570a84https://github.com/nodejs/node/commit/5570a84048811920fc8dab615dda36bb9d5f88f9
Sign up for freehttps://github.com/signup?return_to=https://github.com/nodejs/node/issues/65262
Sign in to commenthttps://github.com/login?return_to=https://github.com/nodejs/node/issues/65262
addonsIssues and PRs related to native addons.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22addons%22
c++Issues and PRs that require attention from people who are familiar with C++.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22c%2B%2B%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.