What causes "Corrupt Stack" messages in coredump?

squirtle321
Posts: 11
Joined: Tue Jan 11, 2022 9:26 pm

What causes "Corrupt Stack" messages in coredump?

Postby squirtle321 » Fri Apr 21, 2023 10:25 pm

I'm trying to debug an IWDT timeout and inspecting the coredump I notice that the crashed task seems to always have the message:
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
What causes these messages? I notice that the contents of the back trace with that message does not match the functions that would likely be called by the task, i.e. i2c_isr_handler_default in the btController task, or IDLE task.

Here is an example backtrace and coredump:

Code: Select all

Guru Meditation Error: Core  0 panic'ed (Interrupt wdt timeout on CPU0).

Core  0 register dump:
PC      : 0x4008af7c  PS      : 0x00060035  A0      : 0x40083108  A1      : 0x3ffbeb30
0x4008af7c: i2c_isr_handler_default at D:/Espressif/frameworks/esp-idf-v4.4.1/components/driver/i2c.c:506

0x40083108: _xt_lowint1 at D:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/xtensa_vectors.S:1111

A2      : 0x3ffd2080  A3      : 0x00000000  A4      : 0x00000002  A5      : 0x400925f0
0x400925f0: _frxt_int_enter at D:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/portasm.S:119

A6      : 0x00000003  A7      : 0x00000000  A8      : 0x8008af7c  A9      : 0x3ffbeb00
A10     : 0x00000001  A11     : 0x3ffbeb30  A12     : 0x3ffbeb38  A13     : 0x00000000
A14     : 0x00000001  A15     : 0x3ffd21a4  SAR     : 0x00000017  EXCCAUSE: 0x00000005
EXCVADDR: 0x00000000  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0xffffffff
Core  0 was running in ISR context:
EPC1    : 0x400d3b83  EPC2    : 0x00000000  EPC3    : 0x4000bff0  EPC4    : 0x4000bff6
0x400d3b83: uart_hal_write_txfifo at D:/Espressif/frameworks/esp-idf-v4.4.1/components/hal/uart_hal_iram.c:35



Backtrace:0x4008af79:0x3ffbeb300x40083105:0x3ffbeb60 0x4008b072:0x3ffb5f10 0x400836b5:0x3ffb5f20 0x40083a9f:0x3ffb5f40 0x4008aa06:0x3ffb5f60 0x400ebc41:0x3ffb5f80 0x400ec270:0x3ffb5fa0
0x4008af79: i2c_isr_handler_default at D:/Espressif/frameworks/esp-idf-v4.4.1/components/driver/i2c.c:506

0x40083105: _xt_lowint1 at D:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/xtensa_vectors.S:1111

0x4008b072: i2c_isr_handler_default at D:/Espressif/frameworks/esp-idf-v4.4.1/components/driver/i2c.c:531

0x400836b5: hli_intr_restore at D:/Espressif/frameworks/esp-idf-v4.4.1/components/bt/controller/esp32/hli_api.c:117

0x40083a9f: interrupt_hlevel_restore at D:/Espressif/frameworks/esp-idf-v4.4.1/components/bt/controller/esp32/bt.c:590

0x4008aa06: r_global_int_restore at ??:?

0x400ebc41: r_rw_schedule at ??:?

0x400ec270: btdm_controller_task at ??:?



Core  1 register dump:
PC      : 0x40092d1f  PS      : 0x00060e35  A0      : 0x800934e6  A1      : 0x3ffd4a50
0x40092d1f: prvCopyDataFromQueue at D:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/queue.c:2322

A2      : 0x3ffd2150  A3      : 0x3ffd4ac0  A4      : 0x3ffd21a4  A5      : 0x00000000
A6      : 0x00000003  A7      : 0x00060023  A8      : 0x3ffc4994  A9      : 0x00000001
A10     : 0x00060e20  A11     : 0x00000000  A12     : 0x00000001  A13     : 0x00060e23
A14     : 0x00000000  A15     : 0x00000000  SAR     : 0x0000000b  EXCCAUSE: 0x00000005
EXCVADDR: 0x00000000  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0xffffffff


Backtrace:0x40092d1c:0x3ffd4a500x400934e3:0x3ffd4a70 0x40105b6f:0x3ffd4ab0 0x400d92f9:0x3ffd4af0 0x400d8cdd:0x3ffd4b30 0x40103549:0x3ffd4b50 0x40102ebf:0x3ffd4b70 0x400daa11:0x3ffd4ba0
0x40092d1c: prvCopyDataFromQueue at D:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/queue.c:2321

0x400934e3: xQueueReceive at D:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/queue.c:1409

0x40105b6f: i2c_master_cmd_begin at D:/Espressif/frameworks/esp-idf-v4.4.1/components/driver/i2c.c:1466

0x400d92f9: i2c_common_read_mprl_pressure_sensor at D:/git/Project/components/board/i2c_common.c:152

0x400d8cdd: i2c_3_read_pressure at D:/git/Project/components/board/MLB_3_X/i2c_3.c:91

0x40103549: sensor_interface_get_pressure_adc at D:/git/Project/components/board/MLB_3_X/sensor_implementation_3.c:134

0x40102ebf: read_pressure at D:/git/Project/components/sensors_actuators/sensors.c:173

0x400daa11: control_task_update_sensors at D:/git/Project/components/control_task/control_task.c:408
 (inlined by) control_task at D:/git/Project/components/control_task/control_task.c:83





ELF file SHA256: b11b224f3fc1e0cc

Initiating core dump!
I (16829) esp_core_dump_uart: Press Enter to print core dump to UART...
I (16836) esp_core_dump_uart: Print core dump to uart...
Core dump started (further output muted)
Received  28 kB...
Core dump finished!
espcoredump.py v0.4-dev
===============================================================
==================== ESP32 CORE DUMP START ====================

Crashed task handle: 0x3ffb6038, name: 'btController', GDB name: 'process 1073438776'

================== CURRENT THREAD REGISTERS ===================
exccause       0x45 (InterruptWDTTimoutCPU0)
excvaddr       0x0
epc1           0x4011177b
epc2           0x0
epc3           0x4000bff0
epc4           0x4000bff6
epc5           0x4008af7c
epc6           0x0
eps2           0x0
eps3           0x60021
eps4           0x60023
eps5           0x60021
eps6           0x0
pc             0x4008af7c          0x4008af7c <i2c_isr_handler_default+180>
lbeg           0x4000c2e0          1073791712
lend           0x4000c2f6          1073791734
lcount         0xffffffff          4294967295
sar            0x17                23
ps             0x60025             393253
threadptr      <unavailable>
br             <unavailable>
scompare1      <unavailable>
acclo          <unavailable>
acchi          <unavailable>
m0             <unavailable>
m1             <unavailable>
m2             <unavailable>
m3             <unavailable>
expstate       <unavailable>
f64r_lo        <unavailable>
f64r_hi        <unavailable>
f64s           <unavailable>
fcr            <unavailable>
fsr            <unavailable>
a0             0x40083108          1074278664
a1             0x3ffbeb30          1073474352
a2             0x3ffd2080          1073553536
a3             0x0                 0
a4             0x2                 2
a5             0x400925f0          1074341360
a6             0x3                 3
a7             0x0                 0
a8             0x8008af7c          -2146914436
a9             0x3ffbeb00          1073474304
a10            0x1                 1
a11            0x3ffbeb30          1073474352
a12            0x3ffbeb38          1073474360
a13            0x0                 0
a14            0x1                 1
a15            0x3ffd21a4          1073553828

==================== CURRENT THREAD STACK =====================
#0  0x4008af7c in i2c_isr_handler_default (arg=0x3ffd2080) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/driver/i2c.c:506
#1  0x40083108 in _xt_lowint1 () at D:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa\\xtensa_vectors.S:1111
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

======================== THREADS INFO =========================
  Id   Target Id          Frame
* 1    process 1073438776 0x4008af7c in i2c_isr_handler_default (arg=0x3ffd2080) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/driver/i2c.c:506
  2    process 1073564772 0x3ffd4a50 in ?? ()
  3    process 1073464148 0x40191bfa in esp_pm_impl_waiti () at D:/Espressif/frameworks/esp-idf-v4.4.1/components/hal/esp32/include/hal/cpu_ll.h:183
  4    process 1073466816 0x40191bfa in esp_pm_impl_waiti () at D:/Espressif/frameworks/esp-idf-v4.4.1/components/hal/esp32/include/hal/cpu_ll.h:183
  5    process 1073575376 0x4008cda0 in esp_crosscore_int_send_yield (core_id=0) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/crosscore_int.c:144
  6    process 1073588028 0x4008cda0 in esp_crosscore_int_send_yield (core_id=0) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/crosscore_int.c:144
  7    process 1073603112 0x4008cda0 in esp_crosscore_int_send_yield (core_id=0) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/crosscore_int.c:144
  8    process 1073444520 0x4008cd8f in esp_crosscore_int_send (core_id=<optimized out>, reason_mask=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/crosscore_int.c:127
  9    process 1073446196 0x40093716 in xQueueSemaphoreTake (xQueue=0x3ffb78d0, xTicksToWait=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/hal/esp32/include/hal/cpu_ll.h:39
  10   process 1073469484 0x4008cda0 in esp_crosscore_int_send_yield (core_id=0) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/crosscore_int.c:144
  11   process 1073597956 0x4008cda0 in esp_crosscore_int_send_yield (core_id=0) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/crosscore_int.c:144
  12   process 1073607260 0x4008cda0 in esp_crosscore_int_send_yield (core_id=0) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/crosscore_int.c:144
  13   process 1073459328 0x4000bff0 in ?? ()
  14   process 1073609284 0x4008cda0 in esp_crosscore_int_send_yield (core_id=0) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/crosscore_int.c:144

==================== THREAD 1 (TCB: 0x3ffb6038, name: 'btController') =====================
#0  0x4008af7c in i2c_isr_handler_default (arg=0x3ffd2080) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/driver/i2c.c:506
#1  0x40083108 in _xt_lowint1 () at D:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa\\xtensa_vectors.S:1111
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

==================== THREAD 2 (TCB: 0x3ffd4c64, name: 'CONTROL_TASK') =====================
#0  0x3ffd4a50 in ?? ()
#1  0x00094efe in ?? ()
#2  0x000934a4 in ?? ()
#3  0x00105b72 in ?? ()
#4  0x000d92fc in ?? ()
#5  0x000d8ce0 in ?? ()
#6  0x0010354c in ?? ()
#7  0x00102ec2 in ?? ()
#8  0x000daa14 in ?? ()

==================== THREAD 3 (TCB: 0x3ffbc354, name: 'IDLE') =====================
#0  0x40191bfa in esp_pm_impl_waiti () at D:/Espressif/frameworks/esp-idf-v4.4.1/components/hal/esp32/include/hal/cpu_ll.h:183
#1  0x400d3660 in esp_vApplicationIdleHook () at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/freertos_hooks.c:63
#2  0x40093b66 in prvIdleTask (pvParameters=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/tasks.c:3973

==================== THREAD 4 (TCB: 0x3ffbcdc0, name: 'IDLE') =====================
#0  0x40191bfa in esp_pm_impl_waiti () at D:/Espressif/frameworks/esp-idf-v4.4.1/components/hal/esp32/include/hal/cpu_ll.h:183
#1  0x400d3660 in esp_vApplicationIdleHook () at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/freertos_hooks.c:63
#2  0x40093b66 in prvIdleTask (pvParameters=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/tasks.c:3973

==================== THREAD 5 (TCB: 0x3ffd75d0, name: 'COMM_TASK') =====================
#0  0x4008cda0 in esp_crosscore_int_send_yield (core_id=0) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/crosscore_int.c:144
#1  0x400950bf in xTaskDelayUntil (pxPreviousWakeTime=<optimized out>, xTimeIncrement=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/hal/esp32/include/hal/cpu_ll.h:39
#2  0x400d9bf1 in communication_task () at D:/git/Project/components/communications/communication_task.c:148

==================== THREAD 6 (TCB: 0x3ffda73c, name: 'MAIN_TASK') =====================
#0  0x4008cda0 in esp_crosscore_int_send_yield (core_id=0) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/crosscore_int.c:144
#1  0x400950bf in xTaskDelayUntil (pxPreviousWakeTime=<optimized out>, xTimeIncrement=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/hal/esp32/include/hal/cpu_ll.h:39
#2  0x400d8404 in main_task () at ../main/main.c:81
Exception in thread Thread-1:
Traceback (most recent call last):
  File "D:\AppData\Local\Programs\Python\Python39\lib\threading.py", line 973, in _bootstrap_inner
    self.run()
  File "D:\AppData\Local\Programs\Python\Python39\lib\threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "D:\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1479, in _readerthread
    buffer.append(fh.read())
OSError: [Errno 22] Invalid argument

==================== THREAD 7 (TCB: 0x3ffde228, name: 'tiT') =====================
#0  0x4008cda0 in esp_crosscore_int_send_yield (core_id=0) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/crosscore_int.c:144
#1  0x4009359c in xQueueReceive (xQueue=0x3ffdd344, pvBuffer=0x3ffde190, xTicksToWait=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/hal/esp32/include/hal/cpu_ll.h:39
#2  0x4012897c in sys_arch_mbox_fetch (mbox=0x3ffc8e30 <tcpip_mbox>, msg=0x3ffde190, timeout=500) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/lwip/port/esp32/freertos/sys_arch.c:330
#3  0x40118191 in tcpip_timeouts_mbox_fetch (mbox=<optimized out>, msg=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/lwip/lwip/src/api/tcpip.c:110
#4  tcpip_thread (arg=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/lwip/lwip/src/api/tcpip.c:148

==================== THREAD 8 (TCB: 0x3ffb76a8, name: 'ipc0') =====================
#0  0x4008cd8f in esp_crosscore_int_send (core_id=<optimized out>, reason_mask=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/crosscore_int.c:127
#1  0x4008cda0 in esp_crosscore_int_send_yield (core_id=0) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/crosscore_int.c:144
#2  0x40093716 in xQueueSemaphoreTake (xQueue=0x3ffb7244, xTicksToWait=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/hal/esp32/include/hal/cpu_ll.h:39
#3  0x4008aa4c in ipc_task (arg=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_ipc/src/esp_ipc.c:54

==================== THREAD 9 (TCB: 0x3ffb7d34, name: 'ipc1') =====================
#0  0x40093716 in xQueueSemaphoreTake (xQueue=0x3ffb78d0, xTicksToWait=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/hal/esp32/include/hal/cpu_ll.h:39
#1  0x4008aa4c in ipc_task (arg=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_ipc/src/esp_ipc.c:54

==================== THREAD 10 (TCB: 0x3ffbd82c, name: 'Tmr Svc') =====================
#0  0x4008cda0 in esp_crosscore_int_send_yield (core_id=0) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/crosscore_int.c:144
#1  0x40095c98 in prvProcessTimerOrBlockTask (xListWasEmpty=<optimized out>, xNextExpireTime=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/hal/esp32/include/hal/cpu_ll.h:39
#2  prvTimerTask (pvParameters=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/timers.c:597

==================== THREAD 11 (TCB: 0x3ffdce04, name: 'ble') =====================
#0  0x4008cda0 in esp_crosscore_int_send_yield (core_id=0) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/crosscore_int.c:144
#1  0x4009359c in xQueueReceive (xQueue=0x3ffdb860, pvBuffer=0x3ffdcd24, xTicksToWait=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/hal/esp32/include/hal/cpu_ll.h:39
#2  0x400e48ee in npl_freertos_eventq_get (evq=0x3ffc75a4 <g_eventq_dflt>, tmo=4294967295) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/bt/host/nimble/nimble/porting/npl/freertos/src/npl_os_freertos.c:52
#3  0x400e4e6d in ble_npl_eventq_get (tmo=4294967295, evq=0x3ffc75a4 <g_eventq_dflt>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/bt/host/nimble/nimble/porting/npl/freertos/include/nimble/nimble_npl_os.h:107
#4  nimble_port_run () at D:/Espressif/frameworks/esp-idf-v4.4.1/components/bt/host/nimble/nimble/porting/nimble/src/nimble_port.c:77
#5  0x400d9e48 in ble_spp_server_host_task (param=<optimized out>) at D:/git/Project/components/communications/ble.c:333
#6  ble_spp_server_host_task (param=<optimized out>) at D:/git/Project/components/communications/ble.c:329

==================== THREAD 12 (TCB: 0x3ffdf25c, name: 'sys_evt') =====================
#0  0x4008cda0 in esp_crosscore_int_send_yield (core_id=0) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/crosscore_int.c:144
#1  0x4009359c in xQueueReceive (xQueue=0x3ffde498, pvBuffer=0x3ffdf170, xTicksToWait=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/hal/esp32/include/hal/cpu_ll.h:39
#2  0x401949d8 in esp_event_loop_run (event_loop=0x3ffde47c, ticks_to_run=4294967295) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_event/esp_event.c:632
#3  0x401949f3 in esp_event_loop_run_task (args=0x3ffde47c) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_event/esp_event.c:115

==================== THREAD 13 (TCB: 0x3ffbb080, name: 'esp_timer') =====================
#0  0x4000bff0 in ?? ()
#1  0x40096315 in vPortClearInterruptMaskFromISR (prev_level=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/include/freertos/portmacro.h:571
#2  vPortExitCritical (mux=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/port.c:319
#3  0x40095735 in ulTaskGenericNotifyTake (uxIndexToWait=<optimized out>, xClearCountOnExit=1, xTicksToWait=4294967295) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/tasks.c:5387
#4  0x400d7044 in timer_task (arg=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_timer/src/esp_timer.c:384

==================== THREAD 14 (TCB: 0x3ffdfa44, name: 'wifi') =====================
#0  0x4008cda0 in esp_crosscore_int_send_yield (core_id=0) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/crosscore_int.c:144
#1  0x4009359c in xQueueReceive (xQueue=0x3ffe0a9c, pvBuffer=0x3ffe2aa0, xTicksToWait=<optimized out>) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/hal/esp32/include/hal/cpu_ll.h:39
#2  0x400d5df8 in queue_recv_wrapper (queue=0x3ffe0a9c, item=0x3ffe2aa0, block_time_tick=4294967295) at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_wifi/esp32/esp_adapter.c:375
#3  0x4009b110 in ppTask () at D:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/freertos_hooks.c:39


======================= ALL MEMORY REGIONS ========================
Name   Address   Size   Attrs
.rtc.text 0x400c0000 0x63 R XA
.rtc.data 0x50000000 0x10 RW A
.rtc_noinit 0x50000010 0x0 RW
.rtc.force_slow 0x50000010 0x0 RW
.iram0.vectors 0x40080000 0x403 R XA
.iram0.text 0x40080404 0x1ef2b R XA
.dram0.data 0x3ffbdb60 0x6ba4 RW A
.ext_ram_noinit 0x3f800000 0x0 RW
.noinit 0x3ffc4704 0x0 RW
.ext_ram.bss 0x3f800000 0x0 RW
.flash.appdesc 0x3f400020 0x100 R  A
.flash.rodata 0x3f400120 0x26758 RW A
.flash.text 0x400d0020 0xc5767 R XA
.phyiram.20 0x40195788 0x61 R XA
.phyiram.18 0x401957ec 0x10e R XA
.phyiram.19 0x401958fc 0x90 R XA
.phyiram.17 0x4019598c 0x2d7 R XA
.phyiram.0 0x40195c64 0x2b R XA
.phyiram.1 0x40195c90 0x7d R XA
.phyiram.2 0x40195d10 0x21e R XA
.phyiram.3 0x40195f30 0xab R XA
.phyiram.4 0x40195fdc 0xff R XA
.phyiram.6 0x401960dc 0x83 R XA
.phyiram.7 0x40196160 0x1ff R XA
.phyiram.8 0x40196360 0x177 R XA
.phyiram.9 0x401964d8 0x8e R XA
.phyiram.13 0x40196568 0xba R XA
.phyiram.12 0x40196624 0xeb R XA
.phyiram.14 0x40196710 0x1cb R XA
.phyiram.16 0x401968dc 0x72 R XA
.phyiram.11 0x40196950 0x78 R XA
.phyiram.15 0x401969c8 0xba R XA
.phyiram.21 0x40196a84 0x4a R XA
.phyiram.22 0x40196ad0 0x31 R XA
.phyiram.23 0x40196b04 0x103 R XA
.phyiram.24 0x40196c08 0x87 R XA
.iram0.data 0x4009f330 0x0 RW
.iram0.bss 0x4009f330 0x0 RW
.dram0.heap_start 0x3ffcece0 0x0 RW
.coredump.tasks.data 0x3ffb6038 0x164 RW
.coredump.tasks.data 0x3ffb5e50 0x1e0 RW
.coredump.tasks.data 0x3ffd4c64 0x164 RW
.coredump.tasks.data 0x3ffd4980 0x2dc RW
.coredump.tasks.data 0x3ffbc354 0x164 RW
.coredump.tasks.data 0x3ffbcc20 0x198 RW
.coredump.tasks.data 0x3ffbcdc0 0x164 RW
.coredump.tasks.data 0x3ffbd690 0x194 RW
.coredump.tasks.data 0x3ffd75d0 0x164 RW
.coredump.tasks.data 0x3ffd7430 0x198 RW
.coredump.tasks.data 0x3ffda73c 0x164 RW
.coredump.tasks.data 0x3ffda550 0x1e4 RW
.coredump.tasks.data 0x3ffde228 0x164 RW
.coredump.tasks.data 0x3ffde040 0x1e0 RW
.coredump.tasks.data 0x3ffb76a8 0x164 RW
.coredump.tasks.data 0x3ffb74d0 0x1d0 RW
.coredump.tasks.data 0x3ffb7d34 0x164 RW
.coredump.tasks.data 0x3ffb7b90 0x19c RW
.coredump.tasks.data 0x3ffbd82c 0x164 RW
.coredump.tasks.data 0x3ffcf9b0 0x188 RW
.coredump.tasks.data 0x3ffdce04 0x164 RW
.coredump.tasks.data 0x3ffdcc00 0x1fc RW
.coredump.tasks.data 0x3ffdf25c 0x164 RW
.coredump.tasks.data 0x3ffdf040 0x214 RW
.coredump.tasks.data 0x3ffbb080 0x164 RW
.coredump.tasks.data 0x3ffbaed0 0x1a8 RW
.coredump.tasks.data 0x3ffdfa44 0x164 RW
.coredump.tasks.data 0x3ffe2960 0x1d8 RW

===================== ESP32 CORE DUMP END =====================
===============================================================

MicroController
Posts: 1709
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: What causes "Corrupt Stack" messages in coredump?

Postby MicroController » Sat Apr 22, 2023 7:43 pm

the contents of the back trace with that message does not match the functions that would likely be called by the task, i.e. i2c_isr_handler_default in the btController task, or IDLE task.
It looks like the stack is deemed "corrupt" for the interrupt handler(s); which could make sense: i2c_isr_handler_default is an interrupt handler function, and as such is never called by any code like a regular function. Thus, a tool assuming to find a call hierarchy on the stack may be confused because there is no call hierarchy leading to the ISR; the ISR just "happens" and uses the stack of whichever task it interrupted in whichever intermediate state the stack may be at that moment.

squirtle321
Posts: 11
Joined: Tue Jan 11, 2022 9:26 pm

Re: What causes "Corrupt Stack" messages in coredump?

Postby squirtle321 » Tue Apr 25, 2023 1:21 pm

MicroController wrote:
Sat Apr 22, 2023 7:43 pm
the contents of the back trace with that message does not match the functions that would likely be called by the task, i.e. i2c_isr_handler_default in the btController task, or IDLE task.
It looks like the stack is deemed "corrupt" for the interrupt handler(s); which could make sense: i2c_isr_handler_default is an interrupt handler function, and as such is never called by any code like a regular function. Thus, a tool assuming to find a call hierarchy on the stack may be confused because there is no call hierarchy leading to the ISR; the ISR just "happens" and uses the stack of whichever task it interrupted in whichever intermediate state the stack may be at that moment.
Thanks for the response.

That all makes sense to me, I suppose some of the coredump information is less relevant when debugging issues with respect to ISRs.

I'm having troubles related to the interrupt watchdog timer. What tools are there that could help find which ISRs are being starved from processor time? Is there a way to find what ISRs are waiting through a coredump or perhaps GDB?

MicroController
Posts: 1709
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: What causes "Corrupt Stack" messages in coredump?

Postby MicroController » Wed Apr 26, 2023 5:06 pm

From https://docs.espressif.com/projects/esp ... /wdts.html:
The Interrupt Watchdog is responsible for detecting instances where FreeRTOS task switching is blocked for a prolonged period of time.
Sounds like there may be one of two possible problems:
  • Some code disabled interrupts (critical section) or task switching, and did not re-enable it in time, possibly due to it erroneously calling FreeRTOS functions or otherwise waiting for another signal, or
  • Some code is running in an ISR context (like, e.g., a callback for the hr timer in ISR mode) and waiting/blocking there.

Who is online

Users browsing this forum: Lobelois and 96 guests