perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [mp2] pools that go out of scope aren't a problem anymore?
Date Thu, 02 Dec 2004 15:06:23 GMT
Joe Schaefer wrote:
> "Philippe M. Chiasson" <gozer@ectoplasm.org> writes:
> 
> 
>>my $pool;
>>sub handler {
>>  my $r = shift;
>>  $pool ||= $r->pool; #XXX: Yes, bad bad bad, but still...
>>  APR::Table::make($pool, 10); #bam!
>>}
>>
>>The problem in this case is that apache destroyed the request pool at
>>the end of the first request. And we now have a valid $pool that now
>>points to a freed pool. It's an incorrect usage of the API, I know,
>>but the resulting segv isn't nice... 
> 
> 
> This is a problem with persistence, not "ownership", and affects the
> entirety of mp2's object system.  In other words, there's no reason to 
> single out pools in your example, the bug could just as easily been
> 
> my $r;
> 
>    sub handler {
>        $r ||= shift;
>        my $pool = $r->pool; #bam!
>    }
> 
> "Fixing" this problem is certainly a challenge, but IMO not
> worth worrying about for 2.0.

Agreed.

That's said this issue is not critical for RC1, since they user API won't 
change, we can work on it in parallel, but certainly will finish it before 
the gold release.


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

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


Mime
View raw message