perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <>
Subject [Fwd: [ #33303] Bug in Apache::SizeLimit]
Date Sat, 16 Feb 2008 19:15:38 GMT

-------- Original Message --------
Subject: [ #33303] Bug in Apache::SizeLimit
Date: Sat, 16 Feb 2008 11:11:50 -0500
From: via RT <>
To: undisclosed-recipients:;
References: <> 

Sat Feb 16 11:11:48 2008: Request 33303 was acted upon.
Transaction: Ticket created by
        Queue: mod_perl
      Subject: Bug in Apache::SizeLimit
    Broken in: (no value)
     Severity: (no value)
        Owner: Nobody
       Status: new
  Ticket <URL: >

I have found a bug with Apache::SizeLimit (Note: I am not referring to
Apache2::SizeLimit -- although it may have the same problem).

Mod_perl 1.29
Redhat EL5 (kernel 2.6.18)
Apache::SizeLimit version: $VERSION = '0.91-dev';
Perl version: 5.8.8

If I turn off USE_SMAPS (i.e. set Apache::SizeLimit::USE_SMAPS=0), I get an
error, specifically:

Can't call method "_linux_size_check" on an undefined value at
line 216.

  A diff with my fix is shown below:


@@ -161,7 +163,10 @@

  sub _check_size {
-    my ( $size, $share ) = _platform_check_size();
+    my $class = shift;
+    my ( $size, $share ) = $class->_platform_check_size();

      return ( $size, $share, $size - $share );


I ran into the problem above because I couldn't get smaps to work.  I had
permission problems accessing the /proc/<pid>/smaps file.  It seems  that
this file (and all others in the /proc/<pid> directory) is owned by root.
While /proc/<pid>/statm is viewable by everyone, /proc/<pid>/smaps is
viewable only by root.  I don't know why.   The process itself is owned by
'web' -- the user that I have set to own apache child processes.  Perhaps
the reason for root ownership is that the Apache parent process is owned by
root and the child processes are only setuid to 'web'.  So, when the
proc/<pid>/ files are made, the child processes are still owned by root.
But that wouldn't account for why smaps in particular is readable only by
root.  Do you know of a way around this? Or if some kernel change in linux
fixes this?


View raw message