Skip to content

sqlite: fix crash session extension callbacks with workers#59848

Merged
nodejs-github-bot merged 6 commits intonodejs:mainfrom
louwers:fix-crash-sqlite
Sep 23, 2025
Merged

sqlite: fix crash session extension callbacks with workers#59848
nodejs-github-bot merged 6 commits intonodejs:mainfrom
louwers:fix-crash-sqlite

Conversation

@louwers
Copy link
Contributor

@louwers louwers commented Sep 10, 2025

This PR fixes the problem that static std::function variables are used to store callbacks. This causes problems when SQLite is used (also) used from a worker and can result in a crash.

This PR stack allocates the callbacks and passes it along to sqlite3changeset_apply via the context argument.

It also adds a regression test which crashes out before this change.

Lastly some functionality that is uses in test/parallel/test-sqlite.js is now also needed in test/parallel/test-sqlite-session.js so I factored that out to a different file.

Loading
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. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants