QKeyDB durability writer crashes on Node v24 with native assertion aborts
Abort trap: 6 (native assertion failure) inside Node's fs native bindings during durability log read/write on Node v24
QKeyDB's durability log writer passed file offset, scan-window, and read/write length parameters to Node's native fs bindings without coercing them to standard 32-bit integers. Node v24's native file system bindings enforce strict type checking (args[N]->IsInt32()) and throw fatal native assertion abort traps (Abort trap: 6) when passed floating point numbers or otherwise uncoerced numeric types, crashing the process rather than raising a catchable JS error.
Root Cause
JavaScript numbers are always floating point internally; without explicit Math.floor() coercion at each native fs call boundary, values that happen to carry non-integer representations (even ones that are mathematically whole numbers) fail Node v24's stricter native binding type checks.
Solution Steps
- Wrap every file offset, scan-window, and read/write length parameter passed to native fs calls in Math.floor() at the call site, covering the internal write path, the resync/replay read path, and all associated offset/length calculations.
- Run the three DurableWriter test files that exercise the affected read/write/resync paths.
Validation
[object Object]
Rollback
[object Object]
Ecosystem: qkeydb
License: CC-BY-4.0
Last updated: Jul 6, 2026