Interview Prep/Kubernetes/Pod startup failures

A Pod restarts with `exit code 139` and no stack trace.

AdvancedTroubleshootingPod startup failures
Answer

Likely causes → 139 = 128 + 11 = SIGSEGV. A native crash: buggy C extension, incompatible native library (musl vs glibc), JIT bug, or stack overflow in native code. Not a Kubernetes problem but Kubernetes makes it look like CrashLoopBackOff.

Diagnose →

kubectl get pod app-x -o jsonpath='{.status.containerStatuses[0].lastState.terminated.exitCode}'
kubectl debug -it app-x --image=ubuntu:24.04 --target=app   # shares PID namespace
# On the node: dmesg | grep -i segfault

Fix → Reproduce with the same image locally; enable core dumps or language crash handlers (PYTHONFAULTHANDLER=1, -XX:+ShowCodeDetailsInExceptionMessages, Go GOTRACEBACK=crash). Usually fixed by aligning native libraries with the base image.

Prevent → Pin base images and native dependency versions; run integration tests on the exact production image.

All Kubernetes questions Roadmap: Kubernetes core

More on Pod startup failures