Core dumps
What Are Core Dumps?
Core dumps are files that record the memory image and processor state of a running program at the moment it crashes or terminates abnormally. When an operating system cannot continue executing a process, it writes this snapshot to disk so that developers can reconstruct what the program was doing, which data values it held, and what sequence of function calls led to the failure. The name derives from magnetic core memory, the dominant storage technology of early computing, though the term persists across all modern hardware architectures.
Core dumps occupy a central role in software debugging methodology for systems software, embedded firmware, and server applications where failures may be difficult to reproduce interactively. They transfer the diagnostic problem from the production environment, where reattaching a debugger may be impossible, to an offline analysis session where full tooling is available.
Structure and Contents
A core dump file contains a copy of the virtual address space segments that the process was using at crash time, together with the values of all processor registers, including the program counter, stack pointer, and general-purpose registers. On Linux systems, the core file follows the ELF (Executable and Linkable Format) specification, which organizes the dump into program header entries describing each memory region. Thread state, signal information, and, optionally, mapped shared library segments are included alongside the application's own stack and heap memory. The Red Hat Enterprise Linux developer guide on debugging crashed applications describes how the kernel writes core files and how system administrators configure coredump size limits and naming patterns through kernel parameters.
Generation and Collection
Core dump generation is controlled by the operating system's resource limit for the process (the RLIMIT_CORE limit on POSIX systems), by kernel configuration, and, in Linux systems running systemd, by the systemd-coredump service that routes dumps through the journal for centralized storage. Signals that generate core dumps by default include SIGSEGV (segmentation fault from an invalid memory access), SIGABRT (abnormal termination called explicitly), SIGBUS (bus error from misaligned memory access), and SIGFPE (floating-point exception). In kernel crash analysis, the kdump mechanism captures a secondary kernel dump after a kernel panic, writing the crash image to a reserved memory region and then transferring it to disk for analysis with the crash utility and GDB-based tools. Containerized and cloud environments have introduced new challenges for core dump collection because the filesystem namespaces of short-lived containers may not persist after the container exits.
Analysis and Debugging
Analyzing a core dump requires a symbolic debugger and the original executable with debugging symbols, or a separately stored symbol package. The GNU Debugger (GDB) is the standard tool on Linux and Unix-like systems; loading a core file alongside the executable restores the process state at crash time, allowing stack backtraces, variable inspection, and memory examination. Common failure modes diagnosed from core dumps include null pointer dereferences, stack overflows, use-after-free bugs, and heap corruption. The Oracle Java SE troubleshooting guide describes how core dumps from JVM crashes are collected and analyzed using HotSpot-specific tooling, illustrating how the technique extends beyond native code to managed runtime environments. Static analysis of core dumps can also reveal security vulnerabilities by exposing heap layouts exploitable through memory corruption attacks.
Applications
Core dumps have applications in software engineering, systems administration, and security research, including:
- Post-mortem debugging of production server crashes without requiring live process attachment
- Kernel crash analysis following operating system panics in embedded and server systems
- Malware forensics and reverse engineering of crashed exploit payloads
- Automated crash triage pipelines that classify failures by stack signature
- Quality assurance workflows that reproduce and verify fixes against captured crash states