# crash-utility/crash architecture

> Architecture diagram of the GitHub repository crash-utility/crash, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/crash-utility/crash
- Repository: https://github.com/crash-utility/crash

## Overview

Crash is a command-line suite for inspecting live Linux kernels and kernel dumps. The main workflow is to start the program with a kernel image and, optionally, a dump; initialize the analysis environment; then use built-in commands or GDB commands to inspect kernel state. Its major branches include architecture-specific analysis, dump-format readers, kernel data and memory analysis, stack unwinding, and extensions. The map follows documented capabilities and visible startup calls; unsampled implementation details are not inferred as call relationships.

Main entry points: [`main.c`](https://github.com/crash-utility/crash/blob/master/main.c) (CLI and Startup), [`xendump.c`](https://github.com/crash-utility/crash/blob/master/xendump.c) (Xen Dump Reader), [`lkcd_x86_trace.c`](https://github.com/crash-utility/crash/blob/master/lkcd_x86_trace.c) (LKCD Traces), [`vmcore.h`](https://github.com/crash-utility/crash/blob/master/vmcore.h) (Vmcore Structures)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Startup and Commands"]
  node_main["CLI and Startup<br/>[main.c]"]
  node_gdb["GDB Interface<br/>[gdb_interface.c]"]
  node_help["Command Help<br/>[help.c]"]
end

subgraph group_analysis["Kernel Analysis"]
  node_kernel["Kernel Initialization<br/>[kernel.c]"]
  node_symbols["Symbols and Types<br/>[symbols.c]"]
  node_tasks["Tasks and Traces<br/>[task.c]"]
  node_unwind["Stack Unwinding<br/>[unwind.c]"]
  node_decoder["Unwind Decoder<br/>[unwind_decoder.c]"]
  node_filesys["Filesystem Analysis<br/>[filesys.c]"]
  node_devices["Device Analysis<br/>[dev.c]"]
  node_shared["Shared Definitions<br/>[defs.h]"]
end

subgraph group_formats["Memory and Dumps"]
  node_diskdump["Disk and Kdump<br/>[diskdump.c]"]
  node_netdump["Netdump and ELF<br/>[netdump.c]"]
  node_xendump["Xen Dump Reader<br/>[xendump.c]"]
  node_lkcd["LKCD Traces<br/>[lkcd_x86_trace.c]"]
  node_vmcore["Vmcore Structures<br/>[vmcore.h]"]
end

subgraph group_platforms["Architecture Support"]
  node_x86["x86 Analysis<br/>[x86_64.c]"]
  node_arm64["ARM64 Analysis<br/>[arm64.c]"]
  node_alpha["Alpha Analysis<br/>[alpha.c]"]
  node_ia64["IA64 Analysis<br/>[ia64.c]"]
  node_xen["Xen Hypervisor<br/>[xen_hyper.c]"]
end

subgraph group_extensions["Extensions"]
  node_dminfo["Device Mapper<br/>[dminfo.c]"]
  node_snap["Memory Capture<br/>[snap.c]"]
end

node_user(("Analyst"))

node_user -->|"starts"| node_main
node_main -->|"enters loop"| node_gdb
node_main -->|"initializes"| node_kernel
node_unwind -->|"uses"| node_decoder
node_diskdump -->|"uses definitions"| node_vmcore
node_netdump -->|"uses definitions"| node_vmcore
node_xendump -->|"reads Xen dumps"| node_xendump
node_lkcd -->|"supports LKCD traces"| node_lkcd
node_user -->|"requests guidance"| node_help
node_user -->|"runs analysis commands"| node_tasks
node_user -->|"runs analysis commands"| node_filesys
node_user -->|"runs analysis commands"| node_devices
node_user -->|"captures memory"| node_snap

click node_main "https://github.com/crash-utility/crash/blob/master/main.c"
click node_gdb "https://github.com/crash-utility/crash/blob/master/gdb_interface.c"
click node_help "https://github.com/crash-utility/crash/blob/master/help.c"
click node_kernel "https://github.com/crash-utility/crash/blob/master/kernel.c"
click node_symbols "https://github.com/crash-utility/crash/blob/master/symbols.c"
click node_tasks "https://github.com/crash-utility/crash/blob/master/task.c"
click node_unwind "https://github.com/crash-utility/crash/blob/master/unwind.c"
click node_decoder "https://github.com/crash-utility/crash/blob/master/unwind_decoder.c"
click node_filesys "https://github.com/crash-utility/crash/blob/master/filesys.c"
click node_devices "https://github.com/crash-utility/crash/blob/master/dev.c"
click node_shared "https://github.com/crash-utility/crash/blob/master/defs.h"
click node_diskdump "https://github.com/crash-utility/crash/blob/master/diskdump.c"
click node_netdump "https://github.com/crash-utility/crash/blob/master/netdump.c"
click node_xendump "https://github.com/crash-utility/crash/blob/master/xendump.c"
click node_lkcd "https://github.com/crash-utility/crash/blob/master/lkcd_x86_trace.c"
click node_vmcore "https://github.com/crash-utility/crash/blob/master/vmcore.h"
click node_x86 "https://github.com/crash-utility/crash/blob/master/x86_64.c"
click node_arm64 "https://github.com/crash-utility/crash/blob/master/arm64.c"
click node_alpha "https://github.com/crash-utility/crash/blob/master/alpha.c"
click node_ia64 "https://github.com/crash-utility/crash/blob/master/ia64.c"
click node_xen "https://github.com/crash-utility/crash/blob/master/xen_hyper.c"
click node_dminfo "https://github.com/crash-utility/crash/blob/master/extensions/dminfo.c"
click node_snap "https://github.com/crash-utility/crash/blob/master/extensions/snap.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_gdb,node_help toneBlue
class node_kernel,node_symbols,node_tasks,node_unwind,node_decoder,node_filesys,node_devices,node_shared toneAmber
class node_diskdump,node_netdump,node_xendump,node_lkcd,node_vmcore toneMint
class node_x86,node_arm64,node_alpha,node_ia64,node_xen toneRose
class node_dminfo,node_snap,node_user toneIndigo
```

## Components

### Startup and Commands

- [CLI and Startup](https://github.com/crash-utility/crash/blob/master/main.c): `main.c`
- [GDB Interface](https://github.com/crash-utility/crash/blob/master/gdb_interface.c): `gdb_interface.c`
- [Command Help](https://github.com/crash-utility/crash/blob/master/help.c): `help.c`

### Kernel Analysis

- [Kernel Initialization](https://github.com/crash-utility/crash/blob/master/kernel.c): `kernel.c`
- [Symbols and Types](https://github.com/crash-utility/crash/blob/master/symbols.c): `symbols.c`
- [Tasks and Traces](https://github.com/crash-utility/crash/blob/master/task.c): `task.c`
- [Stack Unwinding](https://github.com/crash-utility/crash/blob/master/unwind.c): `unwind.c`
- [Unwind Decoder](https://github.com/crash-utility/crash/blob/master/unwind_decoder.c): `unwind_decoder.c`
- [Filesystem Analysis](https://github.com/crash-utility/crash/blob/master/filesys.c): `filesys.c`
- [Device Analysis](https://github.com/crash-utility/crash/blob/master/dev.c): `dev.c`
- [Shared Definitions](https://github.com/crash-utility/crash/blob/master/defs.h): `defs.h`

### Memory and Dumps

- [Disk and Kdump](https://github.com/crash-utility/crash/blob/master/diskdump.c): `diskdump.c`
- [Netdump and ELF](https://github.com/crash-utility/crash/blob/master/netdump.c): `netdump.c`
- [Xen Dump Reader](https://github.com/crash-utility/crash/blob/master/xendump.c): `xendump.c`
- [LKCD Traces](https://github.com/crash-utility/crash/blob/master/lkcd_x86_trace.c): `lkcd_x86_trace.c`
- [Vmcore Structures](https://github.com/crash-utility/crash/blob/master/vmcore.h): `vmcore.h`

### Architecture Support

- [x86 Analysis](https://github.com/crash-utility/crash/blob/master/x86_64.c): `x86_64.c`
- [ARM64 Analysis](https://github.com/crash-utility/crash/blob/master/arm64.c): `arm64.c`
- [Alpha Analysis](https://github.com/crash-utility/crash/blob/master/alpha.c): `alpha.c`
- [IA64 Analysis](https://github.com/crash-utility/crash/blob/master/ia64.c): `ia64.c`
- [Xen Hypervisor](https://github.com/crash-utility/crash/blob/master/xen_hyper.c): `xen_hyper.c`

### Extensions

- [Device Mapper](https://github.com/crash-utility/crash/blob/master/extensions/dminfo.c): `extensions/dminfo.c`
- [Memory Capture](https://github.com/crash-utility/crash/blob/master/extensions/snap.c): `extensions/snap.c`

### Other components

- **Analyst**

## Connections

- Analyst → CLI and Startup: starts (evidence: `README`)
- CLI and Startup → GDB Interface: enters loop (evidence: `main.c`)
- CLI and Startup → Kernel Initialization: initializes (evidence: `main.c`)
- Stack Unwinding → Unwind Decoder: uses (evidence: `unwind.c`)
- Disk and Kdump → Vmcore Structures: uses definitions (evidence: `diskdump.c`)
- Netdump and ELF → Vmcore Structures: uses definitions
- Xen Dump Reader → Xen Dump Reader: reads Xen dumps (evidence: `README`)
- LKCD Traces → LKCD Traces: supports LKCD traces (evidence: `README`)
- Analyst → Command Help: requests guidance (evidence: `README`)
- Analyst → Tasks and Traces: runs analysis commands (evidence: `README`)
- Analyst → Filesystem Analysis: runs analysis commands (evidence: `README`)
- Analyst → Device Analysis: runs analysis commands
- Analyst → Memory Capture: captures memory (evidence: `extensions/snap.c`)
