Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - Malloc Check Failed: lib/c/alloc/dlist.c:748: Page 1 of 3 (3 Items)
   
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,