[uClibc]realloc broken (Was: Re: pthread implementation broken with -D_GNU_SOURCE)

Erik Andersen andersen at codepoet.org
Mon Jul 1 16:55:34 UTC 2002


On Mon Jul 01, 2002 at 09:59:14AM +0200, Ronald Wahl wrote:
> Everything is broken ;-( Now realloc - if used with _working_
> mutexes. I have two fixes - one to get the locks working and one to fix
> the malloc problem. Get them here and incorporate them into uClibc:
> 
>         http://www.peppercon.de/~rwa/malloc-nodeadlock.patch

Yup, my fault here.  When I added the locking to malloc (and
added fre_unlocked) I forgot to fixup free().  I suppose I could
have done the lazy thing and used recursive mutexs.  But its
better to have this one correct.  Thanks for the patch -- and for
catching the places where I screwed up.  Applied,

>         http://www.peppercon.de/~rwa/libpthread.patch
> 
> Maybe the mutex patch uncovers some other hidden bugs...

Ok, I don't have a problem killing the obsolete
PTHREAD_MUTEX_FAST_NP references, and changing the default mutex
type to adaptive.  But the fact that we need this certainly
suggests that timed mutexes must be totally broken at the moment.

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--



More information about the uClibc mailing list