#647506 libapache2-mod-perl2: Apache child crash: global PerlOptions -Enable and .htaccess PerlModule directive

Package:
libapache2-mod-perl2
Source:
libapache2-mod-perl2
Description:
Integration of perl with the Apache2 web server
Submitter:
Jan Ingvoldstad
Date:
2017-10-29 12:33:09 UTC
Severity:
important
#647506#5
Date:
2011-11-03 11:35:18 UTC
From:
To:
Note: All log excerpts below have been edited to censor server and path information, but are not tampered with in other ways.

This problem is effectively keeping me from deploying mod_perl in a virtual hosting environment with real users.

I have a web server configured with PerlOptions -Enable set in a config file in /etc/apache2/conf.d, which is loaded before any virtualhosts.

If I then attempt to load a Perl module with the PerlModule directive, e.g.:

PerlModule DateTime

... then the handling Apache child process crashes with a segfault (see log excerpts at the end of the manual part of the report).

According to the mod_perl documentation, PerlModule directives are not allowed in .htaccess files.

Erroneous user .htaccess configurations should not crash the handling Apache child.

If I uncomment "PerlOptions -Enable" globally, web pages still don't load properly, connections get interrupted, but the error log and syslog show no signs of segfaults.

I occasionally get messages like these, though:

[Thu Nov 03 11:42:06 2011] [alert] [client CENSORED_IP] /path/to/virtualhost/home/.htaccess: Cannot copy to ARRAY in entereval at (eval 910) line 1.\n, referer: http://virtualhost.example/path/to/virtualhost/home/

The problems are reproducible also when I comment out my custom configuration.

I don't have a patch for this one yet, I don't quite know where to start. :)

Apache's error log:

[Thu Nov 03 11:31:57 2011] [notice] child pid 18784 exit signal Segmentation fault (11)
[Thu Nov 03 11:31:59 2011] [notice] child pid 18957 exit signal Segmentation fault (11)
[Thu Nov 03 11:32:01 2011] [notice] child pid 19088 exit signal Segmentation fault (11)
[Thu Nov 03 11:32:03 2011] [notice] child pid 19219 exit signal Segmentation fault (11)

/var/log/syslog:

Nov  3 11:31:49 CENSORED_HOST kernel: [4473180.753243] apache2[18659]: segfault at 10 ip 00007fa5db2fafdc sp 00007fa5d6918760 error 4 in libperl.so.5.10.1[7fa5db238000+165000]
Nov  3 11:31:56 CENSORED_HOST kernel: [4473187.843383] apache2[18798]: segfault at 7fa7cfc127d0 ip 00007fa5db3146a9 sp 00007fa5d2910780 error 6 in libperl.so.5.10.1[7fa5db238000+165000]
Nov  3 11:32:02 CENSORED_HOST kernel: [4473193.762818] apache2[19229]: segfault at 10 ip 00007fa5db2fafdc sp 00007fa5d4914760 error 4 in libperl.so.5.10.1[7fa5db238000+165000]
-------------8<---------- End Bug Report --------------8<----------

#647506#10
Date:
2012-06-06 18:40:54 UTC
From:
To:
Hi Jan,

Apologies for the delay in responding to this.

Firstly, is there any chance you might be able to set up a test
system running Debian wheezy to try and reproduce this?

Thanks,
Dominic.

#647506#15
Date:
2012-06-15 08:30:37 UTC
From:
To:
On Wed, 6 Jun 2012 19:40:54 +0100, Dominic Hargreaves <dom@earth.li> said:

The problem was easily reproduced with mod_perl 2.0.5 built from
source, and as far as I can see, there have not been logged any
changes regarding this here:

http://perl.apache.org/dist/mod_perl-2.0-current/Changes

Nor is there any such change logged here:

http://packages.debian.org/changelogs/pool/main/liba/libapache2-mod-perl2/libapache2-mod-perl2_2.0.6-2/changelog
http://packages.debian.org/changelogs/pool/main/liba/libapache2-mod-perl2/libapache2-mod-perl2_2.0.7-1/changelog

Is there a Debian-specific patch for the problem in the 2.0.6 in
wheezy which is not mentioned in the changelogs?


Best regards,

Jan

#647506#20
Date:
2012-06-15 09:09:28 UTC
From:
To:
I have performed a test with wheezy now:

[Fri Jun 15 11:06:57 2012] [notice] Apache/2.2.22 (Debian)
mod_ssl/2.2.22 OpenSSL/1.0.1c mod_perl/2.0.6 Perl/v5.14.2
configured -- resuming normal operations
[Fri Jun 15 11:07:01 2012] [alert] [client CENSORED]
/home/jani/www/Halloween_2011-10-28/.htaccess: Can't locate
DateTime.pm in @INC (@INC contains: /etc/perl
/usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5
/usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14
/usr/local/lib/site_perl . /etc/apache2) at (eval 2) line 2.\n
[Fri Jun 15 11:07:02 2012] [notice] child pid 7283 exit signal
Segmentation fault (11)

#647506#25
Date:
2012-06-15 20:46:41 UTC
From:
To:
found 647506 2.0.6-2
thanks

No, but it does give us the chance to narrow down the search a bit.
Thanks for doing that test with wheezy.

#647506#32
Date:
2012-06-17 18:09:59 UTC
From:
To:
Assistance welcomed.

Cheers,
Dominic.

#647506#37
Date:
2017-10-29 12:24:17 UTC
From:
To:
I recently tried to setup libapache-gallery-perl. When I restarted apache
after setting up the virtual host, apache started producing segfaults and was
esentially unusable anymore. From error.log:

[Sun Oct 29 13:06:32.003446 2017] [core:notice] [pid 341] AH00052: child pid 896 exit signal Segmentation fault (11)
[Sun Oct 29 13:06:32.003480 2017] [core:notice] [pid 341] AH00052: child pid 898 exit signal Segmentation fault (11)
[Sun Oct 29 13:06:32.003493 2017] [core:notice] [pid 341] AH00052: child pid 903 exit signal Segmentation fault (11)
[Sun Oct 29 13:06:32.003501 2017] [core:notice] [pid 341] AH00052: child pid 905 exit signal Segmentation fault (11)
[Sun Oct 29 13:06:32.003509 2017] [core:notice] [pid 341] AH00052: child pid 907 exit signal Segmentation fault (11)
[Sun Oct 29 13:06:32.003516 2017] [core:notice] [pid 341] AH00052: child pid 908 exit signal Segmentation fault (11)

My basic setup is the following: two virtual hosts for the same domain. One
with and one without SSL. I used

PerlOptions -Enable

as described here [1] in the virtualhost section for the non-SSL site, to
disable mod_perl for this site. This makes apache segfault. Uncommenting the
directive "fixes" the issue.

I can easily reproduce the segfaults by commenting/uncommenting the above
directive. If you tell me how to create them for apache, I can send you
detailed crash logs.

Regards, Daniel
-------------8<---------- End Bug Report --------------8<----------