Subject: | Apache2::SizeLimit bug on solaris 2.10 and later, patch |
Date: | Thu, 31 Jul 2008 15:07:35 -0700 |
To: | bug-mod_perl [...] rt.cpan.org |
From: | John Mendenhall <john [...] surfutopia.net> |
Apache2::SizeLimit information:
CPAN_USERID GOZER (Philippe M. Chiasson <gozer@cpan.org>)
CPAN_VERSION 0.05
CPAN_FILE G/GO/GOZER/mod_perl-2.0.4.tar.gz
UPLOAD_DATE 2008-04-17
MANPAGE Apache2::SizeLimit - Because size does matter.
INST_FILE /usr/perl5/site_perl/5.8.4/sun4-solaris-64int/Apache2/SizeLimit.pm
INST_VERSION 0.05
Apache2::SizeLimit returns following error message upon
startup on solaris 2.10 and later boxes:
-----
Apache2::SizeLimit not implemented on solaris at /usr/perl5/site_perl/5.8.4/sun4-solaris-64int/Apache2/SizeLimit.pm line 95.\nBEGIN failed--compilation aborted at /usr/perl5/site_perl/5.8.4/sun4-solaris-64int/Apache2/SizeLimit.pm line 98.\nCompilation failed in require at /var/apache2/htdocs/mod_perl.pl line 32.\nBEGIN failed--compilation aborted at /var/apache2/htdocs/mod_perl.pl line 32.\nCompilation failed in require at (eval 2) line 1.\n
-----
The cause of the problem is the line below:
-----
if (SOLARIS && $Config{'osvers'} >= 2.6) {
-----
The constant 'SOLARIS' is true.
The value of $Config{'osvers'} is '2.10'.
Numerically, 2.10 is less than 2.6. This comparison is
false. Thus, the outcome is, Apache2::SizeLimit does
not get implemented and apache does not startup.
Patch file included inline here:
-----
--- SizeLimit-Original.pm Thu Jul 31 13:40:21 2008
+++ SizeLimit.pm Thu Jul 31 14:37:38 2008
@@ -52,10 +52,14 @@
if Apache2::MPM->is_threaded();
# decide at compile time how to check for a process' memory size.
- if (SOLARIS && $Config{'osvers'} >= 2.6) {
-
- $HOW_BIG_IS_IT = \&solaris_2_6_size_check;
-
+ if (SOLARIS) {
+ my ($osvers_major, $osvers_minor, $osvers_remainder) = split /\./, $Config{'osvers'}, 3;
+ if ((($osvers_major == 2) and ($osvers_minor >= 6)) or ($osvers_major > 2)) {
+ $HOW_BIG_IS_IT = \&solaris_2_6_size_check;
+ }
+ else {
+ die "Apache2::SizeLimit works only on Solaris 2.6 or later.";
+ }
}
elsif (LINUX) {
if ( eval { require Linux::Smaps } and Linux::Smaps->new($$) ) {
-----
Please let me know if you need any additional information.
Thanks!
JohnM
--
john mendenhall
john@surfutopia.net
surf utopia
internet services