On Thu, Feb 26, 2009 at 04:36:48PM +0100, Casper.Dik at sun.com wrote:
>
> >if you look at the code above, you can see that it's only compiled with
> >DEBUG is defined.  so the answer would be yes.  you need to be running
> >DEBUG bits to see this problem.  (jurassic-x4600 does indeed run DEBUG
> >bits, and so do the test machines where i was seeing this.)
>
> But if you read the code, then you realize that the assert is bogus.
>
> (I think it will happen if you alloc something and not touch and then free
> it)
>

that sounds plausibly, but this isn't the default malloc implementation
that we're talking about.  this malloc()/free() is internal to the
linker.  and as long as the linker ensures that it never free's memory
without writing to it first, then this assert is just fine.

how do we know that the linker didn't allocate some memory, write
0xdeadbeef to it (because it was passed some uninitialized data), and
then try to free the memory?

more analysis is needed before you can definitively say that this is a
bogus assert.

just take a quick look at the caller of in the dump free(), which is
get_lcinterface().  it doesn't appear to call free() on uninitialized
memory.  it only calls free() after doing a strcmp() on the memory it's
freeing.  so we're doing a strcmp() against 0xdeadbeef, something else
smells rotten here...

ed

Reply via email to