heap_trace_dump dont print function name

Xmow49
Posts: 1
Joined: Sat Dec 02, 2023 2:23 pm

heap_trace_dump dont print function name

Postby Xmow49 » Sat Dec 02, 2023 2:30 pm

Hi,

On I have a memory leak on my esp32c6 using esp idf;
I followed https://docs.espressif.com/projects/esp ... debug.html to debug.

I successfully run the code; and get this:

Code: Select all

====== Heap Trace: 26 records (1000 capacity) ======
    40 bytes (@ 0x4085275c, Internal) allocated CPU 0 ccount 0x18126ccc caller
   128 bytes (@ 0x40851a64, Internal) allocated CPU 0 ccount 0x182bc760 caller 
     2 bytes (@ 0x4087d270, Internal) allocated CPU 0 ccount 0x188acc3c caller
  4096 bytes (@ 0x4086a47c, Internal) allocated CPU 0 ccount 0x1ee3f30c caller 
   348 bytes (@ 0x40851f80, Internal) allocated CPU 0 ccount 0x1ee4013c caller
  6144 bytes (@ 0x4086b96c, Internal) allocated CPU 0 ccount 0x1ee48610 caller 
   348 bytes (@ 0x408520e0, Internal) allocated CPU 0 ccount 0x1ee4939c caller
     8 bytes (@ 0x4087e324, Internal) allocated CPU 0 ccount 0x1ee53ab8 caller 
    64 bytes (@ 0x40865d1c, Internal) allocated CPU 0 ccount 0x1ee5467c caller
     4 bytes (@ 0x4087d260, Internal) allocated CPU 0 ccount 0x1ee54f0c caller 
    16 bytes (@ 0x4087d300, Internal) allocated CPU 0 ccount 0x1ee555b4 caller
   104 bytes (@ 0x40851e60, Internal) allocated CPU 0 ccount 0x1ee55d64 caller
     5 bytes (@ 0x4087e2d4, Internal) allocated CPU 0 ccount 0x1ee57494 caller 
     4 bytes (@ 0x40851ba0, Internal) allocated CPU 0 ccount 0x1ee5c03c caller
    92 bytes (@ 0x40865288, Internal) allocated CPU 0 ccount 0x1ee5cb4c caller 
     4 bytes (@ 0x40852a58, Internal) allocated CPU 0 ccount 0x1ee5da58 caller
    12 bytes (@ 0x40865100, Internal) allocated CPU 0 ccount 0x1ee5e550 caller 
    80 bytes (@ 0x40864aa8, Internal) allocated CPU 0 ccount 0x1f0a26e4 caller
    16 bytes (@ 0x40865498, Internal) allocated CPU 0 ccount 0x1f5c0630 caller 
    16 bytes (@ 0x4087e310, Internal) allocated CPU 0 ccount 0x1ff666f4 caller
    16 bytes (@ 0x4087e2c0, Internal) allocated CPU 0 ccount 0x200f3ddc caller 
    16 bytes (@ 0x4087d29c, Internal) allocated CPU 0 ccount 0x200f5df0 caller
    16 bytes (@ 0x4087d2b0, Internal) allocated CPU 0 ccount 0x200f8774 caller 
    16 bytes (@ 0x40851a50, Internal) allocated CPU 0 ccount 0x216f1f40 caller
  4096 bytes (@ 0x4086d170, Internal) allocated CPU 0 ccount 0x2193c8b8 caller
   348 bytes (@ 0x408652e8, Internal) allocated CPU 0 ccount 0x2193d1c4 caller 
====== Heap Trace Summary ======
Mode: Heap Trace Leaks
16039 bytes 'leaked' in trace (26 allocations)
records: 26 (1000 capacity, 108 high water mark)
total allocations: 940
total frees: 996
================================
But now I'm not very helpful; I don't have functions name...
I use ESP IDF monitor and I tried a lot of settings:
- disable compile optimisation
- use a debugger to read the address: but it doesn't find any function.

Could someone help me pls?

Many Thanks

joreika
Posts: 3
Joined: Wed Feb 21, 2024 3:06 pm

Re: heap_trace_dump dont print function name

Postby joreika » Fri Mar 08, 2024 8:41 pm

I am facing the same issue. I tried both standalone and host based options, I never get the caller address. I am also using esp32c6, I start thinking that this could be the issues. I tried on windows, wsl, virtualbox and on a separate linux system, I get the same result. This is sad :roll:

joreika
Posts: 3
Joined: Wed Feb 21, 2024 3:06 pm

Re: heap_trace_dump dont print function name

Postby joreika » Fri Mar 08, 2024 9:24 pm

I found the issue after tens of hours of debugging. It is mentioned in the esp config files that "HEAP_TRACING_STACK_DEPTH" is "Disabled for RISC-V due to `__builtin_return_address` " therefore the depth is 0 and therefore it does not store this info. very sad :roll:

Who is online

Users browsing this forum: No registered users and 281 guests