Open stbnps opened 2 years ago
Another stack trace:
Guru Meditation Error: Core 0 panic'ed (StoreProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x4008f450 PS : 0x00060133 A0 : 0x8008faad A1 : 0x3ffecb40
0x4008f450: insert_free_block at /home/stbn/git/esp-idf-v4.4.2/components/heap/heap_tlsf.c:243
(inlined by) block_insert at /home/stbn/git/esp-idf-v4.4.2/components/heap/heap_tlsf.c:269
(inlined by) tlsf_free at /home/stbn/git/esp-idf-v4.4.2/components/heap/heap_tlsf.c:876
A2 : 0x3ffe0454 A3 : 0xa5a5a5a5 A4 : 0x00000000 A5 : 0x3ffd8068
A6 : 0x00000001 A7 : 0x00000000 A8 : 0x3ffe22f8 A9 : 0x00000017
A10 : 0x00000016 A11 : 0x3ffe2300 A12 : 0x74222c7d A13 : 0x00060123
A14 : 0x3ffeccc0 A15 : 0x3ffecce8 SAR : 0x00000018 EXCCAUSE: 0x0000001d
EXCVADDR: 0xa5a5a5b1 LBEG : 0x4000c349 LEND : 0x4000c36b LCOUNT : 0xffffffff
Backtrace:0x4008f44d:0x3ffecb400x4008faaa:0x3ffecb60 0x40081fa2:0x3ffecb80 0x4008feb1:0x3ffecba0 0x40168c4f:0x3ffecbc0 0x40168cf6:0x3ffecbe0 0x40145a73:0x3ffecc10 0x40146e67:0x3ffecc60 0x400f8593:0x3ffecc90 0x400e6ed3:0x3ffecd30 0x4008cdad:0x3ffece80
0x4008f44d: insert_free_block at /home/stbn/git/esp-idf-v4.4.2/components/heap/heap_tlsf.c:242
(inlined by) block_insert at /home/stbn/git/esp-idf-v4.4.2/components/heap/heap_tlsf.c:269
(inlined by) tlsf_free at /home/stbn/git/esp-idf-v4.4.2/components/heap/heap_tlsf.c:876
0x4008faaa: multi_heap_free_impl at /home/stbn/git/esp-idf-v4.4.2/components/heap/multi_heap.c:222
0x40081fa2: heap_caps_free at /home/stbn/git/esp-idf-v4.4.2/components/heap/heap_caps.c:340
0x4008feb1: free at /home/stbn/git/esp-idf-v4.4.2/components/newlib/heap.c:39
0x40168c4f: mesh_free at ??:?
0x40168cf6: esp_mesh_free_context at ??:?
0x40145a73: mesh_recv at ??:?
0x40146e67: esp_mesh_recv_toDS at ??:?
0x400f8593: __mwifi_root_read at /home/stbn/git/esp-mdf/components/mwifi/mwifi.c:1340 (discriminator 8)
Could this be related to MDF's mdf_mem memory management? (MDF_REALLOC, MDF_REALLOC_RETRY, MDF_FREE...)
Have the same bug probably when called function:
aligned_alloc();
Module: ESP32 Do not use mesh, but work with ESP-IDF only. ( @wujiangang Wonder why this issue moved to ESP-MDF ) ESP-IDF Master branch from : 2022-08-26 13:25 +0800 morris 060f3a3b13241e4c9e160fc61a9995b51c3ba0dc
Program was working before update, with master branch from: 2022-05-29 22:20 +0800 Roland Dobai a2d50414922aa51b107a13a7cd42cb4661e509bc
assert failed: insert_free_block tlsf.c:364 (current && "free list cannot have a null entry")
Backtrace: 0x40081ed2:0x3ffe2600 0x40092941:0x3ffe2620 0x40096ec6:0x3ffe2640 0x40096833:0x3ffe2760 0x40095fda:0x3ffe2780 0x4008213d:0x3ffe27a0 0x40096f39:0x3ffe27c0 0x40199449:0x3ffe27e0 0x401983e1:0x3ffe2800 0x400eb41a:0x3ffe2820 0x400eb465:0x3ffe2840 0x400ea941:0x3ffe2860 0x400dd613:0x3ffe2880 0x400de2cb:0x3ffe29c0 0x40149add:0x3ffe2ae0 0x4014a67a:0x3ffe2b90 0x40149190:0x3ffe2bb0 0x401afde1:0x3ffe2bd0 0x40148f65:0x3ffe2bf0
0x40081ed2: panic_abort at /ESPIDF/20220826/esp-idf/components/esp_system/panic.c:412
0x40092941: esp_system_abort at /ESPIDF/20220826/esp-idf/components/esp_system/esp_system.c:135
0x40096ec6: __assert_func at /ESPIDF/20220826/esp-idf/components/newlib/assert.c:78
0x40096833: insert_free_block at /ESPIDF/20220826/esp-idf/components/heap/tlsf/tlsf.c:364
(inlined by) block_insert at /ESPIDF/20220826/esp-idf/components/heap/tlsf/tlsf.c:394
(inlined by) tlsf_free at /ESPIDF/20220826/esp-idf/components/heap/tlsf/tlsf.c:1034
0x40095fda: multi_heap_free_impl at /ESPIDF/20220826/esp-idf/components/heap/multi_heap.c:241
(inlined by) multi_heap_free_impl at /ESPIDF/20220826/esp-idf/components/heap/multi_heap.c:230
0x4008213d: heap_caps_free at /ESPIDF/20220826/esp-idf/components/heap/heap_caps.c:353
0x40096f39: _free_r at /ESPIDF/20220826/esp-idf/components/newlib/heap.c:49
0x40199449: _memalign_r at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/newlib/newlib/libc/stdlib/nano-mallocr.c:638
0x401983e1: aligned_alloc at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/newlib/newlib/libc/stdlib/aligned_alloc.c:35
遇到相同问题了 `I (494317) APP_DISPLAY_PIC: free_image_data_timer_cb
assert failed: insert_free_block heap_tlsf.c:239 (current && "free list cannot have a null entry")
Backtrace: 0x4037640a:0x3de2eb90 0x40382455:0x3de2ebb0 0x4038dc01:0x3de2ebd0 0x40389793:0x3de2ecf0 0x40389e02:0x3de2ed10 0x403769a2:0x3de2ed30 0x4038dc31:0x3de2ed50 0x42018276:0x3de2ed70 0x4201b293:0x3de2ed90 0x40386095:0x3de2edb0 0x4037640a: panic_abort at /Users/wangfushun/esp/esp-idf/components/esp_system/panic.c:402
0x40382455: esp_system_abort at /Users/wangfushun/esp/esp-idf/components/esp_system/esp_system.c:128
0x4038dc01: __assert_func at /Users/wangfushun/esp/esp-idf/components/newlib/assert.c:85
0x40389793: insert_free_block at /Users/wangfushun/esp/esp-idf/components/heap/heap_tlsf.c:239 (inlined by) block_insert at /Users/wangfushun/esp/esp-idf/components/heap/heap_tlsf.c:269 (inlined by) tlsf_free at /Users/wangfushun/esp/esp-idf/components/heap/heap_tlsf.c:876
0x40389e02: multi_heap_free_impl at /Users/wangfushun/esp/esp-idf/components/heap/multi_heap.c:222
0x403769a2: heap_caps_free at /Users/wangfushun/esp/esp-idf/components/heap/heap_caps.c:361
0x4038dc31: free at /Users/wangfushun/esp/esp-idf/components/newlib/heap.c:39
0x42018276: app_mem_free at /Volumes/work/CLionProjects/menling-display/main/app_mem.c:19
0x4201b293: free_image_data_timer_cb at /Volumes/work/CLionProjects/menling-display/main/app_display/app_display_pic.c:134
0x40386095: vPortTaskWrapper at /Users/wangfushun/esp/esp-idf/components/freertos/port/xtensa/port.c:131
ELF file SHA256: f9c79b7866bbf0e5
Rebooting... ESP-ROM:esp32s3-20210327 Build:Mar 27 2021 rst:0x10 (RTCWDT_RTC_RST),boot:0x28 (SPI_FAST_FLASH_BOOT) `
Hello, can anyone solve this problem, I'm using it with freeRTOS. not sure what going on in this code.
ESP32S3 N8R2 esp-idf 5.0
assert failed: insert_free_block tlsf.c:364 (current && "free list cannot have a null entry")
Backtrace: 0x40375c8e:0x3fce9980 0x40379b25:0x3fce99a0 0x4037f0e1:0x3fce99c0 0x4037e543:0x3fce9ae0 0x4037dec3:0x3fce9b00 0x40375e79:0x3fce9b20 0x40375ea7:0x3fce9b40 0x40375ede:0x3fce9b60 0x4037f0f1:0x3fce9b80 0x4037a37c:0x3fce9ba0 0x4037a630:0x3fce9bc0 0x4037709a:0x3fce9be0 0x403770da:0x3fce9c00 0x4037721d:0x3fce9c30 0x42006909:0x3fce9c50 0x420064a1:0x3fce9c70 0x42006042:0x3fce9c90 0x4200ab75:0x3fce9cb0 0x42012976:0x3fce9cd0 0x42012a02:0x3fce9cf0 0x4200a63f:0x3fce9d20 0x42015f27:0x3fce9d50 0x42011626:0x3fce9d70 0x4200a7e5:0x3fcea080 0x420078e4:0x3fcea0d0 0x4037c4b9:0x3fcea0f0 0x40375c8e: panic_abort at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/esp_system/panic.c:412
0x40379b25: esp_system_abort at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/esp_system/esp_system.c:135
0x4037f0e1: __assert_func at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/newlib/assert.c:78
0x4037e543: insert_free_block at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/heap/tlsf/tlsf.c:364 (inlined by) block_insert at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/heap/tlsf/tlsf.c:394 (inlined by) block_trim_free at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/heap/tlsf/tlsf.c:508 (inlined by) block_prepare_used at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/heap/tlsf/tlsf.c:585 (inlined by) tlsf_malloc at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/heap/tlsf/tlsf.c:935
0x4037dec3: multi_heap_malloc_impl at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/heap/multi_heap.c:217
0x40375e79: heap_caps_malloc_base at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/heap/heap_caps.c:146
0x40375ea7: heap_caps_malloc at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/heap/heap_caps.c:166
0x40375ede: heap_caps_malloc_default at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/heap/heap_caps.c:191
0x4037f0f1: malloc at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/newlib/heap.c:24
0x4037a37c: xQueueGenericCreate at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/freertos/FreeRTOS-Kernel/queue.c:454
0x4037a630: xQueueCreateMutex at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/freertos/FreeRTOS-Kernel/queue.c:571
0x4037709a: lock_init_generic at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/newlib/locks.c:64
0x403770da: lock_acquire_generic at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/newlib/locks.c:118
0x4037721d: _lock_acquire_recursive at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/newlib/locks.c:158
0x42006909: usb_serial_jtag_write at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/vfs/vfs_usb_serial_jtag.c:145
0x420064a1: console_write at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/vfs/vfs_console.c:75
0x42006042: esp_vfs_write at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/vfs/vfs.c:436 (discriminator 4)
0x4200ab75: __swrite at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32s3-elf/src/newlib/newlib/libc/stdio/stdio.c:94
0x42012976: __sflush_r at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32s3-elf/src/newlib/newlib/libc/stdio/fflush.c:224
0x42012a02: _fflush_r at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32s3-elf/src/newlib/newlib/libc/stdio/fflush.c:278
0x4200a63f: __sfvwrite_r at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32s3-elf/src/newlib/newlib/libc/stdio/fvwrite.c:251
0x42015f27: sprint_r at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32s3-elf/src/newlib/newlib/libc/stdio/vfprintf.c:429 (inlined by) sprint_r at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32s3-elf/src/newlib/newlib/libc/stdio/vfprintf.c:399
0x42011626: _vfprintf_r at ??:?
0x4200a7e5: printf at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32s3-elf/src/newlib/newlib/libc/stdio/printf.c:56 (discriminator 5)
0x420078e4: myTask at F:/ESP32/ESP32_SDK/frameworks/mycode/hello_world/main/hello_world_main.c:24 (discriminator 1)
0x4037c4b9: vPortTaskWrapper at F:/ESP32/ESP32_SDK/frameworks/esp-idf-v5.0/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:151
ELF file SHA256: fffc40ea4e4e0a98
Rebooting...
Are you using MDF_CALLOC to allocate memory? there is some issue in its implementation , using MDF_MALLOC instead of MDF_CALLOC solved my issue .
Answers checklist.
IDF version.
4.4.1 and 4.4.2
Operating System used.
Linux
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
No response
Development Kit.
Multiple ESP32 models (WROOM/WROVER)
Power Supply used.
USB
What is the expected behavior?
Perform IDF functions with no heap memory management errors.
What is the actual behavior?
I have multiple stack traces, most of them related to mwifi_root_read. All of them were generated with the same setup (code/hardware), using a mesh of 3 ESP32 devices. Even if mwifi_root_read is not in the stack trace, all the errors were generated in the root node.
Stack traces indicate that this may be a memory management problem. The errors seem related to free block management.
Trace 1:
Trace 2:
Trace 3:
Steps to reproduce.
Debug Logs.
No response
More Information.
No response