esp32_crash_review
Skill79 starsChanged 8 months agoMITView on GitHub
Analyze ESP32 Guru Meditation errors and crash dumps to identify root cause and recommend fixes.
In this repository9 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- esp32_arch_reviewSkill
- esp32_log_triageSkill
- esp32_pin_auditSkill
- esp32_test_planSkill
- feature_contractSkill
- esp32_hardware_checkSkill
- pr_prepareSkill
- repo_scoutSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
After observing a Guru Meditation error.
- Distinctive: line 13
When a device is stuck in a crash-reboot loop.
- Distinctive: line 14
When analyzing crash dumps from field devices.
- Distinctive: line 64
Fix: Add NULL checks before dereferencing.
- Distinctive: line 74
Fix: Use ISR-safe API variants only.
- Distinctive: line 84
Fix: Add yields, reduce critical section length, feed watchdog.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ESP32 Crash Review
Analyze crash reports, Guru Meditation errors, and panic dumps to determine root cause.
When to Use
- After observing a Guru Meditation error.
- When a device is stuck in a crash-reboot loop.
- When analyzing crash dumps from field devices.
Steps
1. Identify the Exception Type
| Exception | Cause |
LoadProhibited | Read from invalid memory (often NULL pointer) |
StoreProhibited | Write to invalid memory |
InstrFetchProhibited | Tried to execute code from invalid address |
IllegalInstruction | Stack corruption, code corruption, or invalid function pointer |
IntegerDivideByZero | Division by zero |
Unaligned | Unaligned memory access |
2. Extract Key Information
From the panic output, collect:
Guru Meditation Error: Core [0/1] panic'ed ([ExceptionType]).
Exception was unhandled.
Core [N] register dump:
PC : 0x........ PS : 0x........
A0 : 0x........ A1 : 0x........ ...
EXCVADDR: 0x........ ← The address that caused the faultPC (Program Counter) → Where the crash happened. EXCVADDR (Exception Address) → What address was accessed illegally. A1 → Stack pointer at time of crash.
3. Decode the Backtrace
# Using addr2line
xtensa-esp32-elf-addr2line -pfiaC -e build/project.elf ADDR1 ADDR2 ADDR3
# Using idf.py
idf.py monitor # Automatically decodes backtraces
# Using ESP-IDF monitor with ELF
python -m esp_idf_monitor --port /dev/ttyUSB0 --baud 115200 build/project.elf4. Analyze Common Patterns
NULL Pointer Dereference
- EXCVADDR:
0x00000000or small value (<0x100) - Cause: Using an uninitialized pointer or a handle that failed to initialize.
- Fix: Add NULL checks before dereferencing.
Stack Overflow
- Signs:
IllegalInstructionorLoadProhibitedwith A1 near the end of stack space. - Cause: Task stack too small, deep recursion, large local variables.
- Fix: Increase task stack size, reduce local buffer sizes, check recursion depth.
ISR Violation
- Signs: Crash inside a FreeRTOS API that is not
*FromISR. - Cause: Calling blocking functions from an interrupt handler.
- Fix: Use ISR-safe API variants only.
Memory Corruption
- Signs:
IllegalInstructionat a random address, corrupted register values. - Cause: Buffer overflow, use-after-free, heap corruption.
- Fix: Enable heap poisoning (
CONFIG_HEAP_POISONING_COMPREHENSIVE), use AddressSanitizer.
Watchdog Reset (not Guru Meditation but related)
- Signs:
TG0WDT_SYS_RESETorTG1WDT_SYS_RESETin reset reason. - Cause: Task not yielding, blocking the idle task or system tasks.
- Fix: Add yields, reduce critical section length, feed watchdog.
5. Recommend Diagnostic Steps
Based on the analysis, suggest:
- Immediate fix — if root cause is clear.
- Diagnostic configuration — enable features that help narrow down:
CONFIG_HEAP_POISONING_COMPREHENSIVE=yCONFIG_HEAP_TASK_TRACKING=yCONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=yCONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=yCONFIG_COMPILER_STACK_CHECK=y
- Reproduction steps — minimal steps to trigger the crash again.
6. Generate Crash Report
# Crash Analysis Report
## Exception
- **Type**: [ExceptionType]
- **Core**: [0/1]
- **PC**: [address] → [decoded function]
- **EXCVADDR**: [address]
## Backtrace
| # | Address | Function | File:Line |
|---|---------|----------|-----------|
| 0 | 0x... | function_name | file.c:123 |
## Root Cause
[Analysis of most likely cause]
## Classification
[NULL pointer / Stack overflow / ISR violation / Memory corruption / Other]
## Recommended Fix
[Specific code change or configuration]
## Prevention
[How to prevent this class of bug in the future]Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

