Skip to content

sqlite: throw within aggregate's result callback causes segfault #58425

Closed
@Renegade334

Description

@Renegade334

Version

v24.0.2

Platform

Linux 6.11.0-25-generic (Ubuntu 24.04) x86_64

Subsystem

sqlite

What steps will reproduce the bug?

const sqlite = require('node:sqlite')
const db = new sqlite.DatabaseSync(':memory:')

db.exec('CREATE TABLE test (value INTEGER)')

db.aggregate('result_throws', {
  start: null,
  step: v => v,
  result: () => { throw new Error() },
})

db.prepare('SELECT result_throws() FROM test').get()
// Segmentation fault

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

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

The aggregate handler should abort gracefully.

What do you see instead?

An offended kernel.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    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