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

GDBM_file realloc failures

Thread Next
From:
Rafael Garcia-Suarez
Date:
November 21, 2005 09:22
Subject:
GDBM_file realloc failures
Message ID:
20051121182200.0b3d2454@grubert.mandrakesoft.com
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);
 #else
        sv_setpvn(arg, str, size);
-       safesysfree(str);
+       free(str);
 #endif
 }
 
End of Patch.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About