Title: sqlite: Session methods crash after DatabaseSync is closed and reopened · Issue #64782 · nodejs/node · GitHub
Open Graph Title: sqlite: Session methods crash after DatabaseSync is closed and reopened · Issue #64782 · nodejs/node
X Title: sqlite: Session methods crash after DatabaseSync is closed and reopened · Issue #64782 · nodejs/node
Description: Version main Platform macOS 26.5.2 Subsystem sqlite What steps will reproduce the bug? import { DatabaseSync } from 'node:sqlite'; const method = process.argv[2] ?? 'changeset'; const db = new DatabaseSync(':memory:'); db.exec('CREATE TA...
Open Graph Description: Version main Platform macOS 26.5.2 Subsystem sqlite What steps will reproduce the bug? import { DatabaseSync } from 'node:sqlite'; const method = process.argv[2] ?? 'changeset'; const db = new Data...
X Description: Version main Platform macOS 26.5.2 Subsystem sqlite What steps will reproduce the bug? import { DatabaseSync } from 'node:sqlite'; const method = process.argv[2] ?? 'changeset'; con...
Opengraph URL: https://github.com/nodejs/node/issues/64782
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"sqlite: Session methods crash after DatabaseSync is closed and reopened","articleBody":"### Version\n\nmain\n\n### Platform\n\n```text\nmacOS 26.5.2\n```\n\n### Subsystem\n\nsqlite\n\n### What steps will reproduce the bug?\n\n```js\nimport { DatabaseSync } from 'node:sqlite';\n\nconst method = process.argv[2] ?? 'changeset';\nconst db = new DatabaseSync(':memory:');\n\ndb.exec('CREATE TABLE data (id INTEGER PRIMARY KEY)');\nconst session = db.createSession();\n\ndb.close();\ndb.open();\n\nconsole.log(`calling session.${method}()`);\nsession[method]();\nconsole.log('returned');\n```\n\n### How often does it reproduce? Is there a required condition?\n\nAlways\n\n### What is the expected behavior? Why is that the expected behavior?\n\nClosing the database should invalidate associated session wrappers; after reopening, either method should throw an error such as `Error: session is not open`.\n\n### What do you see instead?\n\n```sh\n$ ../node/node repro.js changeset\ncalling session.changeset()\n[1] 65858 segmentation fault ../node/node repro.js changeset\n```\n\n```sh\n$ ../node/node repro.js close\ncalling session.close()\n[1] 66266 segmentation fault ../node/node repro.js close\n```\n\nBoth methods terminate the process because the session wrapper retains a stale native handle after `db.close()`.\n\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/trivikr","@type":"Person","name":"trivikr"},"datePublished":"2026-07-27T14:40:28Z","url":"https://github.com/nodejs/node/issues/64782"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:50865476-a1ba-b26e-9604-05b4b3727d5b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EE28:2AB324:5FE606:8272A7:6AED244E |
| html-safe-nonce | 3efc7ccf8d38eb0466722533519e62edcf057e0ee38a030a1e4a9d1da0b2085f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRTI4OjJBQjMyNDo1RkU2MDY6ODI3MkE3OjZBRUQyNDRFIiwidmlzaXRvcl9pZCI6IjU5MTE5MDUwOTg5ODY3NTkyNDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4bc42f521953d9b2d4c182e1312de31b3216dd01941a30d391dd803a95f324de |
| hovercard-subject-tag | issue:4989090130 |
| 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/64782/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7f1fd34971552bafcf45d6e61a5c3b9cc26814b934378b473120b4cd42636a31/nodejs/node/issues/64782 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7f1fd34971552bafcf45d6e61a5c3b9cc26814b934378b473120b4cd42636a31/nodejs/node/issues/64782 |
| og:image:alt | Version main Platform macOS 26.5.2 Subsystem sqlite What steps will reproduce the bug? import { DatabaseSync } from 'node:sqlite'; const method = process.argv[2] ?? 'changeset'; const db = new Data... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | trivikr |
| hostname | github.com |
| expected-hostname | github.com |
| None | e3e0f7f63e50c6fe879198a93a0a023a648ecc0a5e9bc3b5e033ac57172237e6 |
| 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 | 707a24b346ac8a82878b9c084efaa38a997660cb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width