Dear Stas Bekman,

    Hi.  This is imacat from Taiwan.

On Mon, 01 Sep 2008 17:24:00 -0700
Stas Bekman <[EMAIL PROTECTED]> wrote:
> imacat wrote:
> Ok, so 0.06 had the same problem. That's what I needed to check.
> Now, I can't reproduce the problem. So if someone else who can reproduce 
> it could look at the issue, that would be great. I think the difference 
> is x64, but it could be something else.

    I have digged into your code for that "panic: free from wrong pool
during global destruction".  It seems to be caused by calling setenv()
at line 75 in your C.xs, which threw out an error in libperl.so in Perl
5.10.  Further investigation turns out that, according to:

http://search.cpan.org/dist/perl/INSTALL#Environment_access

    Perl write to the memory directly when implementing putenv(), which
might cause problem.  To avoid that and use the safe (but potentially
leaky) system putenv() you may set PL_use_safe_putenv = 1.

    The above does work for my Perl 5.8.8 and 5.10.0 on x86_64.  I do
not know if there will be any side effect on other platforms.  I made a
simple patch below, in the hope that it helps.  Please tell me if you
need any more information, or if I could be of any help.  Thank you.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

diff -u -r Env-C-0.07.orig/C.xs Env-C-0.07/C.xs
- --- Env-C-0.07.orig/C.xs      2008-09-01 06:26:13.000000000 +0800
+++ Env-C-0.07/C.xs     2008-09-03 00:40:50.000000000 +0800
@@ -72,6 +72,7 @@
         RETVAL = -1;
     }
 #else
+    PL_use_safe_putenv = 1;
     RETVAL = setenv(key, val, override);
 #endif
 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAki9bNwACgkQi9gubzC5S1zHtACgqmQU5PPqU+oHUnM3zNIglj3v
Gf4AoK6lEfqKW+fwmJdhsXeBfG4eLAp0
=hhLN
-----END PGP SIGNATURE-----

--
Best regards,
imacat ^_*' <[EMAIL PROTECTED]>
PGP Key: http://www.imacat.idv.tw/me/pgpkey.asc

<<Woman's Voice>> News: http://www.wov.idv.tw/
Tavern IMACAT's: http://www.imacat.idv.tw/
TLUG List Manager: http://lists.linux.org.tw/cgi-bin/mailman/listinfo/tlug

Attachment: pgpCyz0GtBBkE.pgp
Description: PGP signature

Reply via email to