Overview
The/crash-analysis command provides autonomous root-cause analysis for C/C++ crashes. It uses deterministic record-replay debugging (rr), function tracing, and coverage analysis to identify the exact cause of security bugs.
Syntax
Parameters
URL to the bug tracker report (e.g., Trac, GitHub Issues, Bugzilla)
URL to the Git repository containing the vulnerable code
What It Does
- Fetches bug report from the provided URL
- Clones repository from Git URL
- Reads README to determine build process
- Rebuilds with instrumentation (AddressSanitizer + debug symbols)
- Reproduces the crash using inputs from bug report
- Generates execution traces with function-level granularity
- Collects coverage data using gcov
- Records with rr for deterministic replay
- Performs root-cause analysis with validation loop
- Produces confirmed hypothesis with evidence
Workflow Agents
The crash analysis workflow orchestrates multiple specialized agents:Main Orchestrator
- crash-analysis-agent: Coordinates the entire workflow
Analysis Agents
- crash-analyzer-agent: Performs deep root-cause analysis using rr traces
- crash-analyzer-checker-agent: Validates analysis rigorously
Data Collection Agents
- function-trace-generator-agent: Creates function execution traces
- coverage-analysis-generator-agent: Generates gcov coverage data
Examples
Analyze FFmpeg Crash
Analyze ImageMagick Vulnerability
Analyze OpenSSL Issue
Prerequisites
Required Tools
Record-replay debugger for deterministic debugging
Compiler with AddressSanitizer support
GNU Debugger for debugging rr traces
Code coverage tool (bundled with gcc)
Analysis Features
Deterministic Replay with rr
rr records program execution and allows perfect replay:- Exact reproduction of crash every time
- Reverse execution to find root cause
- No Heisenbugs (observer effect eliminated)
- Shareable traces for collaboration
Function Tracing
Instruments code to log all function calls:Coverage Analysis
Collects line-level coverage data:Hypothesis-Validation Loop
The analysis follows a rigorous validation process:- Analyzer forms hypothesis about root cause
- Checker validates hypothesis against evidence
- If rejected, analyzer revises with feedback
- If confirmed, produces final report
Output Structure
Root Cause Report Format
Attack Vector
- Attacker creates malicious image with header size > 1024
- Application reads size: 4096 bytes
- memcpy writes beyond buffer bounds
- Heap corruption occurs
Evidence
- rr trace: Crash at memcpy+0x42
- ASAN report: Heap-buffer-overflow write
- Coverage: Line 142 executed
- Function trace: parse_image_header called from main
Impact
- Remote code execution via heap corruption
- Denial of service via crash
- Information disclosure via memory leaks
Recommendations
- Validate size from header:
if (len > 1024) return ERROR; - Use safe memory functions:
memcpy_s(buffer, sizeof(buffer), data, len) - Add fuzzing to test suite
- Enable ASAN in CI/CD pipeline
Reverse Execution
Step backwards through program execution:Integration with Fuzzing
Combine with/fuzz for comprehensive analysis:
Workflow Integration
Related Commands
/fuzz
Find crashes through fuzzing
/exploit
Generate exploits from analysis
/validate
Validate exploitability
/patch
Generate fixes for vulnerabilities
Skills Referenced
The crash analysis workflow uses skills from.claude/skills/crash-analysis/:
- rr-debugger: Deterministic record-replay debugging
- function-tracing: Function instrumentation with -finstrument-functions
- gcov-coverage: Code coverage collection
- line-execution-checker: Fast line execution queries
Notes
- Requires Linux (rr only supports Linux)
- Works best with C/C++ applications
- rr traces can be large (hundreds of MBs)
- Analysis follows hypothesis-validation loop for accuracy
- Produces shareable, reproducible crash traces
- For security research and authorized testing only