Closed t-moe closed 8 months ago
A panic by esp-idf-hal looks like this:
... thread 'main' panicked at src/main.rs:2:5: oh no note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace abort() was called at PC 0x42029be5 on core 0 Core 0 register dump: MEPC : 0x40800ecc RA : 0x40804152 SP : 0x4080f330 GP : 0x408096e0 TP : 0x407f0a54 T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130 S0/FP : 0x4080f36c S1 : 0x4080f36c A0 : 0x4080f36c A1 : 0x4080f34e A2 : 0x00000000 A3 : 0x4080f399 A4 : 0x4080aebc A5 : 0x4080aec4 A6 : 0x00000000 A7 : 0x76757473 S2 : 0x4080f350 S3 : 0x4080f488 S4 : 0x00000001 S5 : 0x00000000 S6 : 0x4205013c S7 : 0x00000001 S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000 T3 : 0x6e6d6c6b T4 : 0x6a696867 T5 : 0x66656463 T6 : 0x62613938 MSTATUS : 0x00001881 MTVEC : 0x40800001 MCAUSE : 0x00000007 MTVAL : 0x00000000 MHARTID : 0x00000000 Stack memory: 4080f330: 0x00000000 0x42053c04 0x4080f36c 0x40807e80 0x00000003 0x00000000 0x00000001 0x40800030 4080f350: 0x32303234 0x35656239 0x40810100 0x40809f8c 0x4080f350 0x40809fa8 0x4080f34c 0x726f6261 4080f370: 0x20292874 0x20736177 0x6c6c6163 0x61206465 0x43502074 0x34783020 0x39323032 0x20356562 4080f390: 0x63206e6f 0x2065726f 0x00000030 0x40800000 0x42053d68 0x4080a194 0x4080f3c0 0x42029be8 4080f3b0: 0x00000001 0x4081011c 0x4080f3d0 0x42029bd8 0x40810120 0x4081011c 0x4080f410 0x4200ab2c 4080f3d0: 0x42053d68 0x4080a194 0x4080f3f0 0x4200b2d2 0x00000001 0x4081011c 0x4080f400 0x4200abe0 4080f3f0: 0x42053d68 0x4080a194 0x4080f410 0x42014af0 0x42053d68 0x4080a194 0x4080f480 0x4200aaf2 4080f410: 0x00000804 0x00000054 0x00000000 0x00000000 0x00000000 0x4080f488 0x42053d58 0x4080f4f0 4080f430: 0x4205013c 0x00000001 0x00000000 0x00000000 0x00000000 0x00000000 0x40810090 0x00000000 4080f450: 0x4080f4a8 0x4080f4d4 0x4080f4a0 0x00000000 0x00000000 0x00000000 0x00000000 0x4205013c 4080f470: 0x4080f4f0 0x4080f4d4 0x4080f4a0 0x4200a8b2 0x00000005 0x00000005 0x42050120 0x00000005 4080f490: 0x4080f554 0x4080f4d4 0x4080f4b0 0x42009f9e 0x4080ff60 0x00000005 0x4080f4d0 0x4200a6c0 4080f4b0: 0x4080f4f0 0x4080f4d4 0x4205013c 0x00000000 0x4080f554 0x4205014c 0x4080f4f0 0x4203b7e0 4080f4d0: 0x4080a260 0x420649c0 0x420649c0 0x4080f4f0 0x4205013c 0x40800001 0x4080f510 0x42000082 4080f4f0: 0x42050128 0x00000001 0x42050120 0x00000000 0x00000000 0x00000000 0x4080f520 0x4200002a 4080f510: 0x00000000 0x4205014c 0x4080f530 0x420000ea 0x4080f564 0x4080ff28 0x4080f550 0x4201d7bc 4080f530: 0x4080f564 0x00000000 0x420504ec 0x4204a500 0x00000000 0x00000000 0x4080f560 0x420000d0 4080f550: 0x420694e0 0x42000032 0x00000000 0x4204a5e4 0x00000000 0x00001388 0x00000001 0x00000000 4080f570: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 4080f590: 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 4080f5b0: 0x00000154 0x4080f170 0x00000000 0x4080a410 0x4080a410 0x4080f5b4 0x4080a408 0x00000018 4080f5d0: 0x00000000 0x00000000 0x4080f5b4 0x00000000 0x00000001 0x4080d470 0x6e69616d 0x00000000 4080f5f0: 0x00000000 0x00000000 0x00000000 0x4080f5a0 0x00000001 0x00000000 0x408100b4 0x4203dbb4 4080f610: 0x00000000 0x4080bcd0 0x4080bd38 0x4080bda0 0x00000000 0x00000000 0x00000001 0x00000000 4080f630: 0x00000000 0x00000000 0x42041e48 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 4080f650: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 4080f670: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 4080f690: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 4080f6b0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 4080f6d0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 4080f6f0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000600 0xa5a5a5a5 4080f710: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 ELF file SHA256: 000000000 CPU halted.
and is decoded by espflash run --monitor to something like this:
espflash run --monitor
if CONFIG_ESP_SYSTEM_USE_EH_FRAME=y is added to sdkconfig.defaults the output looks like this:
CONFIG_ESP_SYSTEM_USE_EH_FRAME=y
sdkconfig.defaults
thread 'main' panicked at src/main.rs:11:5: oh no stack backtrace: abort() was called at PC 0x42044d2d on core 0 Backtrace: 0x40800eba:0x4080f1a0 0x4080413e:0x4080f1a0 0x40807e6c:0x4080f1b0 0x42044d2e:0x4080f220 0x4201edae:0x4080f230 0x4200ab30:0x4080f240 0x42038d74:0x4080f2b0 0x42020414:0x4080f300 0x4200aa0e:0x4080f320 0x4200b026:0x4080f370 0x4200aee8:0x4080f3d0 0x4200b66a:0x4080f460 0x4200b4de:0x4080f4d0 0x4200abca:0x4080f4f0 0x4200b2ec:0x4080f500 0x4203d740:0x4080f520 0x42000210:0x4080f540 0x42000220:0x4080f5e0 0x42000230:0x4080f5f0 0x4200026c:0x4080f600 0x4200003e:0x4080f610 0x420002ea:0x4080f620 0x4201e8e6:0x4080f630 0x420002d0:0x4080f650 0x4204d0e8:0x4080f660 0xfffffffe:0x4080f680 Backtrace ended abruptly: cannot find DWARF information for instruction at address 0xfffffffe
and is expanded to something like this:
In both cases a the auto-decoding adds a lot of noise and makes the output unreadable.
Can we improve this?
(related https://github.com/esp-rs/esp-idf-sys/issues/275 )
According to the latest comments of https://github.com/esp-rs/esp-idf-sys/issues/275, we can close this issue as there is no-trivial solution that can be implemented in espflash for this, right @t-moe?
A panic by esp-idf-hal looks like this:
and is decoded by
espflash run --monitor
to something like this:Click to expand
``` thread 'main' panicked at src/main.rs:2:5: oh no note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace abort() was called at PC 0x42029be5 on core 0 0x42029be5 - panic_abort::__rust_start_panic::abort at /home/timo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/panic_abort/src/lib.rs:43 Core 0 register dump: MEPC : 0x40800ecc RA : 0x40804152 SP : 0x4080f330 GP : 0x408096e0 0x40800ecc - panic_abort at /home/timo/esp/esp-idf/components/esp_system/panic.c:472 0x40804152 - __ubsan_include at /home/timo/esp/esp-idf/components/esp_system/ubsan.c:313 0x4080f330 - _ZN12_GLOBAL__N_110eh_globalsE at ??:?? 0x408096e0 - coex_pti_tab at ??:?? TP : 0x407f0a54 T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130 0x407f0a54 - ?? at ??:?? 0x37363534 - ?? at ??:?? 0x7271706f - s_rtc_timer_retain_mem at ??:?? 0x33323130 - ?? at ??:?? S0/FP : 0x4080f36c S1 : 0x4080f36c A0 : 0x4080f36c A1 : 0x4080f34e 0x4080f36c - _ZN12_GLOBAL__N_110eh_globalsE at ??:?? 0x4080f36c - _ZN12_GLOBAL__N_110eh_globalsE at ??:?? 0x4080f36c - _ZN12_GLOBAL__N_110eh_globalsE at ??:?? 0x4080f34e - _ZN12_GLOBAL__N_110eh_globalsE at ??:?? A2 : 0x00000000 A3 : 0x4080f399 A4 : 0x4080aebc A5 : 0x4080aec4 0x00000000 - ?? at ??:?? 0x4080f399 - _ZN12_GLOBAL__N_110eh_globalsE at ??:?? 0x4080aebc - coex_schm_env at ??:?? 0x4080aec4 - __sf at ??:?? A6 : 0x00000000 A7 : 0x76757473 S2 : 0x4080f350 S3 : 0x4080f488 0x00000000 - ?? at ??:?? 0x76757473 - s_rtc_timer_retain_mem at ??:?? 0x4080f350 - _ZN12_GLOBAL__N_110eh_globalsE at ??:?? 0x4080f488 - _ZN12_GLOBAL__N_110eh_globalsE at ??:?? S4 : 0x00000001 S5 : 0x00000000 S6 : 0x4205013c S7 : 0x00000001 0x00000001 - ?? at ??:?? 0x00000000 - ?? at ??:?? 0x4205013c - esp_app_desc at ??:?? 0x00000001 - ?? at ??:?? S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000 0x00000000 - ?? at ??:?? 0x00000000 - ?? at ??:?? 0x00000000 - ?? at ??:?? 0x00000000 - ?? at ??:?? T3 : 0x6e6d6c6b T4 : 0x6a696867 T5 : 0x66656463 T6 : 0x62613938 0x6e6d6c6b - s_rtc_timer_retain_mem at ??:?? 0x6a696867 - s_rtc_timer_retain_mem at ??:?? 0x66656463 - s_rtc_timer_retain_mem at ??:?? 0x62613938 - s_rtc_timer_retain_mem at ??:?? MSTATUS : 0x00001881 MTVEC : 0x40800001 MCAUSE : 0x00000007 MTVAL : 0x00000000 0x00001881 - ?? at ??:?? 0x40800001 - _vector_table at ??:?? 0x00000007 - ?? at ??:?? 0x00000000 - ?? at ??:?? MHARTID : 0x00000000 0x00000000 - ?? at ??:?? Stack memory: 4080f330: 0x00000000 0x42053c04 0x4080f36c 0x40807e80 0x00000003 0x00000000 0x00000001 0x40800030 0x00000000 - ?? at ??:?? 0x42053c04 - anon.6f8d54fb548d5ff1abf9d01d3f110dc8.67.llvm.17408016719535564914 at ??:?? 0x4080f36c - _ZN12_GLOBAL__N_110eh_globalsE at ??:?? 0x40807e80 - __assert_func at /home/timo/esp/esp-idf/components/newlib/assert.c:34 0x00000003 - ?? at ??:?? 0x00000000 - ?? at ??:?? 0x00000001 - ?? at ??:?? 0x40800030 - _vector_table at ??:?? 4080f350: 0x32303234 0x35656239 0x40810100 0x40809f8c 0x4080f350 0x40809fa8 0x4080f34c 0x726f6261 0x32303234 - ?? at ??:?? 0x35656239 - ?? at ??:?? 0x40810100 - _ZN12_GLOBAL__N_110eh_globalsE at ??:?? 0x40809f8c - __func__.0 at ??:?? 0x4080f350 - _ZN12_GLOBAL__N_110eh_globalsE at ??:?? 0x40809fa8 - __func__.0 at ??:?? 0x4080f34c - _ZN12_GLOBAL__N_110eh_globalsE at ??:?? 0x726f6261 - s_rtc_timer_retain_mem at ??:?? 4080f370: 0x20292874 0x20736177 0x6c6c6163 0x61206465 0x43502074 0x34783020 0x39323032 0x20356562 0x20292874 - ?? at ??:?? 0x20736177 - ?? at ??:?? 0x6c6c6163 - s_rtc_timer_retain_mem at ??:?? 0x61206465 - s_rtc_timer_retain_mem at ??:?? 0x43502074 - esp_system_init_fn_init_components0 at ??:?? 0x34783020 - ?? at ??:?? 0x39323032 - ?? at ??:?? 0x20356562 - ?? at ??:?? 4080f390: 0x63206e6f 0x2065726f 0x00000030 0x40800000 0x42053d68 0x4080a194 0x4080f3c0 0x42029be8 0x63206e6f - s_rtc_timer_retain_mem at ??:?? 0x2065726f - ?? at ??:?? 0x00000030 - ?? at ??:?? 0x40800000 - _vector_table at ??:?? 0x42053d68 - anon.6f8d54fb548d5ff1abf9d01d3f110dc8.67.llvm.17408016719535564914 at ??:?? 0x4080a194 - _ZN3std9panicking4HOOK17hbc435311aff44f7fE at ??:?? 0x4080f3c0 - _ZN12_GLOBAL__N_110eh_globalsE at ??:?? 0x42029be8 -if
CONFIG_ESP_SYSTEM_USE_EH_FRAME=y
is added tosdkconfig.defaults
the output looks like this:and is expanded to something like this:
click to expand
``` ... thread 'main' panicked at src/main.rs:11:5: oh no stack backtrace: abort() was called at PC 0x42044d2d on core 0 0x42044d2d - abort_returnIn both cases a the auto-decoding adds a lot of noise and makes the output unreadable.
Can we improve this?
(related https://github.com/esp-rs/esp-idf-sys/issues/275 )