perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff Mottram <ge...@minaret.biz>
Subject Non mod_perl virtual hosts cause mod_perl-2.0.9 to crash
Date Sat, 26 Dec 2015 05:52:20 GMT
Hi,

I have found an Apache-2.4.18 configuration that causes mod_perl-2.09 to 
crash when using ITHREADS. Since my configuration file is complicated, I 
thought it would be easier to explain the conditions in the mod_perl source 
code that cause the problem to occur.

In mod_perl.c around line 388, there is the following code:

     /* the base server could have mod_perl callbacks disabled, but it
      * still needs perl to drive the vhosts */
     if (!MpSrvENABLE(scfg) && s->is_virtual) {
         MP_TRACE_i(MP_FUNC, "mod_perl disabled for server %s", vhost);
         scfg->mip = NULL;
         return OK;
     }

In other words, there are certain Apache virtual host configurations that 
cause some scfg structures to operate without a mip pointer. This causes 
segmentation faults in at least two places in mod_perl that do not check if 
"scfg->mip" is NULL before using mip as a pointer. The first place is in 
mod_perl.c at line 512:

     if (scfg->mip->tipool->idle) {

My solution was to wrap the entire if/else statement with the following lines:

     if (scfg->mip) {
	...
     }

The other place this is a problem is in modperl_interp.c at line 504:

     PerlInterpreter *perl = scfg->mip->parent->perl;

The same solution seems to work as well:

     if (scfg->mip) {
         ...
     }

Thanks for all of your good work on mod_perl.

Best,

Geoff Mottram

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


Mime
View raw message