This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to overcome this error "ti.sysbios.heaps.HeapMem: line 345: assertion failure: A_invalidFree: Invalid free xdc.runtime.Error.raise: terminating execution" .

Hi all,

I encountered the error mentioned in the question.

My C system stack size is 500000, and heap size for C/C++ is 500000.


A part of my program is working. I verified it using the printf() statements. The latter part of the program has a loop. and the control is not entering the loop. THe execution stopped abruptly, because of this error.

I am using Windows 7 OS.

regards

phani tej

  • Hi Phani Tej,

    From the HeapMem documentation, A_invalidFree exception can occur for the following conditions:

    This could arise when multiple frees are done on the same buffer or if corruption occurred.
    This also could occur when an alloc is made with size N and the free for this buffer specifies size M where M > N. Note: not every case is detectable.
    This assert can also be caused when passing an invalid addr to free or if the size is causing the end of the buffer to be out of the expected range.

    Can you check if any of the above statements is true for your code?

    Also, make sure you are setting heap size through BIOS.heapSize in your *.cfg. This parameter controls the heap in TI-RTOS.

    Vikram