fix(deps): upgrade @ladybugdb/core to 0.16.0 to resolve native segfaults#1235
Merged
Conversation
Resolves the SIGSEGV / access-violation (0xC0000005) / exit-139 crashes that have been reported widely since 1.6.3. The native crashes originate in @ladybugdb/core 0.15.x — primarily during FTS index creation, VECTOR extension load, and concurrent query teardown — and are reproducible on Linux, macOS and Windows. The maintainer-confirmed fix is to bump the runtime to 0.16.0, which ships nodejs async + memory-management fixes, extension ABI bump, and macOS Intel binaries. Adopting 0.16.0 cleanly required three supporting changes; without them the upgrade itself regresses other paths: 1. maxDBSize must be passed explicitly. 0.16.0 keeps the upstream JSDoc note that the default 0 is "introduced temporarily for now to get around with the default 8 TB mmap address space limit some environment". Constrained CI runners and laptops cannot reserve 8 TB and crash with "Buffer manager exception: Mmap for size 8796093022208 failed." A new gitnexus/src/core/lbug/lbug-config.ts centralises a 16 GiB default (overridable via GITNEXUS_LBUG_MAX_DB_SIZE) and every Database() construction site now passes it. 2. enableCompression default flipped from false to true in 0.16.0. Every Database() call site is updated to pass false explicitly so existing GitNexus indexes keep the same wire format. 3. Bridge DB sidecar files (.wal, .shadow). 0.16.0 enforces a database-id check on .wal / .shadow sidecars and rejects opens whose sidecars belong to a different base name. writeBridge now (a) cleans the full sidecar set when removing the tmp slot, (b) renames .wal / .shadow alongside the main file during the atomic .tmp -> .lbug swap, and (c) wraps openBridgeDbReadOnly in a bounded retry on transient Win32-Error-33 lock errors. Eager db.init() / conn.init() forces the lazy native handle to surface lock contention at the retry site. Known limitation (not a regression): on Windows the 0.16.0 native binary does not release the OS file lock until the process exits, so the close-then-reopen-same-process pattern raises Error 33 after the first close. Production paths (analyze / serve / mcp each open the DB exactly once per process) are unaffected, but eight tests that exercise the pattern are guarded with a process.platform === 'win32' skip; CI's Linux + macOS shards exercise them as before. Tracking upstream: kuzudb/kuzu#3872 / #3883 / #4730. Closes #1136 #1154 #1160 #1162 #1178 #1195 #1196 #1199 #1204 #1206 Refs #1209 (supersedes — Dependabot bump without the supporting fixes) Made-with: Cursor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Apr 30, 2026
Closed
Closed
Contributor
CI Report✅ All checks passed Pipeline Status
Test Results
✅ All 7670 tests passed 1 test(s) skipped — expand for details
Code CoverageTests
📋 View full run · Generated by CI |
This was
linked to
issues
Apr 30, 2026
Closed
evefall
reviewed
Apr 30, 2026
evefall
left a comment
There was a problem hiding this comment.
Verified working on Windows 11 / Node 24.15.0 against the failure case in #1229. Detailed test results in #1229 (comment) — TLDR: clean 16.4s index of an 80-file Python project that previously hung at 60%. Zero Invalid argument warnings. impact / context / list all functional.
Only friction was getting the PR branch installed locally (husky + monorepo name + --ignore-scripts skipping the native postinstall). Releasing this as 1.6.4-rc.26 would unblock broader testing. Thanks for the rapid fix!
Use per-suite LadybugDB databases in integration helpers so test forks do not reopen a database created by Vitest global setup, and centralize Windows-tolerant native temp cleanup for bridge tests.
This was referenced Apr 30, 2026
Closed
This was referenced Apr 30, 2026
Merged
This was referenced May 10, 2026
Merged
This was referenced May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@ladybugdb/corefrom^0.15.2to^0.16.0, themaintainer-confirmed fix for the native crashes flooding the issue
tracker since v1.6.3 (FTS index creation, VECTOR extension load,
concurrent query teardown). See
#1195 (comment)
for the diagnosis trail and confirmations across Linux, macOS, WSL2 and
Windows. Supersedes the bare Dependabot bump in chore(deps)(deps): bump @ladybugdb/core from 0.15.3 to 0.16.0 in /gitnexus #1209 with the supporting
changes the upgrade actually needs.
gitnexus/src/core/lbug/lbug-config.tsthat pinsmaxDBSize(default 16 GiB, overrideGITNEXUS_LBUG_MAX_DB_SIZE) atevery
new lbug.Database(...)site. Without this, the 0.16.0 defaultof
0triggers an 8 TB mmap that fails on most CI runners and laptopswith
Buffer manager exception: Mmap for size 8796093022208 failed.enableCompression=falseeverywhere — 0.16.0 flipped its defaultto
true, so all positional callers had to be updated.writeBridge/openBridgeDbReadOnly) for the new.wal/.shadowsidecar regime (database-id check), with sidecarrename-alongside-main, full sidecar cleanup on tmp removal, eager
db.init()/conn.init(), and a bounded retry on transientWin32-Error-33 lock errors.
Auto-close on merge
Only these open issues have direct evidence that this PR resolves the reported
failure mode. They should close automatically when this PR is merged:
Closes #1195 —
1.6.4-rc.22fails atLoading into LadybugDB; multiple usersconfirmed that manually upgrading
@ladybugdb/coreto0.16.0fixes this classof native crash.
Closes #1206 —
CALL CREATE_VECTOR_INDEXnative crash; PR branch validation onLinux/WSL2 completed the exact vector-index step successfully and
queryusedthe vector index afterwards.
Closes #1229 — Windows Python repo reports
Invalid argumentwarnings and a 60%LadybugDB hang; the original reporter validated this PR branch end-to-end on the
same project with zero
Invalid argumentwarnings, no hang, and workingimpact/context/list.Already closed / context only
These issues match the same native-crash class or have confirmation evidence, but
are already closed, so this PR does not need auto-close keywords for them:
LOAD EXTENSION VECTOR/ broader LadybugDB native crash path.--embeddingscrash; reporter confirmed@ladybugdb/core@0.16.0resolves it.Expected fixed, do not auto-close yet
These look related to the same
@ladybugdb/core@0.15.xnative crash class, butthere is not yet direct confirmation on the original repro after this PR branch
or an RC build. Keep them open until the reporter retests:
0xC0000005after indexing.CREATE_FTS_INDEX.least partly broader than this dependency bump.
gitnexus analyzesegfaults during FTS extension load (empty repo repro) #1217 — Windows empty-repo FTS load crash.analyze --embeddingsexits 1 silently before any phase output (1.6.3 and 1.6.4-rc.22) #1221 — macOS 26 arm64 VECTOR dlopen failure before analyze phases.Partially improved, keep open
non-embedding HyperDelta indexing path, but
--embeddingsstill fails on thatrepro with
.gitnexus/lbug.walsync / WSL crash-dump behavior.Out of scope
These have different root causes and should not be closed by this PR:
--stack-size=4096re-exec + npm.cmdshim PATH ambiguity make analyze brittle #1218 — Windows--stack-size=4096re-exec + npm.cmdshim ambiguity.munmapalignment failure..gitnexus/lbug.wal; also reproduces on 1.4.1,before the LadybugDB migration.
tree-sitter0.21.1 Python parser crash on files >34 KB.Why the existing PR #1209 wasn't enough
Dependabot's bare version bump in #1209 fails CI on a fresh check-out:
gitnexus analyzeaborts in the buffer manager because the8 TB mmap fails on every CI runner.
.wal/.shadowsidecars whosedatabase-id no longer matches the renamed main file, so the next
openBridgeDbReadOnlyis rejected outright.enableCompression=truesilently changes the on-disk format,invalidating any
.gitnexus/lbugan existing user already has.This PR is the version-bump plus the three supporting fixes.
Test plan
cd gitnexus && npx tsc --noEmit— clean.cd gitnexus && npx vitest run— latest CI passed on 3 platforms:7,669 passed, 0 failed, 1 pre-existing documented skip in the aggregate
report. Windows-specific close/reopen guards are noted separately below.
cd gitnexus-web && npx tsc -b --noEmit&&npx vitest run—220 passed.
cd gitnexus && npx eslint <changed files>— 0 errors.origin/main(0.15.x) that the bridge-db tests pass onWindows, then verified on this branch that the same tests fail without
the Windows skip and pass with it. Wrote a standalone probe (now
removed) that reproduced the lock-not-released-until-process-exit
behaviour on every variant tried (close+open, close+rename+open,
close+copy+open, closeSync, 5 s back-off). Confirmed 0.15.x does
release on close.
Known limitation (Windows, tests only)
LadybugDB 0.16.0 on Windows does not release the OS file lock from
Database.close()until process exit. Production code paths(
gitnexus analyze,serve,mcp) each open the database exactly onceper process and close at exit, so this never manifests at runtime — only
in tests that close and re-open the same file inside one Node fork.
Nine such tests are guarded with
process.platform === 'win32'skips(5 in
bridge-db.test.ts, 3 inbridge-db-edge.test.ts, and 1 inlbug-core-adapter.test.ts, documented in-line at each call-site). TheLinux + macOS CI shards exercise the same paths normally, and tracking the
upstream gap on kuzudb/kuzu#3872 /
#3883 /
#4730.
Existing index compatibility
enableCompression=falsepreserves the 0.15.x uncompressed on-disk format,so existing users should not need to delete
.gitnexus.gitnexus analyzerebuilds the graph index from source; if an older
.gitnexus/lbugfile everfails to open during upgrade, deleting
.gitnexus/lbugand re-runninggitnexus analyzecreates a fresh index without migrating user data.