This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]