[BUG MP1/MP2] Apache should bail out in case of syntax errors in <Perl> section

[prev] [thread] [next] [Date index for 2005/03/03]

From: Dominique Quatravaux
Subject: [BUG MP1/MP2] Apache should bail out in case of syntax errors in <Perl> section
Date: 16:16 on 03 Mar 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear mod_perl developpers,

A syntactically incorrect <Perl> section does not prevent Apache from
starting. I believe it should. Below is a short httpd.conf to
reproduce this: despite the obvious syntax error, Apache starts fine
and does not even complain to the logs. (mod_perl 1 does the same,
plus it starts to randomly SEGV in children processes when queried).

FWIW when the <Perl> section is syntactically correct but the code
throws an exception at run time (e.g. replace "})] BAD SYNTAX })]"
below with "die;"), then everything happens as expected (the exception
is sent to Apache's stderr and the Apache startup aborts).

I have an ugly workaround for this: set $PerlConfig to a deliberately
bogus value in a BEGIN block at the top of the <Perl> section, and
clear it at the end. If the parsing of the <Perl> section fails
halfway through, the bogon left in $PerlConfig will subsequently cause
Apache to abort :-]

Regards,

=====

LoadModule perl_module          /usr/lib/apache2/modules/mod_perl.so
ServerRoot     /tmp
ErrorLog       /tmp/log
PidFile        /dev/null
TypesConfig    /etc/mime.types
Listen 12345

<Perl>
use Apache2;
})] BAD SYNTAX })]
1;
</Perl>

- --
Dominique QUATRAVAUX                           Ingénieur senior
01 44 42 00 08                                 IDEALX

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCJzhXMJAKAU3mjcsRAuguAJ4ohMBmwRyDv3A3r5H3+BPn3qf+PQCgk0qV
mur6dK+oO9AZ9wszkXeEiuI=
=QcHJ
-----END PGP SIGNATURE-----


[BUG MP1/MP2] Apache should bail out in case of syntax errors in <Perl> section
Dominique Quatravaux 16:16 on 03 Mar 2005

Generated at 08:54 on 14 Mar 2005 by mariachi v0.52