# Self-Healing CI: Containing an Intermittent Segfault in a Native Test

> A native test that segfaults intermittently may be a timing or resource flake, not a real crash. See the manual fix and how self-healing CI retries the transient case.

Source: https://latchkey.dev/learn/self-healing-ci/self-healing-native-test-segfault  
Updated: 2026-06-26

A native test that segfaults on one run but passes on the next may be hitting a race or resource blip -- a retry that passes points to flakiness, while a consistent crash points to a real bug.

## What makes a failure safely retryable

Automatic retry is only correct for failures that are genuinely transient. Retrying a deterministic failure wastes minutes and hides a real defect, so the classification matters more than the retry mechanism.

- Safe to retry: network timeouts, registry 5xx, transient DNS failures, a service container that was not ready, a spot instance reclaimed mid-run.
- Not safe to retry: assertion failures, compile errors, lint violations, anything that fails identically on every attempt.
- Ambiguous, and worth investigating rather than retrying: out-of-memory kills, disk exhaustion, and flaky tests. These repeat under load and a retry only hides the trend.
- Always record that a retry happened. A pipeline that silently retries is a pipeline whose real failure rate you do not know.

## FAQ

### What causes Self-Healing CI: containing an intermittent segfault in a native test?

A test exercising native code dies with a segfault (SIGSEGV) on one run and passes on the next with no code change. A race, an uninitialized resource under load, or a transient memory condition triggered the crash intermittently. A human re-runs the suite and it goes green.

### How do I fix Self-Healing CI: containing an intermittent segfault in a native test manually?

[object Object]

### Can Self-Healing CI: containing an intermittent segfault in a native test be fixed automatically?

Self-healing CI treats an intermittent segfault conservatively: it retries a crash whose signature matches a transient, non-reproducing flake while surfacing a segfault that reproduces consistently as the real bug it is.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
