WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

 « Return to Thread: Problem with malloc/realloc

Re: Problem with malloc/realloc

by Ethernut :: Rate this Message:

| View in Thread

Hi Markus,

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:

http://lists.egnite.de/pipermail/en-nut-discussion/2009-April/010751.html

And, of course, the manual:

http://www.ethernut.de/pdf/enswm28e.pdf

Regards,

Harald

_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

 « Return to Thread: Problem with malloc/realloc