GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — sqlite: fix segfault SQLTagStore when db handle is garbage collected by louwers · Pull Request #60462 · nodejs/node

Conversation

@louwers

@louwers louwers commented Oct 28, 2025

Copy link
Copy Markdown
Contributor

Fixes #60448 by changing from a BaseObjectWeakPtr to a BaseObjectPtr.

A SQLTagStore should keep the database alive.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot

nodejs-github-bot commented Oct 28, 2025

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/sqlite
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem. labels Oct 28, 2025
cjihrig
cjihrig approved these changes Oct 28, 2025
View reviewed changes

@cjihrig cjihrig left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a couple comments, but LGTM.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread test/parallel/test-sqlite-template-tag.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/parallel/test-sqlite-template-tag.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

addaleax
addaleax reviewed Oct 28, 2025
View reviewed changes
Comment thread src/node_sqlite.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

@codecov

codecov Bot commented Oct 28, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.53%. Comparing base (fc0952f) to head (20a0eed).
⚠️ Report is 206 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #60462      +/-   ##
==========================================
- Coverage   88.54%   88.53%   -0.02%     
==========================================
  Files         704      704              
  Lines      208753   208760       +7     
  Branches    40279    40280       +1     
==========================================
- Hits       184844   184821      -23     
- Misses      15919    15930      +11     
- Partials     7990     8009      +19     
Files with missing lines Coverage Δ
src/node_sqlite.cc 80.26% <100.00%> (+0.09%) ⬆️
src/node_sqlite.h 80.39% <ø> (ø)

... and 31 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Luisangelgarciahernandez975-prog

This comment was marked as off-topic.

Sign in to view
@Luisangelgarciahernandez975-prog

This comment was marked as off-topic.

Sign in to view
mcollina
mcollina approved these changes Dec 29, 2025
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Dec 29, 2025
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Dec 29, 2025
@louwers

louwers commented Dec 29, 2025

Copy link
Copy Markdown
Contributor Author

@mcollina I need to fix the issue brought up by @addaleax.

I need to figure out how to add an internal field to SQLTagStore.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@louwers
louwers marked this pull request as draft December 29, 2025 10:53
@louwers
sqlite: change approach to fix segfault SQLTagStore
419cfd4
@louwers
louwers force-pushed the fix-60448 branch from b8df359 to 419cfd4 Compare January 3, 2026 22:23
@louwers
louwers marked this pull request as ready for review January 3, 2026 22:25
@louwers

louwers commented Jan 3, 2026

Copy link
Copy Markdown
Contributor Author

I implemented @addaleax' suggestion by adding an internal field to SQLTagStore. Admittedly Claude gave a helping hand, I didn't do that before.

The tests confirms that the segfault no longer occurs and the memory leak of my previous solution also does not appear.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@louwers
sqlite: add eslint ignore for no-void
7c71345
addaleax
addaleax approved these changes Jan 3, 2026
View reviewed changes
Comment thread src/node_sqlite.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

@louwers
sqlite: remove redundant parameter
20a0eed
@louwers

louwers commented Jan 4, 2026

Copy link
Copy Markdown
Contributor Author

Could someone trigger CI? I am not a collaborator.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mcollina
mcollina approved these changes Jan 13, 2026
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

louwers reacted with rocket emoji
All reactions
  • 🚀 1 reaction
@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jan 13, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jan 13, 2026
@nodejs-github-bot

nodejs-github-bot commented Jan 13, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/70790/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Jan 20, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/70927/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@louwers

louwers commented Jan 20, 2026

Copy link
Copy Markdown
Contributor Author

Tests seem to be stuck.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gurgunday
gurgunday approved these changes Jan 20, 2026
View reviewed changes
himself65
himself65 approved these changes Jan 20, 2026
View reviewed changes
@mcollina mcollina added commit-queue PRs queued for automated landing through the Commit Queue. and removed needs-ci PRs that need a full CI run. labels Jan 28, 2026
@nodejs-github-bot nodejs-github-bot added commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. and removed commit-queue PRs queued for automated landing through the Commit Queue. labels Jan 28, 2026
@nodejs-github-bot

nodejs-github-bot commented Jan 28, 2026

