Skip to content

sqlite crashes when enableLoadExtension() or setAuthorizer() is called after close() #64811

Description

@trivikr

Version

main

Platform

macOS 26.5.2

Subsystem

sqlite

What steps will reproduce the bug?

import { DatabaseSync } from 'node:sqlite';

const db = new DatabaseSync(':memory:', { allowExtension: true });

db.close();
db.enableLoadExtension(false);

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

methods should validate that the database is open and throw ERR_INVALID_STATE, consistent with neighboring APIs.

What do you see instead?

Segmentation fault

Calling enableLoadExtension() after close() terminates the process; setAuthorizer() has the same issue.

Additional information

No response

Metadata

Metadata

Assignees

Labels

sqliteIssues and PRs related to the SQLite subsystem.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions