Heap Summary - Corrupted

donalm
Posts: 5
Joined: Wed Apr 06, 2022 10:35 am

Heap Summary - Corrupted

Postby donalm » Tue Nov 22, 2022 12:53 pm

Hey folks,
I'm getting the following sporadic error in my software:

Code: Select all

Heap summary for capabilities 0x0000080C:
  At 0x3fcb1d44 len 4095 free 7 allocated 1588 min_free 7
    largest_free_block 0 alloc_blocks 21 free_blocks 0 total_blocks 21
  At 0x3fcabe50 len 213424 free 4 allocated 201120 min_free 4
    largest_free_block 0 alloc_blocks 2471 free_blocks 0 total_blocks 2471
  At 0x3fce0000 len 60980 free 4 allocated 58116 min_free 4
    largest_free_block 0 alloc_blocks 111 free_blocks 0 total_blocks 111
  Totals:
    free 15 allocated 260824 min_free 15 largest_free_block 0

Backtrace:0x4037A4AA:0x3FCB9A700x4037E605:0x3FCB9A90 0x4003EC95:0x3FCB9AB0  |<-CORRUPTED
Any thoughts on what exactly this is and what steps I should take to resolving it?
Thank you,
Donal

filo_gr
Posts: 110
Joined: Wed Jul 28, 2021 12:25 pm
Location: Italy

Re: Heap Summary - Corrupted

Postby filo_gr » Tue Nov 22, 2022 1:14 pm

Are you using malloc()/calloc() calls?

If yes, are you checking if the result of the pointer is not NULL?
Also, be sure you free() the dynamic memory you don't use
Filippo

chegewara
Posts: 2378
Joined: Wed Jun 14, 2017 9:00 pm

Re: Heap Summary - Corrupted

Postby chegewara » Wed Nov 23, 2022 5:59 pm

Code: Select all

free 15 allocated 260824 min_free 15 largest_free_block 0
totally no free memory.

User avatar
mbratch
Posts: 303
Joined: Fri Jun 11, 2021 1:51 pm

Re: Heap Summary - Corrupted

Postby mbratch » Thu Nov 24, 2022 8:22 pm

If you at least want to try to find out what function the heap ran out (which is not necessarily the function causing the problem), you can run the following command on your heap dump:

C:\Users\whoever-you-are\.espressif\tools\xtensa-esp32-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-addr2line.exe -fe 0x4037A4AA:0x3FCB9A70 0x4037E605:0x3FCB9A90 0x4003EC95:0x3FCB9AB0

Of course, choose the path details for your specific ESP-IDF installation.

Who is online

Users browsing this forum: No registered users and 115 guests