System Overview
The crash analysis system consists of:- crash-analysis-agent: Main orchestrator
- crash-analyzer-agent: Deep root-cause analysis using rr traces
- crash-analyzer-checker-agent: Validates analysis rigorously
- function-trace-generator-agent: Creates function execution traces
- coverage-analysis-generator-agent: Generates gcov coverage data
Invocation
System Architecture
Orchestration
Data Collection
Analysis
Validation
Iteration
Main Orchestrator: crash-analysis-agent
Workflow
1. Fetch Bug Report
1. Fetch Bug Report
- Use WebFetch to retrieve bug description from tracker URL
- Extract bug symptoms, test files, reproduction steps
- Parse crash logs and ASAN output if available
2. Clone Repository
2. Clone Repository
3. Create Working Directory
3. Create Working Directory
4. Understand Build System
4. Understand Build System
- Read README, INSTALL, BUILDING.md
- Determine build system type (autotools, CMake, Makefile, meson)
- Identify required dependencies
- Extract build commands
5. Rebuild with Instrumentation
5. Rebuild with Instrumentation
6. Reproduce the Crash
6. Reproduce the Crash
- Download attachments from bug report
- Execute reproduction steps
- Verify crash occurs with ASAN enabled
7. Generate Execution Trace
7. Generate Execution Trace
8. Generate Coverage Data
8. Generate Coverage Data
9. Create RR Recording
9. Create RR Recording
10. Root-Cause Analysis
10. Root-Cause Analysis
- Repository path
- Working directory path
- Crashing example and build instructions
- Bug report details
root-cause-hypothesis-001.md11. Validate Analysis
11. Validate Analysis
- Read rebuttal file
root-cause-hypothesis-001-rebuttal.md - Re-invoke crash-analyzer with feedback
- Repeat until validated or max 3 iterations
12. Confirm Hypothesis
12. Confirm Hypothesis
root-cause-hypothesis-001-confirmed.md with validated analysis13. Wait for Review
13. Wait for Review
crash-analyzer-agent
Purpose
Analyze crashes using rr recordings, function traces, and coverage data to produce root-cause analyses.Methodology
Examine Memory Access
- Allocated memory too small
- Pointer pushed out of bounds
- Memory released and dangling pointer dereferenced
Locate Memory Allocation
- Find allocation site
- Identify any bounds checking between allocation and access
Track Pointers
Identify Logic Issues
Required Analysis Format
Each step in the pointer chain must include:Content Validation
The checker validates:- Complete chain of events from allocation to faulty dereference
- Precise allocation location with actual rr output
- Every pointer modification with actual values at each step
- Pointer values match between steps (end of one = beginning of next)
- Source code and assembly match described scenario
- All functions in chain were actually executed (function trace)
- All code lines in chain were actually executed (coverage data)
Rejection Format
function-trace-generator-agent
Purpose
Generate function-level execution traces for debugging and analysis.Workflow
Build Instrumentation Library
Rebuild Target with Instrumentation
-finstrument-functions -g to CFLAGS and link with libtrace.soRun Crashing Program
Convert to Perfetto Format
coverage-analysis-generator-agent
Purpose
Generate gcov coverage data for code analysis.Workflow
Rebuild with Coverage Flags
--coverage -g to CFLAGS and LDFLAGSRun Crashing Program
Generate Coverage Reports
Copy Coverage Files
Requirements
- rr: Deterministic record-replay debugging
- gcc/clang: With AddressSanitizer support
- gdb: For replay debugging
- gcov: Code coverage tool