STRANGE GLibC Problems

Brian Budge
Tue Mar 7 16:55:00 GMT 2006

Hi Mike -

Memory problems can definitely be strange.  This is because it can be
the case that your mistake and the error can seem to have very little
in common either spatially and/or temporally.

I suggest you look for any cases where you might possibly be
overrunning an array or accessing memory outide of a structure, etc...
 What happens is that malloc returns a chunk of memory with special
data at the front of it, so that when free is called, free can delete
the appropriate memory.

It seems like what may have happened is that this special chunk has
been trampled, so it doesn't agree with what glibc thinks it should

Good luck!  Memory is hard to debug :(


On 3/7/06, Mike McWilliam <> wrote:
> Hello There
>          I have some problems with some C++ code and the g++ compiler.
> I have two Suse Linux machines running on two different computers let
> me give you the info for each one
> Machine One
> --------------------------
> OS:               SuSE 10.0
> Arcitecture:     AMD Athlon 64 2200
> RAM:             512 MB
> Motherboard:  Asus K8E SE
> G++ Version: 4.0.2
> GNU GLibC:   2.3.5-40
> Machine Two
> --------------------------
> OS:               SuSE 10.0
> Arcitecture:     Intel Pentium IV 2.4 GHz
> RAM:             512 MB
> Motherboard:  ???
> G++ Version:  4.0.2
> GNU GLibC:   2.3.5-40
>          Identical SW platform, however one uses the 64 bt
> architecture. So some HW differences. Now the problem was that the
> Code was developed on Machine one and ran with no problems. However
> when it is ran on machine Two I get the following error very early in
> the code:
> *** glibc detected *** free(): invalid next size (normal): 0x080da638 ***
> Aborted
>          I can't seem to find the offending pointer 0x080da638. Memory
> leaks and array out of bound errors should not be there since it
> worked on Machine One. I've combed through my code several times to
> find something. Yet I get nothing. Could you help me out on where I
> can go to solve this problem. I would like code from machine one to
> work on machine two for obvious reasons. Thanks for any help you have
> to offer.
> Mike

More information about the Gcc-help mailing list