Hi,

I'm looking into upgrading our perl version to 5.22.1. Since mod_perl 2.0.9 doen't work with 5.22, I thought that it would be a good idea to test the SVN version of mod_perl.

We compile our own perl, and we compile it without ithread support, which the new env-support doesn't appear to work with. I get the following compile errors:

modperl_env.c: In function 'modperl_env_init':
modperl_env.c:657:10: error: 'my_perl' undeclared (first use in this function) modperl_env.c:657:10: note: each undeclared identifier is reported only once for each function it appears in
modperl_env.c: In function 'modperl_env_unload':
modperl_env.c:688:10: error: 'my_perl' undeclared (first use in this function)

As far as I can tell, this is because pTHX expands to define a my_perl parameter for modperl_env_init and modperl_env_unload if perl is compiled with ithreads support. However without ithreads support pTHX expands to nothing, causing the compile error.

To fix this, I've tried to simply delete the if (!my_perl) tests in modperl_env_init and modperl_env_unload. I'm fairly sure that this is safe to do for modperl_env_unload, since it is only called from modperl_perl_destruct, which appears to have a perl interpreter instance. However I'm not so sure for modperl_env_init.

Removing those two if-statements reveal that we should call modperl_env_unload with aTHX as the parameter in modperl_perl_descruct, so that the number of arguments is correct both with and without ithread support enabled.

The attached patch makes both changes. Apply with -p0.

I've tested this against our "home-compiled" perl 5.22 where it now compiles and passes the tests. I've also tried against the Ubuntu 12.04 supplied perl with ithreads support, which also compiles and passes all the tests.

--
Klaus S. Madsen, Udvikler, k...@jobindex.dk
Jobindex A/S, Holger Danskes Vej 91, 2000 Frederiksberg
Tlf +45 38 32 33 55, Dir +45 38 32 33 70
http://www.jobindex.dk/

Index: src/modules/perl/modperl_env.c
===================================================================
--- src/modules/perl/modperl_env.c	(revision 1733039)
+++ src/modules/perl/modperl_env.c	(working copy)
@@ -654,8 +654,6 @@
     MAGIC *mg;
 
     /* Find the 'E' magic on %ENV */
-    if (!my_perl)
-        return;
     if (!PL_envgv)
         return;
     if (!SvRMAGICAL(ENVHV))
@@ -685,8 +683,6 @@
     MAGIC *mg;
 
     /* Find the 'E' magic on %ENV */
-    if (!my_perl)
-        return;
     if (!PL_envgv)
         return;
     if (!SvRMAGICAL(ENVHV))
Index: src/modules/perl/modperl_perl.c
===================================================================
--- src/modules/perl/modperl_perl.c	(revision 1733039)
+++ src/modules/perl/modperl_perl.c	(working copy)
@@ -181,7 +181,7 @@
         }
     }
 
-    modperl_env_unload(perl);
+    modperl_env_unload(aTHX);
 
     perl_destruct(perl);
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@perl.apache.org
For additional commands, e-mail: dev-h...@perl.apache.org

Reply via email to