Preethi Selvaraju
|
Malloc Check Failed: lib/c/alloc/dlist.c:748
|
Preethi Selvaraju
08/16/2022 8:52 AM
post121894
|
Malloc Check Failed: lib/c/alloc/dlist.c:748
We are allocating memory as follows in our CPP application:
ptr = new T[numElements];
if(ptr == NULL)
//assert.
Where T is a typename template, numElements is > 0 and also NULL check for ptr after allocation is properly handled.
Deallocation:
if(ptr != NULL)
{
delete[] ptr;
ptr = NULL;
}
We have a structure with more than 15 members of different types. During allocation total of 10793022 bytes were
allocated. When de-allocating the members one by one in the same order which were allocated, our application is crashing
with the below error:
Malloc Check Failed: :/builds/workspace/QOS221-SDP/build_aarch64/lib/c/alloc/dlist.c:748
Abort (core dumped)
Core dump is not useful.
Double-checked that we are not deallocating any memory that is not allocated and also the ptr also valid The same
application working without any issues in Windows platform as well as another Embedded platform. Only in QNX its
crashing. We would like to know exactly in which scenarios "Malloc check Failed" message will be thrown by dlist.c. It
would be more helpful if you share this information, so that we could check the possible causes in our application.
Please let me know if any other additional information is needed,
|
|
|