Copy link
Copy Markdown
Collaborator
Commit Queue failed
- Loading data for nodejs/node/pull/60462
✔  Done loading data for nodejs/node/pull/60462
----------------------------------- PR info ------------------------------------
Title      sqlite: fix segfault SQLTagStore when db handle is garbage collected (#60462)
Author     Bart Louwers <[email protected]> (@louwers)
Branch     louwers:fix-60448 -> nodejs:main
Labels     c++, sqlite
Commits    3
 - sqlite: change approach to fix segfault SQLTagStore
 - sqlite: add eslint ignore for no-void
 - sqlite: remove redundant parameter
Committers 1
 - Bart Louwers <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/60462
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/60462
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Tue, 28 Oct 2025 15:01:30 GMT
   ✔  Approvals: 5
   ✔  - Colin Ihrig (@cjihrig): https://github.com/nodejs/node/pull/60462#pullrequestreview-3389333091
   ✔  - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/60462#pullrequestreview-3657775960
   ✔  - Anna Henningsen (@addaleax): https://github.com/nodejs/node/pull/60462#pullrequestreview-3624591879
   ✔  - Gürgün Dayıoğlu (@gurgunday): https://github.com/nodejs/node/pull/60462#pullrequestreview-3684621830
   ✔  - Zeyu "Alex" Yang (@himself65): https://github.com/nodejs/node/pull/60462#pullrequestreview-3684626705
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2026-01-20T20:59:49Z: https://ci.nodejs.org/job/node-test-pull-request/70927/
- Querying data for job/node-test-pull-request/70927/
✔  Build data downloaded
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
- Downloading patch for 60462
From https://github.com/nodejs/node
 * branch                  refs/pull/60462/merge -> FETCH_HEAD
✔  Fetched commits as 74c365846533..20a0eed2c829
--------------------------------------------------------------------------------
Auto-merging src/node_sqlite.cc
Auto-merging src/node_sqlite.h
Auto-merging test/parallel/test-sqlite-template-tag.js
[main c05ac0c37b] sqlite: change approach to fix segfault SQLTagStore
 Author: Bart Louwers <[email protected]>
 Date: Sat Jan 3 23:19:30 2026 +0100
 3 files changed, 51 insertions(+), 7 deletions(-)
Auto-merging test/parallel/test-sqlite-template-tag.js
[main 7d9121e572] sqlite: add eslint ignore for no-void
 Author: Bart Louwers <[email protected]>
 Date: Sat Jan 3 23:31:19 2026 +0100
 1 file changed, 2 insertions(+), 1 deletion(-)
Auto-merging src/node_sqlite.cc
Auto-merging src/node_sqlite.h
[main 2a32ac0336] sqlite: remove redundant parameter
 Author: Bart Louwers <[email protected]>
 Date: Sun Jan 4 00:25:53 2026 +0100
 2 files changed, 5 insertions(+), 11 deletions(-)
   ✔  Patches applied
There are 3 commits in the PR. Attempting autorebase.
(node:2364) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.
(Use `node --trace-deprecation ...` to show where the warning was created)
Rebasing (2/6)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
sqlite: change approach to fix segfault SQLTagStore

PR-URL: #60462
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>

[detached HEAD 44bed5cdfc] sqlite: change approach to fix segfault SQLTagStore
Author: Bart Louwers <[email protected]>
Date: Sat Jan 3 23:19:30 2026 +0100
3 files changed, 51 insertions(+), 7 deletions(-)
Rebasing (3/6)
Rebasing (4/6)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
sqlite: add eslint ignore for no-void

PR-URL: #60462
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>

[detached HEAD 9b9492e455] sqlite: add eslint ignore for no-void
Author: Bart Louwers <[email protected]>
Date: Sat Jan 3 23:31:19 2026 +0100
1 file changed, 2 insertions(+), 1 deletion(-)
Rebasing (5/6)
Rebasing (6/6)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
sqlite: remove redundant parameter

PR-URL: #60462
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>

[detached HEAD 5c9047f816] sqlite: remove redundant parameter
Author: Bart Louwers <[email protected]>
Date: Sun Jan 4 00:25:53 2026 +0100
2 files changed, 5 insertions(+), 11 deletions(-)
Successfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/21426684111

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gurgunday gurgunday added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Jan 28, 2026
@mcollina mcollina added commit-queue PRs queued for automated landing through the Commit Queue. commit-queue-squash PRs the Commit Queue should land as one squashed commit. and removed commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. labels Jan 31, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Jan 31, 2026
@nodejs-github-bot
nodejs-github-bot merged commit f6464c5 into nodejs:main Jan 31, 2026
86 of 89 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Jan 31, 2026

Copy link
Copy Markdown
Collaborator

Landed in f6464c5

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

aduh95 pushed a commit that referenced this pull request Feb 2, 2026
@louwers @aduh95
sqlite: change approach to fix segfault SQLTagStore
73415dc
PR-URL: #60462
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
@github-actions github-actions Bot mentioned this pull request Feb 2, 2026
2026-02-03, Version 25.6.0 (Current) #61635
Merged
aduh95 pushed a commit that referenced this pull request Feb 2, 2026
@louwers @aduh95
sqlite: change approach to fix segfault SQLTagStore
45d25c4
PR-URL: #60462
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
aduh95 pushed a commit that referenced this pull request Feb 10, 2026
@louwers @aduh95
sqlite: change approach to fix segfault SQLTagStore
266279a
PR-URL: #60462
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
aduh95 pushed a commit that referenced this pull request Feb 14, 2026
@louwers @aduh95
sqlite: change approach to fix segfault SQLTagStore
4db719b
PR-URL: #60462
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
@github-actions github-actions Bot mentioned this pull request Feb 22, 2026
2026-02-24, Version 24.14.0 'Krypton' (LTS) #61924
Merged
aduh95 pushed a commit that referenced this pull request Feb 22, 2026
@louwers @aduh95
sqlite: change approach to fix segfault SQLTagStore
0e7571a
PR-URL: #60462
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@geeksilva97 geeksilva97 geeksilva97 left review comments
@mcollina mcollina mcollina approved these changes
@addaleax addaleax addaleax approved these changes
@cjihrig cjihrig cjihrig approved these changes
@himself65 himself65 himself65 approved these changes
@gurgunday gurgunday gurgunday approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash PRs the Commit Queue should land as one squashed commit. sqlite Issues and PRs related to the SQLite subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

sqlite: segmentation fault using SQLTagStore if there's no reference to the underlying database

Uh oh!

There was an error while loading. Please reload this page.

9 participants

@louwers @nodejs-github-bot @Luisangelgarciahernandez975-prog @mcollina @addaleax @cjihrig @himself65 @geeksilva97 @gurgunday
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.