Skip to content

Conversation

@louwers
Copy link
Contributor

@louwers louwers commented Oct 28, 2025

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

A SQLTagStore should keep the database alive.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/sqlite

@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
Copy link
Contributor

@cjihrig cjihrig left a 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.

@codecov
Copy link

codecov bot commented Oct 28, 2025

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.

@Luisangelgarciahernandez975-prog

This comment was marked as off-topic.

@Luisangelgarciahernandez975-prog

This comment was marked as off-topic.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 29, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 29, 2025
@louwers
Copy link
Contributor Author

louwers commented Dec 29, 2025

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

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

@louwers louwers marked this pull request as draft December 29, 2025 10:53
@louwers louwers marked this pull request as ready for review January 3, 2026 22:25
@louwers
Copy link
Contributor Author

louwers commented Jan 3, 2026

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.

@louwers
Copy link
Contributor Author

louwers commented Jan 4, 2026

Could someone trigger CI? I am not a collaborator.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 13, 2026
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 13, 2026
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@louwers
Copy link
Contributor Author

louwers commented Jan 20, 2026

Tests seem to be stuck.

@mcollina mcollina added commit-queue Add this label to land a pull request using GitHub Actions. 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 An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Jan 28, 2026
@nodejs-github-bot
Copy link
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

@gurgunday gurgunday added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 28, 2026
@mcollina mcollina added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Jan 31, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 31, 2026
@nodejs-github-bot nodejs-github-bot merged commit f6464c5 into nodejs:main Jan 31, 2026
86 of 89 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in f6464c5

aduh95 pushed a commit that referenced this pull request Feb 2, 2026
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 2, 2026
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

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. sqlite Issues and PRs related to the SQLite subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

9 participants