Sorry, looks like I didn't reply all on this one:
On Fri, May 22, 2009 at 11:31 PM, Marek Lindner <lindner_marek(a)yahoo.de> wrote:
>> I am getting set up to do remote debugging. Â I'll see what I can find
>> doing that.
>
> Yeah, that would be another option.
ok, here is what I found on the debug malloc problem I am having:
In the function debugMalloc:
=================================
    chunkHeader = (struct chunkHeader *)memory;
    chunk = memory + sizeof(struct chunkHeader);
    chunkTrailer = (struct chunkTrailer *)(memory + sizeof(struct
chunkHeader) + length);
    chunkHeader->length = length;
    chunkHeader->tag = tag;
    chunkHeader->magicNumber = MAGIC_NUMBER;
    chunkTrailer->magicNumber = MAGIC_NUMBER;
=> Â Â Â pthread_mutex_lock(&chunk_mutex);
=================================
I get the following results:
(gdb) p chunkHeader
$26 = (struct chunkHeader *) 0x308c8
(gdb) p chunk
$27 = (unsigned char *) 0x308d8 "\020\322\n"
(gdb) p chunkTrailer
$28 = (struct chunkTrailer *) 0x308dd
(gdb) p *chunkHeader
$29 = {next = 0x40096c34, length = 5, tag = 15, magicNumber = 305419896}
(gdb) p *chunkTrailer
$30 = {magicNumber = 878082050}
(gdb) p length
$31 = 5
I think the magic number is not getting into the chunk trailer
correctly because it is not aligned.
chunkHeader is aligned because it was returned by malloc
chunk is aligned because the size of the header is 16
chunkTrailer is not aligned because it is chunk + 5
Hope this helps. Â If not, and that shouldn't be a problem, I'll see
what else I can find.