chunk_free consolidate forward clarification ( was RE: malloc and threads)

Wolfram Gloger Wolfram.Gloger@dent.med.uni-muenchen.de
Tue Dec 3 00:18:00 GMT 2002


> Looks like there is a bug in the chunk_free code in glibc 2.2.2 at
> line:3131.When consolidating forward,
> I think the code is consolidating an in-use block by looking at the
> next+nextsz block's in_use_bit.

No bug.  Please check out the extensive comments in the source code.
The information whether a block is in-use or not is stored in the size
field of the _following_ block, _not_ in the block's own size field.

> Does anyone know if this bug is already reported and fixed? 

Such a bug would have disastrous consequences, it would have been
fixed eons ago.

If you're still chasing the problem on ARM, I would suggest to replace
the pthread_mutex_.. calls in thread-m.h with known-working spinlock
code.  _Then_ try to reproduce the problem.  Significant doubts were
brought up about the correctness of the LinuxThreads mutex code on ARM
(e.g. at least that old version 2.2.2 depends on compare-and-swap
IIRC).

Regards,
Wolfram.



More information about the Libc-alpha mailing list