Closed f-hoepfinger-hr-agrartechnik closed 1 year ago
https://github.com/hr-agrartechnik/esp-idf-examples-cxx-pthread
Crash on join()
It is reproducible. So need to debug on this minimal example.
@f-hoepfinger-hr-agrartechnik Have you checked the Heap Memory Debugging section in our documentation already?
What do you mean by "It is reproducible"? I tried the example (https://github.com/hr-agrartechnik/esp-idf-examples-cxx-pthread/tree/main/pthread) on IDF commit 7f5ecbe533b2666df6b10658a023b5f637320696 but there was no error. I enabled comprehensive heap poisoning.
Would you mind sending us your sdkconfig file? Sometimes there are some other configurations that we usually don't try and that contribute to the error.
Hi,
the Error happens with this IDF:
https://github.com/hr-agrartechnik/esp-idf/tree/HR_5.0_ram
it is about using PSRAM as Stack on Pthread.
@f-hoepfinger-hr-agrartechnik, from your description (CORRUPT HEAP: Bad head at 0x3ffdfeec. Expected 0xabba1234 got 0x3ffc5804
) you have light poisoning active (0xabba1234 is the head or tail canary), meaning that your application most likely writes over those bytes.
In esp_heap_caps.h
the function heap_caps_get_allocated_size()
returns the allocated size of a block, but in case of light / comprehensive poisoning, the size also include the canary bytes, so if your application uses this function to manipulate the allocated memory, it can easily lead to this behavior. This issue is in the process of being fixed.
Just to be sure that it is the issue, could you please try to run your application with poisoning disabled and report back to whether the problem persists or not ?
I will close this issue since the bug with heap_caps_get_allocated_size()
when poisoning is enabled was fixed. If your problem still persist even with poisoning disabled, feel free to reopen the issue.
Answers checklist.
IDF version.
https://github.com/hr-agrartechnik/esp-idf/tree/HR_5.0_ram
Operating System used.
Windows
How did you build your project?
Eclipse IDE
If you are using Windows, please specify command line type.
PowerShell
Development Kit.
Custom Board
Power Supply used.
USB
What is the expected behavior?
we have 1 place where in 10/10 cases a crash happens. it happens always on the same place.
how to dig deeper in such a Problem?
What is the actual behavior?
see log:
CORRUPT HEAP: Bad head at 0x3ffdfeec. Expected 0xabba1234 got 0x3ffc5804
assert failed: multi_heap_free multi_heap_poisoning.c:272 (head != NULL)
Steps to reproduce.
Difficult to explain here. we must go to "Anhänger" and then switch from "analog sensor" to "BLE Sensor". and there it crash. always.
Debug Logs.
More Information.
No response