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.

the "Memory_free() "failure with the sysbios6.35 environment.

Other Parts Discussed in Thread: SYSBIOS

dear,

I run my rht algorithm in sysbios6.35.1.29 & XDCtools 3.25.0.48. when i release memory by follow  statement.

Memory_free(heap, aImage->data[x], aImage->y * sizeof(unsigned char));

an error occurred.

enter main()

enter taskFxn()

ti.sysbios.heaps.HeapMem: line 322: assertion failure: A_invalidFree: Invalid free xdc.runtime.Error.raise: terminating execution.

enter main(),enter taskFxn() are printed by system_printf(),, is it mean the process is end?

I don't know why, please tell me.

ti.sysbios.heaps.HeapMem  line 322:

{

/*      *  Make sure the entire buffer is in the range of the heap.    

                    *  Note the obj->head.size never changes.    

                    *  The "- 1" is to handle the case were the buffer goes up    

                    *  the 0xFFFFFFFF. Without the "- 1", the buf + size is 0.    

                    *  This was done to address SDOCM00096968.      */   

                   Assert_isTrue((((UArg)newHeader >= (UArg)(obj->buf)) && ((UArg)newHeader + (size - 1) <=   (UArg)(obj->buf) + (obj->head.size - 1))), HeapMem_A_invalidFree);

}

        best wish! thanks!

  • You need to make sure that you are freeing what you allocated. The Assert_isTrue is checking for this. Are you freeing the address that was returned from a Memory_alloc? Is the size the correct value? What is the size and ptr being freed?

    Another reason, albeit less likely, could be that some memory corruption has occurred that changed the HeapMem object. Look at HeapMem in Tools->ROV to help determine this. It would be useful to look here also to see the memory range that is managed by the heap object.

    If enabled Asserts terminate your program. They can be turned off by using the nonInstrumented SYS/BIOS library (or the custom library with asserts disabled).

    Todd

  •  Thanks for you gave me a detail answer, I'll have a try. On the other hand, are there some datasheets for nonInstrumented SYS/BIOS library , please give me a  link.

  • You can refer to the documentation in CCS' Help->Help Contents->SYS/BIOS->API Reference->ti->SYS/BIOS->BIOS. Look for LibType.

    Todd