*** glibc detected *** double free or corruption (!prev): 0x08069288 ***

Jason Gurtz jason at tommyk.com
Sat Dec 18 07:19:38 PST 2004


On 18-Dec-04 05:04, Nathan Coulson wrote:
> *** glibc detected *** double free or corruption (!prev): 0x08069288 ***
[...]
> Came home after work, and this was on the terminal compiling
> OpenOffice [latest BLFS instructions]

Sounds like they've got some nice heap corruption detection in there.
...and a bug in OO.

I triggered a similar error message at runtime in one of my labs in C++
by doing
	myVar=new arr[size];
	delete [] myVar;
	delete [] myVar;

If I understand correctly, part of delete operation--free() in C?--is a
realigning of bytes such that the second delete hits a potion of memory
outside the bounds of what was allocated.  The corruption can be caught
because the compiler pads around the used memory with specific values
and tests that whenever a delete happens.

In my case the error showed up at runtime when the second delete fired
off.  A non-debug build would allow the corruption to go by (probably)
un-noticed.

It would be interesting to know the mechanism behind glibc's heap
corruption detection.

Given the size of the OO code it would probably be somewhat difficult to
find this bug.

~Jason

-- 



More information about the blfs-support mailing list