develooper Front page | perl.perl5.porters | Postings from November 2005

GDBM_file realloc failures

Thread Next
Rafael Garcia-Suarez
November 21, 2005 09:22
GDBM_file realloc failures
Message ID:
On a threads-enabled perl, the tests ext/GDBM_File/t/gdbm.t and
lib/Memoize/t/tie_gdbm.t now fail for me with the message :
	panic: realloc from wrong pool

Since the PV which is being realloc'd is alloc'd by libgdbm and
not by perl, it seems to me that perl is right in complaining
when compiled with -DPERL_TRACK_MEMPOOL.

The following patch seems to fix it. I haven't tested it with
-Dusemymalloc though. Does it seem reasonable ?

--- ext/GDBM_File/GDBM_File.xs  (révision 6230)
+++ ext/GDBM_File/GDBM_File.xs  (copie de travail)
@@ -39,11 +39,11 @@
 static void
 output_datum(pTHX_ SV *arg, char *str, int size)
-#if (!defined(MYMALLOC) || (defined(MYMALLOC) && defined(PERL_POLLUTE_MALLOC)))
+#if 0
        sv_usepvn(arg, str, size);
        sv_setpvn(arg, str, size);
-       safesysfree(str);
+       free(str);
End of Patch.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About