Skip to content

CREATE_FTS_INDEX segfaults on Linux x86_64 with non-trivial data volumes #430

Closed as duplicate

Description

@WingedGuardian

Environment

  • OS: Ubuntu Linux x86_64 (6.8.0-101-generic)
  • Node.js: v22.x
  • @ladybugdb/core: v0.15.4 and v0.15.4-dev.20260428
  • Consumer: GitNexus v1.6.4-rc.21

Description

CREATE_FTS_INDEX segfaults (SIGSEGV, exit code 139) when called on node tables with non-trivial data volumes on Linux x86_64. The FTS extension loads successfully — the crash occurs specifically during index creation.

Works: In-memory DB with 2 rows — index creates, queries return correct results.
Crashes: On-disk DB with 1,000+ rows — segfaults immediately on CREATE_FTS_INDEX.

Minimal Reproduction

const Database = require("@ladybugdb/core/database.js");
const Connection = require("@ladybugdb/core/connection.js");

async function test() {
  // This works fine:
  const memDb = new Database(":memory:");
  const memConn = new Connection(memDb);
  await memConn.init();
  await memConn.query("CREATE NODE TABLE T(id INT64, name STRING, content STRING, PRIMARY KEY(id))");
  await memConn.query("CREATE (n:T {id: 1, name: 'foo', content: 'hello world'})");
  await memConn.query("LOAD EXTENSION fts");
  await memConn.query("CALL CREATE_FTS_INDEX('T', 'test_fts', ['name', 'content'], stemmer := 'porter')");
  console.log("In-memory: OK"); // ✅ Works

  // This segfaults:
  const diskDb = new Database("/path/to/existing/db/with/1000+/rows");
  const diskConn = new Connection(diskDb);
  await diskConn.init();
  await diskConn.query("LOAD EXTENSION fts");
  // Next line causes SIGSEGV:
  await diskConn.query("CALL CREATE_FTS_INDEX('SomeTable', 'some_fts', ['name', 'content'], stemmer := 'porter')");
}
test();

Likely Root Cause

This appears to be inherited from the upstream KuzuDB codebase:

  • KuzuDB #6017: All FTS end-to-end tests were failing FSM (Free Space Manager) leak checks
  • KuzuDB #5671: Assertion failure in hash_index.cpp:174 during FTS checkpoint path when processing non-trivial data volumes

KuzuDB was archived with these bugs unresolved, and LadybugDB inherited the affected code.

Downstream Impact

Additional Notes

  • Tested with both @ladybugdb/core@0.15.4 (stable) and @ladybugdb/core@0.15.4-dev.20260428 (today's nightly) — same crash on both
  • Indexing name-only columns (excluding content) also segfaults — it's not a data size issue per row, but total row count
  • The segfault is in the native binary (lbugjs.node), not in JavaScript code

Activity

  1. adsharma commented on Apr 28, 2026

    @adsharma
    Contributor

    The old extension binaries are incompatible due to ABI changes. We need to respin them. Root cause is #332

    The simplest fix is to bump up the major rev to 0.16.0 and update the extensions.

  2. adsharma commented on Apr 29, 2026

    @adsharma
    Contributor

    v0.16.0 is out. Please retest.

  3. adsharma commented on May 18, 2026

    @adsharma
    Contributor

    Merged LadybugDB/extensions#1. Concurrent access to the unordered_map could be the root cause. Please retest when 0.17.x is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions