perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Foertsch <torsten.foert...@gmx.net>
Subject Re: mp2 segfault
Date Thu, 15 Mar 2007 12:34:11 GMT
On Thursday 15 March 2007 11:18, Darryl Miles wrote:
> Torsten Foertsch wrote:
> > On Tuesday 13 March 2007 10:05, Torsten Foertsch wrote:
> > So, the simple patch below solves my problem. No segfaults so far. But is
> > it right?
> >
> > I have tested it with ab and several million requests and no memory leak
> > detected. The test suite is also passed. But that doesn't mean anything.
> > I have grepped t for "interpscope handler" without success.
>
> Are you suggesting the patch corrects a leak or are you saying it does
> not introduce a new one ?

The latter.

> Unfortunately I can't comment on the correctness of the path itself, but
> I'd be interested in taking a look if this patch corrects a leak as that
> issue interests me.

The problem is that modperl_interp_unselect() is called at the end of each 
phase then again as at request cleanup. That last call has caused the 
segfault. So, the patch cures only the symptoms.

I think the patch is not really complete. I think that whole thing of 
InterpScope handler needs to be reworked. It is not covered at all by the 
test suite and there are several occasions in the code where an 
modperl_interp_unselect is commented out because it breaks prefork.

Another question in this regard is how filters are handled. Are they given a 
separate interpreter? Is the interpreter released between each filter 
invocation or only after eos was seen?

I'd like to use modperl mostly for configuration in a threaded server (see 
Apache2::Translation on CPAN). And ideally I'd have a function 
Modperl::release_interp or so that releases the interpreter after the current 
phase. Then I could release the interpreter after fixup so that it can be 
reused while the current request is doing all of it's slow networking stuff.

Torsten

Mime
View raw message