You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stop hook aborts: better-sqlite3 built against Node 24.19 headers (Assertion (env) != nullptr) #90
Observed on macOS arm64, nodejs-24.19.0, cavemem 0.1.3, better-sqlite3 11.10.0 (2026-10-15).
Root cause
Node.js regression in 24.19.0: ObjectWrap cleanup hooks were backported without the cleanup-hook registry (nodejs/node#65446, still open). Native addons compiled against 24.19+ headers abort when a wrapped object is GC-ed. Backport fix nodejs/node#65943 landed as abe1b673e9b, but is not in any release yet (not in v24.20.0 nor v24.21.0, which is current nixpkgs nodejs).
Upgrading better-sqlite3 alone does not help: the same abort is reported on 12.11.1 (WiseLibs/better-sqlite3#1515). It follows the headers the addon is built against, not the runtime: built against 24.18.1 headers, 10/10 clean runs even on a 24.19.0 runtime.
Expected
Build cavemem (and its better-sqlite3 addon) with a Node that is not affected, until a 24.x release contains abe1b673e9b:
preferred: nodejs_22 for both build and runtime of the cavemem package; or
build against <= 24.18.1 headers.
Leave a comment pointing at nodejs/node#65446 so the pin is dropped once a fixed 24.x ships.
Done when
The cavemem package (see the sibling issue on the missing packages.default) wraps a Node that is not affected; cavemem --version runs on all tier-1 systems.
A smoke check exercises a store write and forced GC (node --expose-gc, open db, prepare statements, drop them, gc()) without abort.
README/CHANGELOG note the Node pin and its removal condition.
Correction after more digging: the Node pin is not needed. e5de763 (better-sqlite3 13.x, N-API) already fixes the abort. Measured with the repro in this issue: cavemem 0.2.1 / better-sqlite3 13.0.3 runs clean 3/3 on both Node 24.19.0 and 24.21.0, while 0.1.3 / 11.10.0 aborts 5/5.
The crash only persists in consumers stuck on old revs, because they can no longer bump: this flake stopped exporting a package (#89). Closing in favour of #89.
Activity
pr0d1r2 commentedon Oct 16, 2026
Correction after more digging: the Node pin is not needed.
e5de763(better-sqlite3 13.x, N-API) already fixes the abort. Measured with the repro in this issue: cavemem 0.2.1 / better-sqlite3 13.0.3 runs clean 3/3 on both Node 24.19.0 and 24.21.0, while 0.1.3 / 11.10.0 aborts 5/5.The crash only persists in consumers stuck on old revs, because they can no longer bump: this flake stopped exporting a package (#89). Closing in favour of #89.