SEGFAULT (0xC0000005) on Windows x64 when executing LOAD VECTOR

Aperta
#499 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
cpp, node.js

Direzione di ricerca

Start by running the provided test.mjs on Windows x64 to reproduce the deterministic crash. Trace initLbug() through doInitLbug() and loadVectorExtension(), focusing on the VECTOR extension's native initialization and Windows loading path. Done means LOAD VECTOR no longer terminates the Node.js process, with the chosen behavior verified for the database when extension loading fails.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

LOAD VECTOR triggers a native access violation (segfault) on Windows x64, crashing the entire Node.js process. INSTALL VECTOR succeeds, but LOAD VECTOR immediately causes STATUS_ACCESS_VIOLATION (0xC0000005).

Environment

Item Value
OS Windows 11 x64
Node.js v22.15.0
@ladybugdb/core 0.15.4
lbugjs.node 13,227,008 bytes
CPU (available on request)

Reproduction

// test.mjs — place inside any project with @ladybugdb/core installed
import lbug from '@ladybugdb/core';
import fs from 'fs/promises';
import path from 'path';

const dbPath = './test.lbug';
await fs.mkdir(path.dirname(dbPath), { recursive: true });

const db = new lbug.Database(dbPath);
const conn = new lbug.Connection(db);

// This works fine
await conn.query('CREATE NODE TABLE Test (id STRING, PRIMARY KEY(id))');
console.log('Schema OK');

// This works fine
await conn.query('INSTALL VECTOR');
console.log('INSTALL VECTOR: OK');

// This crashes the process with 0xC0000005
await conn.query('LOAD VECTOR');
console.log('This line is never reached');

await conn.close();
node test.mjs
# Output:
# Schema OK
# INSTALL VECTOR: OK
# LOAD VECTOR...
# <process exits with code -1073741819>

Exit code -1073741819 = 0xC0000005 = STATUS_ACCESS_VIOLATION.

Isolation Tests

All of the following work without any crash:

Test Result
require('@ladybugdb/core') native addon load ✅
new lbug.Database(path) ✅
new lbug.Connection(db) ✅
33 schema creation queries (tables, indexes, etc.) ✅ all pass
INSTALL VECTOR ✅
LOAD VECTOR 💥 SEGFAULT
tree-sitter native + @ladybugdb/core co-loaded ✅
onnxruntime-node + @ladybugdb/core co-loaded ✅

The crash is deterministic and occurs on every LOAD VECTOR call, regardless of:

  • Database content (empty or populated)
  • Other native addons loaded before/after
  • --max-old-space-size or --stack-size Node.js flags
  • Working directory or path length

Downstream Impact

This crash makes gitnexus analyze completely unusable on Windows, because gitnexus calls initLbug() → doInitLbug() → loadVectorExtension() → conn.query('LOAD VECTOR') during every repository indexing operation.

GitNexus issue: (pending)

Suggested Fix

  1. Investigate the VECTOR extension's native initialization on Windows x64 — likely an uninitialized pointer, missing SIMD fallback, or DLL dependency issue in the extension loading path.
  2. As a workaround, consider making VECTOR extension loading optional/catchable so that the database remains usable (without vector search) even if the extension fails to load.
Lingua principale
C++
Stelle
1.8k
Fork
148
Merge medio
1g 8h
PR unite (30g)
187

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di LadybugDB/ladybug

Tutte le issue di LadybugDB/ladybug

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.