Title: diagnostics_channel: Channel::binding_data_ dangles after environment cleanup, crashing node:sqlite at exit · Issue #65858 · nodejs/node · GitHub
Open Graph Title: diagnostics_channel: Channel::binding_data_ dangles after environment cleanup, crashing node:sqlite at exit · Issue #65858 · nodejs/node
X Title: diagnostics_channel: Channel::binding_data_ dangles after environment cleanup, crashing node:sqlite at exit · Issue #65858 · nodejs/node
Description: Version v27.0.0-pre (2dfdb6a4206) Platform Darwin 25.6.0 arm64 Subsystem diagnostics_channel, sqlite What steps will reproduce the bug? Channel holds its BindingData as a raw pointer that is never cleared, so any native holder that outli...
Open Graph Description: Version v27.0.0-pre (2dfdb6a4206) Platform Darwin 25.6.0 arm64 Subsystem diagnostics_channel, sqlite What steps will reproduce the bug? Channel holds its BindingData as a raw pointer that is never ...
X Description: Version v27.0.0-pre (2dfdb6a4206) Platform Darwin 25.6.0 arm64 Subsystem diagnostics_channel, sqlite What steps will reproduce the bug? Channel holds its BindingData as a raw pointer that is never ...
Opengraph URL: https://github.com/nodejs/node/issues/65858
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"diagnostics_channel: Channel::binding_data_ dangles after environment cleanup, crashing node:sqlite at exit","articleBody":"### Version\n\nv27.0.0-pre (`2dfdb6a4206`)\n\n### Platform\n\n```text\nDarwin 25.6.0 arm64\n```\n\n### Subsystem\n\ndiagnostics_channel, sqlite\n\n### What steps will reproduce the bug?\n\n`Channel` holds its `BindingData` as a raw pointer that is never cleared, so any native holder that outlives environment cleanup reads a destroyed object. Here's a replication case using `node:sqlite`:\n\n```js\nconst dc = require('node:diagnostics_channel');\nconst { DatabaseSync } = require('node:sqlite');\n\ndc.subscribe('sqlite.db.query', () => {});\n\nconst db = new DatabaseSync(':memory:');\ndb.exec('CREATE TABLE t(x)');\nconst ins = db.prepare('INSERT INTO t VALUES (?)');\nfor (let i = 0; i \u003c 200; i++) ins.run(i);\n\n// Start iterating and abandon it: the statement stays mid-step, so the\n// finalize that happens at teardown fires SQLite's profile callback.\nconst it = db.prepare('SELECT * FROM t').iterate();\nit.next();\nglobalThis.keepAlive = { db, it };\nconsole.log('reached end of script');\n```\n\n### How often does it reproduce? Is there a required condition?\n\nThree conditions are required (all included in the example above):\n\n1. A subscriber on `sqlite.db.query`, so the SQLite profile hook is installed.\n2. A statement left mid-step at exit, so that the finalize during teardown has a started statement to profile.\n3. No explicit `close()`, so the statement is finalized by the destructor chain after `Environment::RunCleanup()` rather than before it.\n\n### What is the expected behavior? Why is that the expected behavior?\n\nExiting a process that used `node:sqlite` with a `sqlite.db.query` subscriber\nshouldn't crash.\n\n### What do you see instead?\n\n`SIGSEGV`, exit 139, after the script has finished.","author":{"url":"https://github.com/TrevorBurnham","@type":"Person","name":"TrevorBurnham"},"datePublished":"2026-09-06T15:31:06Z","url":"https://github.com/nodejs/node/issues/65858"}
| 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:ae8d2df4-2950-906d-d12a-9607953b2329 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D55A:2BE4CA:1B26C72:23EADA5:6B033632 |
| html-safe-nonce | 244774b20519790363db86acec196a5f5cd5da237948dc868b67532cb1d6d12e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENTVBOjJCRTRDQToxQjI2QzcyOjIzRUFEQTU6NkIwMzM2MzIiLCJ2aXNpdG9yX2lkIjoiMTc1Mzk3NDYyODkxMDQ0MzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3535b46cc5a8946c33ab5698f955ffc5327293d8cb1aa519f2b7e37c6f2dc9c6 |
| hovercard-subject-tag | issue:5365921434 |
| 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/65858/issue_layout |
| twitter:image | https://opengraph.githubassets.com/653605000441884c57b8e9b42faeae92d98d854ed48b70e9ab9632c92b01d83d/nodejs/node/issues/65858 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/653605000441884c57b8e9b42faeae92d98d854ed48b70e9ab9632c92b01d83d/nodejs/node/issues/65858 |
| og:image:alt | Version v27.0.0-pre (2dfdb6a4206) Platform Darwin 25.6.0 arm64 Subsystem diagnostics_channel, sqlite What steps will reproduce the bug? Channel holds its BindingData as a raw pointer that is never ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | TrevorBurnham |
| 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