[En-Nut-Discussion] Problem with malloc/realloc
harald.kipp at egnite.de
Thu Apr 26 09:04:36 CEST 2012
On 25.04.2012 15:49, Markus Dost wrote:
> I'm using the Ethernut 5-Board with the Nut/OS-version 4.10.2 . In my
> code I'm using the malloc()- and realloc()-commands from time to time
> and they're working ... mostly. But it happens, that the program goes to
> the label "__data_stop" in "crtat91sam9xe512_ram.S" during the
> allocation and stays there.
There are no known problems with malloc/realloc. If there's not enough memory available (which is most unlikely on Ethernut 5), these functions will not crash but return a NULL pointer. Do they crash inside the function or when using the resulting pointer?
A crash may also be caused by previously overwritten memory areas, which may have corrupted the heap.
This post may be useful:
And, of course, the manual:
More information about the En-Nut-Discussion