AW: [En-Nut-Discussion] Bug In NutThreadCreate

Oliver Schulz olischulz at web.de
Wed Feb 18 21:20:07 CET 2004


Yes, sir. You're right. 
I already commited the bugfixes to CVS in HEAD and nut-3_4-release

Cheers,
Oliver.

> -----Ursprungliche Nachricht-----
> Von: en-nut-discussion-bounces at egnite.de
> [mailto:en-nut-discussion-bounces at egnite.de]Im Auftrag von Mike
> Cornelius
> Gesendet: Mittwoch, 18. Februar 2004 07:32
> An: en-Nut-Discussion at Egnite. De
> Betreff: [En-Nut-Discussion] Bug In NutThreadCreate
> 
> 
> Hi All,
> 
> I have found a bug in NutThreadCreate:-
> 
> NutEnterCritical();
> paddr = (const u_short *) fn;       // *KU* fn doesn't 
> contain the entry
> address
> // of the thread!
> /*
>  * Allocate stack and thread info structure in one block.
>  */
> if ((threadMem = NutHeapAlloc(stackSize + 
> sizeof(NUTTHREADINFO))) == 0)
> 	return 0;
> 
> The above live should read:-
> if ((threadMem = NutHeapAlloc(stackSize + 
> sizeof(NUTTHREADINFO))) == 0){
> 	NutExitCritical();
> 	return 0;
> }
> 
> Or else if you're out of memory you'll end up with a corrupted stack.
> 
> Regards,
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ~~~~~~~~~~
> ~~~
> Mike Cornelius                      Internet: mikec at call-direct.com.au
> Call Direct Cellular Solutions      Phone:    +61 2 9209-4259
> Suite 145                           FAX:      +61 2 9209-4196
> National Innovation Centre     URL:      http://www.call-direct.com.au
> Australian Technology Park
> Eveleigh NSW 1430
> Australia                  
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ~~~~~~~~~~
> ~~~
> 
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion



More information about the En-Nut-Discussion mailing list