perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: segfault on global disable of mod_perl
Date Wed, 07 Jul 2004 08:10:37 GMT
Phil Pennock wrote:
> -------------8<---------- Start Bug Report ------------8<----------
> 1. Problem Description:
> 
> If "PerlOptions -Enable" is set in global context in Apache config,
> mod_perl segfaults.
> 
> I was experimenting, because of the support for cloned Perl instances
> for differing vhosts, to see if the Perl handling could be enabled in only
> the vhosts which explicitly required it, by disabling in global context
> and explicit enabling.  Apparently not.  An error message and "don't be
> stupid, and here's why it's stupid" is perhaps preferable to a segfault of
> Apache.
> 
> Config to replicate, using Apache2 setup:
> 
>  LoadModule perl_module libexec/apache2/mod_perl.so
>  <IfModule mod_perl.c>
>    PerlModule Apache2
>    PerlOptions -Enable
>  </IfModule>
> 
> This using the relevant ports installed under FreeBSD, with whatever
> test framework that invokes.  Removing "PerlOptions -Enable" avoids
> the problem.

Thank you, Phil, for the proper bug report. It was easy to reproduce the problem.

For now, I think to just add an assert when one tries to do that on the top 
level. This is because we do many things on the top level. It's possible that 
will be able to still disable mod_perl for the top-level, but may try to look 
at that later.

Index: src/modules/perl/modperl_cmd.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.c,v
retrieving revision 1.60
diff -u -r1.60 modperl_cmd.c
--- src/modules/perl/modperl_cmd.c      16 Jun 2004 03:55:47 -0000      1.60
+++ src/modules/perl/modperl_cmd.c      7 Jul 2004 08:07:43 -0000
@@ -369,6 +369,12 @@
      const char *error;

      MP_TRACE_d(MP_FUNC, "arg = %s\n", arg);
+
+    /* the main server must not have mod_perl disabled (-Enable) */
+    if (strEQ(arg, "-Enable")) {
+        return "Top level 'PerlOption -Enable' is not allowed";
+    }
+
      if ((error = modperl_options_set(p, opts, arg)) && !is_per_dir) {
          /* maybe a per-directory option outside of a container */
          if (modperl_options_set(p, dcfg->flags, arg) == NULL) {



-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

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


Mime
View raw message