[En-Nut-Discussion] Re: heap conflict: allocating a node in threadstacks

PragmaLab info at pragmalab.nl
Fri Sep 8 23:58:27 CEST 2006


Hello Harald,

>The heap manager is not able to determine between thread 
>stacks and other kind of heap usage. 

I see. For the heapmanager threadstacks are nothing special, just allocated
blocks on the heap. That's why I'm surprised to see that after creating
threads (including their stacks), the linked list (heapFreeList) creates
nodes that are located on threadstacks.

>Did you check the .map (.mp for ICCAVR). Strange things may 
>happen, if the linker mixes compiler runtime and Nut/OS 
>runtime. All heap allocation and release must be done by 
>Nut/OS. For example, there is no strdup() in Nut/OS. 

I thought about that too, but I do see in the map-file that '_malloc_M' and
'_free_M' are linked in, as well as the 'NutHeapXXXX()' routines. Runtime in
my debugger I can confirm that indeed our malloc routines end up at their
NutOS counterparts.... Should I look for some other routine(s) to be shure
NutOS routines are used iso ICC-routines?

To be sure, can you confirm that normally the heapmanager should be aware of
the previously allocated stacks on the heap and therefor should not place
nodes in the range of those stacks?

Thanks.

Best regards,

Rob van Lieshout







More information about the En-Nut-Discussion mailing list