Skip to content
Latchkey

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 139

Common 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

  1. Rebuild native dependencies against the current Node and platform.
  2. Re-run to see if the fault clears.
GitHub Actions
- run: npm rebuild

Upgrade or replace the addon

  1. Upgrade the native dependency to a fixed version.
  2. 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →