esp-idf: ESP32C6: regdma_link_get_next hit Guru Meditation Error: Core 0 panic'ed (Stack protection fault) in master (IDFGH-12238)

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.3-dev-2218-g7cf8cc79a1

Espressif SoC revision.

ESP32C6

Operating System used.

Linux

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

None

Development Kit.

Custom Board

Power Supply used.

USB

What is the expected behavior?

no panic, as exactly the same application code works in v5.2 branch.

What is the actual behavior?

Guru Meditation Error: Core 0 panic’ed (Stack protection fault).

Steps to reproduce.

My application is running nimble host-only using uart hci but I cannot share my application code.

Debug Logs.

Guru Meditation Error: Core  0 panic'ed (Stack protection fault).

Detected in task "nimble_host" at 0x4200471c
0x4200471c: regdma_link_get_next at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:351

Stack pointer: 0x4084de90
Stack bounds: 0x4084dea8 - 0x4084eea0


Stack dump detected
Core  0 register dump:
MEPC    : 0x42004750  RA      : 0x420047cc  SP      : 0x4084de90  GP      : 0x40818354
0x42004750: regdma_link_get_next at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:363
0x420047cc: regdma_link_recursive_impl at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:390 (discriminator 1)
 (inlined by) regdma_link_recursive_impl at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:385 (discriminator 1)

TP      : 0x40818a7c  T0      : 0x40022494  T1      : 0x4080288a  T2      : 0xffffffff
0x40022494: multi_heap_internal_unlock in ROM
0x4080288a: uart_ll_disable_intr_mask at /home/axel/esp/esp-idf/components/hal/esp32c6/include/hal/uart_ll.h:445
 (inlined by) uart_rx_intr_handler_default at /home/axel/esp/esp-idf/components/esp_driver_uart/src/uart.c:914

S0/FP   : 0x40828620  S1      : 0x00000003  A0      : 0x40828620  A1      : 0x00000000
A2      : 0x00000052  A3      : 0x420048d0  A4      : 0x70030000  A5      : 0x4210b000
0x420048d0: regdma_link_update_stats_wrapper at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:442

A6      : 0x00000004  A7      : 0x0000000a  S2      : 0x00000000  S3      : 0x00000052
S4      : 0x00000004  S5      : 0x00000006  S6      : 0x00000000  S7      : 0x00000000
S8      : 0x00000003  S9      : 0x00000004  S10     : 0x42c80000  S11     : 0x41200000
T3      : 0x00000000  T4      : 0x00000001  T5      : 0x851eb850  T6      : 0x00000001
MSTATUS : 0x00001881  MTVEC   : 0x40800001  MCAUSE  : 0x0000001b  MTVAL   : 0xc8078793
0x40800001: _vector_table at ??:?

MHARTID : 0x00000000


Backtrace:


0x42004750 in regdma_link_get_next (link=link@entry=0x40828620, entry=entry@entry=0) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:363
363                 regdma_entry_buf_t *next = (*nextfn1[head.mode])(link);
#0  0x42004750 in regdma_link_get_next (link=link@entry=0x40828620, entry=entry@entry=0) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:363
#1  0x420047cc in regdma_link_recursive_impl (hook=0x420048d0 <regdma_link_update_stats_wrapper>, depth=82, entry=0, link=0x40828620) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:390
#2  regdma_link_recursive_impl (link=0x40828620, entry=0, depth=82, hook=0x420048d0 <regdma_link_update_stats_wrapper>) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:385
#3  0x420047d6 in regdma_link_recursive_impl (hook=0x420048d0 <regdma_link_update_stats_wrapper>, depth=81, entry=0, link=0x4082864c) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:390
#4  regdma_link_recursive_impl (link=0x4082864c, entry=0, depth=81, hook=0x420048d0 <regdma_link_update_stats_wrapper>) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:385
#5  0x420047d6 in regdma_link_recursive_impl (hook=0x420048d0 <regdma_link_update_stats_wrapper>, depth=80, entry=0, link=0x40828678) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:390
#6  regdma_link_recursive_impl (link=0x40828678, entry=0, depth=80, hook=0x420048d0 <regdma_link_update_stats_wrapper>) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:385
#7  0x420047d6 in regdma_link_recursive_impl (hook=0x420048d0 <regdma_link_update_stats_wrapper>, depth=79, entry=0, link=0x40828714) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:390
#8  regdma_link_recursive_impl (link=0x40828714, entry=0, depth=79, hook=0x420048d0 <regdma_link_update_stats_wrapper>) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:385
#9  0x420047d6 in regdma_link_recursive_impl (hook=0x420048d0 <regdma_link_update_stats_wrapper>, depth=78, entry=0, link=0x40828738) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:390
#10 regdma_link_recursive_impl (link=0x40828738, entry=0, depth=78, hook=0x420048d0 <regdma_link_update_stats_wrapper>) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:385
#11 0x420047d6 in regdma_link_recursive_impl (hook=0x420048d0 <regdma_link_update_stats_wrapper>, depth=77, entry=0, link=0x408287fc) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:390
#12 regdma_link_recursive_impl (link=0x408287fc, entry=0, depth=77, hook=0x420048d0 <regdma_link_update_stats_wrapper>) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:385
#13 0x420047d6 in regdma_link_recursive_impl (hook=0x420048d0 <regdma_link_update_stats_wrapper>, depth=76, entry=0, link=0x408288f8) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:390
#14 regdma_link_recursive_impl (link=0x408288f8, entry=0, depth=76, hook=0x420048d0 <regdma_link_update_stats_wrapper>) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:385
#15 0x420047d6 in regdma_link_recursive_impl (hook=0x420048d0 <regdma_link_update_stats_wrapper>, depth=75, entry=0, link=0x40828994) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:390
#16 regdma_link_recursive_impl (link=0x40828994, entry=0, depth=75, hook=0x420048d0 <regdma_link_update_stats_wrapper>) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:385
#17 0x420047d6 in regdma_link_recursive_impl (hook=0x420048d0 <regdma_link_update_stats_wrapper>, depth=74, entry=0, link=0x408289b8) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:390
#18 regdma_link_recursive_impl (link=0x408289b8, entry=0, depth=74, hook=0x420048d0 <regdma_link_update_stats_wrapper>) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:385
#19 0x420047d6 in regdma_link_recursive_impl (hook=0x420048d0 <regdma_link_update_stats_wrapper>, depth=73, entry=0, link=0x40828a7c) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:390
#20 regdma_link_recursive_impl (link=0x40828a7c, entry=0, depth=73, hook=0x420048d0 <regdma_link_update_stats_wrapper>) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:385
#21 0x420047d6 in regdma_link_recursive_impl (hook=0x420048d0 <regdma_link_update_stats_wrapper>, depth=72, entry=0, link=0x40828b78) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:390
#22 regdma_link_recursive_impl (link=0x40828b78, entry=0, depth=72, hook=0x420048d0 <regdma_link_update_stats_wrapper>) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:385
#23 0x420047d6 in regdma_link_recursive_impl (hook=0x420048d0 <regdma_link_update_stats_wrapper>, depth=71, entry=0, link=0x40828ba4) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:390
#24 regdma_link_recursive_impl (link=0x40828ba4, entry=0, depth=71, hook=0x420048d0 <regdma_link_update_stats_wrapper>) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:385
#25 0x420047d6 in regdma_link_recursive_impl (hook=0x420048d0 <regdma_link_update_stats_wrapper>, depth=70, entry=0, link=0x40828bd0) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:390
#26 regdma_link_recursive_impl (link=0x40828bd0, entry=0, depth=70, hook=0x420048d0 <regdma_link_update_stats_wrapper>) at /home/axel/esp/esp-idf/components/esp_hw_support/port/regdma_link.c:385
#27 0x00000000 in ?? ()
Backtrace stopped: frame did not save the PC
ELF file SHA256: ed9c36e055e3fa76

Rebooting...
ESP-ROM:esp32c6-20220919

More Information.

No response

About this issue

  • Original URL
  • State: open
  • Created 4 months ago
  • Comments: 18 (11 by maintainers)

Most upvoted comments

@esp-wzh FYI, see the HWM changes: v5.1 branch: Task Name Status Prio HWM Task# nimble_host B 21 5592 10 master: Task Name Status Prio HWM Task# nimble_host B 21 3176 10 master (ff94741, before supporting i2c sleep retention on esp32c6/h2) Task Name Status Prio HWM Task# nimble_host B 21 5608 10

It makes sense because after i2c retention is supported, destroying the link requires traversing more nodes, going through deeper recursion, and using more of the stack.

It takes 2KB+ stack size in current master (compare to master (ff94741)). I don’t think this is ok, which is likely to cause regression for existing application.