feat(Telemetry): backtrace, abort reason and pre-crash snapshot in crash reports (F-070)
Crash reports only carried the coredump's PC/cause/vaddr, which for every abort() is panic_abort()'s own write to 0x0 - so all aborts looked the same. - Read the coredump backtrace (up to 16 PCs) and crashing ELF SHA prefix - Wrap esp_system_abort (-Wl,--wrap) to keep the abort/assert/stack-overflow message in RTC_NOINIT memory across the reboot - TelemetryTask snapshots uptime/free heap/largest block/min free heap into the same RTC block every second - Reported in MQTT boot_report and SD boot log as crash.backtrace, crash.elf_sha256 and a new pre_crash object (additive) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -284,12 +284,23 @@ Published once, the first time MQTT connects after boot (guarded, not repeated o
|
||||
"reset_reason": "PANIC",
|
||||
"is_fault": true,
|
||||
"free_heap": 187234,
|
||||
"crash": { "task": "TelemetryTask", "pc": 1074111832, "exc_cause": 1, "exc_vaddr": 0 }
|
||||
"crash": {
|
||||
"task": "async_tcp", "pc": 1074282197, "exc_cause": 29, "exc_vaddr": 0,
|
||||
"backtrace": [1074282194, 1074340312, 1074348122, 1074606712],
|
||||
"backtrace_corrupted": false,
|
||||
"elf_sha256": "3f9a1c0be7d2a441"
|
||||
},
|
||||
"pre_crash": {
|
||||
"uptime_ms": 5412000, "free_heap": 21480, "largest_block": 9716, "min_free_heap": 18112,
|
||||
"abort_msg": "abort() was called at PC 0x400d8a3f on core 0"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`crash` is present only when a coredump was found for the crash that caused this boot — omitted on a clean/expected reset or a fault reset with no coredump (e.g. brownout). A fault-class reset additionally publishes a `system/alerts` WARNING (see above) — `system/info`'s `boot_report` is published unconditionally, fault or not.
|
||||
`crash` is present only when a coredump was found for the crash that caused this boot — omitted on a clean/expected reset or a fault reset with no coredump (e.g. brownout). `backtrace` (up to 16 PCs, decimal) and `elf_sha256` (first 16 hex chars of the crashing build's ELF SHA-256) identify the call chain; decode with `addr2line` against that exact `.elf`.
|
||||
|
||||
`pre_crash` (F-070) is present only on a fault reset where RTC memory survived (not power-on/brownout): the last once-per-second heap/uptime snapshot before the reset, plus `abort_msg` when the reset came from `abort()`/`assert`/a stack-overflow check. For those resets `pc`/`exc_cause 29`/`exc_vaddr 0` are the abort mechanism itself; `abort_msg` and the later `backtrace` frames are the real cause. A fault-class reset additionally publishes a `system/alerts` WARNING (see above) — `system/info`'s `boot_report` is published unconditionally, fault or not.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user