Title: sqlite: segmentation fault using `SQLTagStore` if there's no reference to the underlying database · Issue #60448 · nodejs/node · GitHub
Open Graph Title: sqlite: segmentation fault using `SQLTagStore` if there's no reference to the underlying database · Issue #60448 · nodejs/node
X Title: sqlite: segmentation fault using `SQLTagStore` if there's no reference to the underlying database · Issue #60448 · nodejs/node
Description: Version v24.10.0 Platform Linux localhost 6.17.4-200.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Oct 19 18:47:49 UTC 2025 x86_64 GNU/Linux Subsystem sqlite What steps will reproduce the bug? import { DatabaseSync } from "node:sqlite"; // Crea...
Open Graph Description: Version v24.10.0 Platform Linux localhost 6.17.4-200.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Oct 19 18:47:49 UTC 2025 x86_64 GNU/Linux Subsystem sqlite What steps will reproduce the bug? import { Da...
X Description: Version v24.10.0 Platform Linux localhost 6.17.4-200.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Oct 19 18:47:49 UTC 2025 x86_64 GNU/Linux Subsystem sqlite What steps will reproduce the bug? import { Da...
Opengraph URL: https://github.com/nodejs/node/issues/60448
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"sqlite: segmentation fault using `SQLTagStore` if there's no reference to the underlying database","articleBody":"### Version\n\nv24.10.0\n\n### Platform\n\n```text\nLinux localhost 6.17.4-200.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Oct 19 18:47:49 UTC 2025 x86_64 GNU/Linux\n```\n\n### Subsystem\n\nsqlite\n\n### What steps will reproduce the bug?\n\n```js\nimport { DatabaseSync } from \"node:sqlite\";\n\n// Creating a SQLTagStore without holding a reference to the DatabaseSync:\nconst sql = new DatabaseSync(\":memory:\").createTagStore();\n\n// Substituting line 3 with these two fixes the segfault:\n// const db = new DatabaseSync(\":memory:\");\n// const sql = db.createTagStore();\n\nsql.db.exec(\"CREATE TABLE TEST (DATA NUMBER)\");\n\n// Simulating meaningful work/likely triggering garbage collection...\nfor (const x of new Array(100_000).fill(0)) {\n x + x;\n}\n\nconsole.log(\"About to run insert...\");\nsql.run`INSERT INTO TEST (DATA) VALUES (1)`;\n\n// Code will segfault and never run the following log\nconsole.log(\"didn't segfault!\");\n```\n\n### How often does it reproduce? Is there a required condition?\n\nRunning the snippet will always, unconditionally, cause a `SIGSEGV` on my machine.\n\n### What is the expected behavior? Why is that the expected behavior?\n\nIdeally, the program inserts the data and doesn't crash, outputting:\n```\nAbout to run insert...\ndidn't segfault!\n```\n\nIf the `new DatabaseSync().createTagStore()` usecase is unsupported, then I'd expect a user-friendly error letting me know that it's my responsibility to keep the `DatabaseSync` in scope, or some other way of preventing this unsupported pattern.\n\n### What do you see instead?\n\n`fish: Job 1, 'node index.js' terminated by signal SIGSEGV (Address boundary error)`\n\n### Additional information\n\nThe reason I tried keeping only a `SQLTagStore` is because the tag store [has a db field](https://nodejs.org/docs/latest-v24.x/api/sqlite.html#sqltagstoredb) - I liked the idea of only holding a tag store and using `sql.db` when needed, instead of holding both a `DatabaseSync` and a `SQLTagStore`.\n\nThank you for all your hard work!","author":{"url":"https://github.com/aidandenlinger","@type":"Person","name":"aidandenlinger"},"datePublished":"2025-10-28T00:49:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/60448/node/issues/60448"}
| 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:77af2fd6-8ca0-64ec-2db2-21309f40a8e0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8B94:316D26:294D4E6:3B5DF23:6A4D21BA |
| html-safe-nonce | c3e55de04fd98a1695d9ccd5e4cf878a2c5fd8958de806a801f63856e48af434 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Qjk0OjMxNkQyNjoyOTRENEU2OjNCNURGMjM6NkE0RDIxQkEiLCJ2aXNpdG9yX2lkIjoiNjI0OTY3MTI2MTM5MzA2ODQ3NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c892adf562965705cb93e9e2fdc54187ec1e83d7ad8775350d63a02d8b3a7b13 |
| hovercard-subject-tag | issue:3559247506 |
| 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/60448/issue_layout |
| twitter:image | https://opengraph.githubassets.com/515a0ba2eaee261b5beb8b3330ddbbac40e0e8781fa137bf563a34b5a1dd856e/nodejs/node/issues/60448 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/515a0ba2eaee261b5beb8b3330ddbbac40e0e8781fa137bf563a34b5a1dd856e/nodejs/node/issues/60448 |
| og:image:alt | Version v24.10.0 Platform Linux localhost 6.17.4-200.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Oct 19 18:47:49 UTC 2025 x86_64 GNU/Linux Subsystem sqlite What steps will reproduce the bug? import { Da... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | aidandenlinger |
| hostname | github.com |
| expected-hostname | github.com |
| None | 92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6 |
| 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 | 93f17a978ee60bc4668e1d7b90e6bd2d622261fd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width