Node "Segmentation fault" from a Native Addon in CI - Diagnose the Crash
A segmentation fault is a native-level crash: the process touched invalid memory, almost always inside a native addon or a mismatched binary, not pure JavaScript.
What this error means
A node process dies in CI with Segmentation fault (core dumped) and exit code 139, with no JS stack, after loading or using a native addon.
node
node[1234]: ../src/some_addon.cc:88: void Run(): Assertion failed
Segmentation fault (core dumped)
$ exit status 139Common causes
A native addon ABI or platform mismatch
A precompiled .node binary built for a different Node ABI or OS crashes at the native level on the runner.
A bug in the native addon
The addon itself dereferences bad memory for certain inputs, faulting the whole process.
How to fix it
Rebuild the addon on the runner
- Rebuild native dependencies against the current Node and platform.
- Re-run to see if the fault clears.
GitHub Actions
- run: npm rebuildUpgrade or replace the addon
- Upgrade the native dependency to a fixed version.
- Consider a pure-JS alternative if crashes persist.
How to prevent it
- Key dependency caches on Node version and OS, rebuild native addons after a Node bump, and keep native dependencies current. On Latchkey, a transient segfault-killed job (often resource-driven on a small runner) is auto-retried and larger runners reduce native memory pressure.
Related guides
Node native addon dlopen Fails at Runtime in CI - Fix the ABI MismatchFix Node.js native addon dlopen failures at runtime in CI by rebuilding the addon against the runner Node ver…
Node native addon "node-gyp rebuild" Fails at Runtime in CI - Fix the BuildFix node-gyp rebuild failures triggered at runtime in CI by installing the build toolchain and matching the a…
Node ERR_INTERNAL_ASSERTION in CI - Diagnose the Internal FailureDiagnose the Node.js ERR_INTERNAL_ASSERTION error in CI by upgrading Node, removing the misbehaving native ad…