You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by David Wheeler <da...@kineticode.com> on 2006/07/31 19:40:59 UTC

Apache::SizeLimit Error

Fellow mod_perlers,

With Apache::SizeLimit 0.9, I'm seeing this error:

[Sun Jul 30 01:19:29 2006] [error] Can't call method  
"child_terminate" on an undefined value at /usr/local/lib/perl5/ 
site_perl/5.8.8/Apache/SizeLimit.pm line 125.

Anyone have an idea why this might be happening? This is on "Red Hat  
Enterprise Linux ES release 4 (Nahant Update 3)" with a Apache 1.3.36  
and mod_perl 1.29 that we compiled from source. Apache::SizeLimit is  
configured like so:

if (CHECK_PROCESS_SIZE) {
     # see Apache::SizeLimit manpage
     require Apache::SizeLimit;

     # XXX These globals are deprecated in Apache::SizeLimit 0.9.
     # apache child processes larger than this size will be killed
     $Apache::SizeLimit::MAX_PROCESS_SIZE	= MAX_PROCESS_SIZE;

     # requests handled per size check
     $Apache::SizeLimit::CHECK_EVERY_N_REQUESTS	= CHECK_FREQUENCY;

     $Apache::SizeLimit::MIN_SHARE_SIZE		= MIN_SHARE_SIZE
	if MIN_SHARE_SIZE > 0;

     $Apache::SizeLimit::MAX_UNSHARED_SIZE	= MAX_UNSHARED_SIZE
	if MAX_UNSHARED_SIZE > 0;
}

It is also installed as a PerlFixupHandler, and that's it. Has  
something perhaps changed in 0.9 so that it isn't properly passing $r  
to _exit_if_too_big()?

Thanks,

David

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


Re: Apache::SizeLimit Error

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
Philip M. Gollucci wrote:
> David Wheeler wrote:
> 
>> On Jul 31, 2006, at 18:01, Philip M. Gollucci wrote:
>>
>>> Wny not just pass the $r that we have ?
>>> (I agree with the spirit of the patch)
>>
>>
>> Possible memory leak? I mean, is it the same request object across
>> requests? Or does the cleanup handler get added for every request?
>>
>> I just thought that the shift was safest.
>>
>>> I'll commit a tweaked version tomorrowish unless someone screams.
> 
> After thinking about it more, I like 'shift' better too.

which is also one more step to it being 2.0-groovy (over Apache->request)

--Geoff

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


Re: Apache::SizeLimit Error

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
David Wheeler wrote:
> On Jul 31, 2006, at 18:01, Philip M. Gollucci wrote:
> 
>> Wny not just pass the $r that we have ?
>> (I agree with the spirit of the patch)
> 
> Possible memory leak? I mean, is it the same request object across 
> requests? Or does the cleanup handler get added for every request?
> 
> I just thought that the shift was safest.
> 
>> I'll commit a tweaked version tomorrowish unless someone screams.
After thinking about it more, I like 'shift' better too.



-- 
------------------------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"It takes a minute to have a crush on someone, an hour to like someone,
and a day to love someone, but it takes a lifetime to forget someone..."

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


Re: Apache::SizeLimit Error

Posted by David Wheeler <da...@kineticode.com>.
On Jul 31, 2006, at 18:01, Philip M. Gollucci wrote:

> Wny not just pass the $r that we have ?
> (I agree with the spirit of the patch)

Possible memory leak? I mean, is it the same request object across  
requests? Or does the cleanup handler get added for every request?

I just thought that the shift was safest.

> I'll commit a tweaked version tomorrowish unless someone screams.

Cool, thanks.

David


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


Re: Apache::SizeLimit Error

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
David Wheeler wrote:
> --- lib/Apache/SizeLimit.pm.old 2006-07-31 14:11:48.000000000 -0700
> +++ lib/Apache/SizeLimit.pm     2006-07-31 14:12:11.000000000 -0700
> @@ -92,7 +92,7 @@
>      # PerlCleanupHandler phase. That means that there's no way to use
>      # $r->get_handlers() to check the results of calling this method.
>      $r->push_handlers( 'PerlCleanupHandler',
> -                       sub { $class->_exit_if_too_big() } );
> +                       sub { $class->_exit_if_too_big(shift) } );
>      $r->pnotes( size_limit_cleanup => 1 );
> }
sub add_cleanup_handler {
     my $class = shift;
     my $r = shift || Apache->request;

Wny not just pass the $r that we have ?
(I agree with the spirit of the patch)

I'll commit a tweaked version tomorrowish unless someone screams.

-- 
------------------------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"It takes a minute to have a crush on someone, an hour to like someone,
and a day to love someone, but it takes a lifetime to forget someone..."

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


Re: Apache::SizeLimit Error

Posted by David Wheeler <da...@kineticode.com>.
On Jul 31, 2006, at 10:40, David Wheeler wrote:

> With Apache::SizeLimit 0.9, I'm seeing this error:
>
> [Sun Jul 30 01:19:29 2006] [error] Can't call method  
> "child_terminate" on an undefined value at /usr/local/lib/perl5/ 
> site_perl/5.8.8/Apache/SizeLimit.pm line 125.

To answer my own post, here's a patch that fixes this issue:

--- lib/Apache/SizeLimit.pm.old 2006-07-31 14:11:48.000000000 -0700
+++ lib/Apache/SizeLimit.pm     2006-07-31 14:12:11.000000000 -0700
@@ -92,7 +92,7 @@
      # PerlCleanupHandler phase. That means that there's no way to use
      # $r->get_handlers() to check the results of calling this method.
      $r->push_handlers( 'PerlCleanupHandler',
-                       sub { $class->_exit_if_too_big() } );
+                       sub { $class->_exit_if_too_big(shift) } );
      $r->pnotes( size_limit_cleanup => 1 );
}


Best

David


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