On Tue, Mar 07, 2006 at 10:50:45PM -0500, John E. Malmberg wrote: > Since normally the header->interpreter value is not poisoned when memory > is free, if something else mallocs the memory right after a free > operation, and then incorrectly calls Perl_safesysfree() to free it, > this will not be detected by Perl_safesysfree. > > I just hit this condition because of a bug I introduced into my test > vms/vms.c, where Perl_safesysfree(free) successfully freed memory that > was allocated by malloc(). > > I would recommend that the header->interpreter value always be poisoned > so that this condition can be better detected.
I didn't write that part of the that code, so I'm not confident what other side effects this change would have, and whether it will conceal alternate forms of bugs that as-is it reveals. Nicholas Clark