Performance Insights
Linux · process cores and kernel crashes

gdb core dump analysis: read a Linux core file, and a kdump vmcore with crash

Open a Linux core dump in gdb (gdb ./program core, then bt) and read the backtrace, with real output from a lab crash; capture cores with core_pattern or systemd-coredump; read a kdump vmcore with crash.

Published 2026-10-20 by PerformanceInsights.ai

Short answer: open the core with the program that crashed: gdb ./program core (or coredumpctl gdb on systemd distributions), then type bt for the crashing thread's stack and thread apply all bt for every thread. gdb's first lines name the signal and the frame it stopped in. A core is written only if ulimit -c allows it and /proc/sys/kernel/core_pattern says where it goes. A kernel crash needs kdump set up in advance; the vmcore it writes to /var/crash is read with the crash utility and a debug vmlinux.

1. Make sure a crash leaves a core

cat /proc/sys/kernel/core_pattern   # where cores go, or which program receives them
ulimit -c                           # 0 means no core for this shell
ulimit -c unlimited                 # for this shell; services set LimitCORE= instead

2. Read a process core with gdb

gdb /path/to/the/binary core.12345     # or: coredumpctl gdb <PID>
(gdb) bt                               # stack of the crashing thread
(gdb) thread apply all bt              # every thread (deadlocks, aborts)
(gdb) info registers
(gdb) frame 2                          # select a frame, then:
(gdb) info locals

What that looks like on a lab crash: our test program crasher writing through a NULL pointer on a second thread, built with gcc -g, opened in gdb 13.1 on Debian 12:

$ gdb -q ./crasher core.lab
Core was generated by `/lab/crasher null'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000060982bd4b1e9 in null_deref () at crasher.c:14
14	static void null_deref(void) { volatile int *p = NULL; *p = 42; }
[Current thread is 1 (Thread 0x7ea35562b6c0 (LWP 4363))]
(gdb) bt
#0  0x000060982bd4b1e9 in null_deref () at crasher.c:14
#1  0x000060982bd4b348 in crash_thread (arg=0x60982bd4b1d9 <null_deref>) at crasher.c:48
#2  0x00007ea355eb91f5 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#3  0x00007ea355f38b50 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100

The same core opened with a stripped copy of the binary loses the program's own frames: #0 0x000060982bd4b1e9 in ?? (). The C library's frames still have names, because their debug info comes from the distribution.

The binary must be the same build that crashed. Frames shown as ?? mean missing debug info. Fedora, Ubuntu and Debian run debuginfod servers; with DEBUGINFOD_URLS set (the default on recent releases) gdb fetches debug info for distribution packages on demand. For your own programs, keep the unstripped binary or the separate .debug file for every release.

The signal in gdb's first line is the first clue: SIGSEGV is a bad memory access, SIGABRT usually an abort() from an assert or the C library's heap checks (free(): invalid pointer), SIGBUS a bad mapping such as a truncated memory-mapped file.

3. Kernel crashes: kdump and crash

When the kernel panics there's no process to dump, so you need kdump: a reserved second kernel (the crashkernel= boot parameter) that boots on panic and saves memory to disk.

The vmcore lands under /var/crash/. To read it you need the debug vmlinux for exactly that kernel (Ubuntu: the kernel's -dbgsym package from the ddebs repository, linux-image-unsigned-<version>-dbgsym on current releases; RHEL: kernel-debuginfo):

crash /usr/lib/debug/boot/vmlinux-<version> /var/crash/<dir>/dump.<stamp>
crash> sys      # kernel, panic string, uptime
crash> log      # the kernel ring buffer up to the panic
crash> bt       # the panicking task's stack
crash> ps       # what was running

Start with log: the last lines usually name the oops (BUG: unable to handle page fault, general protection fault, a hung task warning) and the module the faulting function belongs to. On RHEL the debug vmlinux is under /usr/lib/debug/lib/modules/<version>/vmlinux.

Common mistakes

Common questions

How do I make Linux leave a core dump when a process crashes?
Check ulimit -c (0 means no core for this shell; ulimit -c unlimited sets it for this shell, and services set LimitCORE= instead) and /proc/sys/kernel/core_pattern, which says where cores go or which program receives them. On systemd distributions, coredumpctl list shows the cores systemd keeps.
How do I get a backtrace from a Linux core file?
Run gdb with the path to the binary and the core file (or coredumpctl gdb with the process ID), then bt for the crashing thread's stack or thread apply all bt for every thread. The binary must be the same build that crashed, and frames shown as ?? mean missing debug info.
How do I analyze a Linux kernel crash (vmcore)?
kdump must be set up before the crash: a reserved second kernel (the crashkernel= boot parameter) that boots on panic and saves memory to disk. The vmcore lands under /var/crash/ and is read with the crash utility and the debug vmlinux for exactly that kernel. Start with the log command: its last lines usually name the oops and the module.

Rather not read the dump yourself?

Upload it to DumpTriage. It runs the debugger, reads the output and sends back the faulting module, the stack and a plain-language root cause (how the analysis works). Except on the Solo plan, cases the automated passes can't settle go to an engineer. Free during the pilot.

Create an account