You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2003/03/01 10:36:52 UTC

Re: Misc PerlOptions +Parent + PerlInterp*

Kurt George Gjerde wrote:
> Hi,
> 
> This is some things I've come across.
> 
> Lineup:
>   Apache/2.0.43 (Win32) mod_perl/1.99_09-dev Perl/v5.8.0 DAV/2
> 
> 1. When adding 'PerlOptions +Parent' to httpd.conf (in <VirtualHost>),
> apache starts ok, then exits without an error message after approx 1
> second.

Doesn't happen on linux with worker mpm. Perhaps someone who runs win32 can 
test that. You can try to strace, to see where it exits. Do you get this 
problem with some specific setup or an empty vhost with that option causes the 
failure?

> 2. In docs config.html PerlOptions +Parent, PerlInterpMaxRequests,
> PerlInterpStart, PerlInterpMax is shown inside a <Location>. Apache
> returns 'not allowed here' for all of these.

Indeed. Need to check that.

> 3. PerlInterpMaxRequests doesn't seem to be working. Entering the
> following directives inside a <VirtualHost>:
> 
>     PerlOptions +Clone
>     PerlInterpMaxSpare 1
>     PerlInterpMinSpare 1
>     PerlInterpStart 1
>     PerlInterpMax 1
>     PerlInterpMaxRequests 10
> 
> (I'm overdoing it just to make sure) ...does not retire interpreter after
> 10 requests.

There are two ways to debug this if you want to help.

The easy way is to set in httpd.conf
PerlTrace i
as explained here:
http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlTrace_

If that doesn't help, setting a breakpoint in modperl_tipool_putback_base is 
the place where the decision to retire the interpreter is made.

If you don't figure out where the problem is I'll look at it somewhere next week.

> Tested this with the following module:
> 
>   package MyApache::Test::Rox;
> 
>   use strict;
>   use warnings FATAL=>'all', NONFATAL=>'redefine';
> 
>   use Apache::RequestRec ();
>   use Apache::RequestIO ();
>   use Apache::Const -compile => qw(OK);
>   use APR::OS;
> 
>   my $cnt=0;
>   my $tid = APR::OS::thread_current();
> 
>   sub handler {
>       my $r = shift;

you probably want to move
my $tid = APR::OS::thread_current();
into the handler, otherwise you reprint the old value ;)

though your $cnt does the right job to reproduce the problem.

Also you probably want:
my $tid = ${ APR::OS::thread_current() };

;)

__________________________________________________________________
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


Re: Misc PerlOptions +Parent + PerlInterp*

Posted by Stas Bekman <st...@stason.org>.
Randy Kobes wrote:
> On Wed, 5 Mar 2003, Stas Bekman wrote:
> 
> 
>>Kurt George Gjerde wrote:
>>
>>>On Wed, 5 Mar 2003, Stas Bekman wrote:
>>>
>>>
>>>>On the other hand, the win32 users seem to be very spoiled ;)
>>>
>>>
>>>Yes, we are. Absolutely :)
>>
>>;)
>>
>>
>>>>Is it so much of a trouble to build the thing by themselves
>>>>if copy-n-paste instructions are given?
>>>
>>>
>>>Maybe not, but we need to shell out $500 - $1000 to Microsoft
>>>to get the "Visual Studio" :( (that is, if we want to keep
>>>the benefits of ActivePerl, I guess).
>>
>>So any other open source compilers don't cut? (gcc?)
> 
> 
> Unfortunately, not in general.... I've heard on some Win32 perl
> users mailing lists some limited success with certain xs-based
> modules at using a compiler other than VC++ with ActivePerl, but
> this success seems accidental, almost. There was some initial
> excitement at M$ releasing for free a version of VC++ 7 with a
> .NET development kit (with optimizations disabled), but it turns
> out this requires some gymnastics to work with VC++ 6 (which
> ActivePerl is compiled with), if indeed it works at all. So to be
> safe, one would have to shell out for VC++ 6 ...

Back in the Uni, we worked with Borland products. I'm not sure whether they 
are still around and useful (I guess TurboC is a dinosaur ;)

__________________________________________________________________
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


Re: Misc PerlOptions +Parent + PerlInterp*

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Wed, 5 Mar 2003, Stas Bekman wrote:

> Kurt George Gjerde wrote:
> > On Wed, 5 Mar 2003, Stas Bekman wrote:
> > 
> >>On the other hand, the win32 users seem to be very spoiled ;)
> > 
> > 
> > Yes, we are. Absolutely :)
> 
> ;)
> 
> >>Is it so much of a trouble to build the thing by themselves
> >>if copy-n-paste instructions are given?
> > 
> > 
> > Maybe not, but we need to shell out $500 - $1000 to Microsoft
> > to get the "Visual Studio" :( (that is, if we want to keep
> > the benefits of ActivePerl, I guess).
> 
> So any other open source compilers don't cut? (gcc?)

Unfortunately, not in general.... I've heard on some Win32 perl
users mailing lists some limited success with certain xs-based
modules at using a compiler other than VC++ with ActivePerl, but
this success seems accidental, almost. There was some initial
excitement at M$ releasing for free a version of VC++ 7 with a
.NET development kit (with optimizations disabled), but it turns
out this requires some gymnastics to work with VC++ 6 (which
ActivePerl is compiled with), if indeed it works at all. So to be
safe, one would have to shell out for VC++ 6 ...

-- 
best regards,
randy


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


Re: Misc PerlOptions +Parent + PerlInterp*

Posted by Stas Bekman <st...@stason.org>.
Kurt George Gjerde wrote:
> On Wed, 5 Mar 2003, Stas Bekman wrote:
> 
>>On the other hand, the win32 users seem to be very spoiled ;)
> 
> 
> Yes, we are. Absolutely :)

;)

>>Is it so much of
>>a trouble to build the thing by themselves if copy-n-paste instructions are given?
> 
> 
> Maybe not, but we need to shell out $500 - $1000 to Microsoft to get the
> "Visual Studio" :(  (that is, if we want to keep the benefits of
> ActivePerl, I guess).

So any other open source compilers don't cut? (gcc?)

> But, you're probably right. Have people build their own for debugging.
> I'll have a go at it later this week.
> 
> But a binary non-debug version *is* needed. Because "we" are spoiled, a
> lot of people would simply not use mod_perl unless they can get a binary
> :(  (and that's not what we want).

That's true. But we are talking about early adopters and hoping that they are 
ready to wrap their sleeves up once in a while ;)

> BTW: The binary/PPM install instructions in the 2.0 docs are superb. It
> took me about 20 minutes to install (perl5.8, apache2 and) mod_perl2!

Great, no more trouble for Randy.

__________________________________________________________________
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


Re: Misc PerlOptions +Parent + PerlInterp*

Posted by Kurt George Gjerde <ku...@intermedia.uib.no>.
On Wed, 5 Mar 2003, Stas Bekman wrote:
>
> On the other hand, the win32 users seem to be very spoiled ;)

Yes, we are. Absolutely :)

> Is it so much of
> a trouble to build the thing by themselves if copy-n-paste instructions are given?

Maybe not, but we need to shell out $500 - $1000 to Microsoft to get the
"Visual Studio" :(  (that is, if we want to keep the benefits of
ActivePerl, I guess).

But, you're probably right. Have people build their own for debugging.
I'll have a go at it later this week.

But a binary non-debug version *is* needed. Because "we" are spoiled, a
lot of people would simply not use mod_perl unless they can get a binary
:(  (and that's not what we want).

BTW: The binary/PPM install instructions in the 2.0 docs are superb. It
took me about 20 minutes to install (perl5.8, apache2 and) mod_perl2!


-Kurt.
__________
kurt george gjerde <ku...@intermedia.uib.no>
intermedia uib, university of bergen

Working for bandwidth.



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


Re: Misc PerlOptions +Parent + PerlInterp*

Posted by Stas Bekman <st...@stason.org>.
Randy Kobes wrote:
> On Tue, 4 Mar 2003, Stas Bekman wrote:
> 
> 
>>Kurt George Gjerde wrote:
>>
>>>On Sat, 1 Mar 2003, Stas Bekman wrote:
>>>
>>>>There are two ways to debug this if you want to help.
>>>>
>>>>The easy way is to set in httpd.conf
>>>>PerlTrace i
>>>>as explained here:
>>>>http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlTrace_
>>>
>>>Would be glad to help but I use Randy Kobes' (latest) win32 build (don't
>>>have the MS compiler so I can't build my own) and this don't have the
>>>MP_TRACE enabled it seems...
>>
>>oops, looks like we need to have one binary, armored for debugging? Randy?
> 
> 
> I'm planning to do this, and have a working set-up on my
> system, but it's fairly big to maintain - it entails building
> a debug Perl and Apache version, and keeping them up-to-date,
> including the extra packages used by mod_perl (Win32, LWP, ...).
> I'll try to find some time in the next little while to
> package this up.

On the other hand, the win32 users seem to be very spoiled ;) Is it so much of 
a trouble to build the thing by themselves if copy-n-paste instructions are given?



__________________________________________________________________
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


Re: Misc PerlOptions +Parent + PerlInterp*

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Tue, 4 Mar 2003, Stas Bekman wrote:

> Kurt George Gjerde wrote:
> > On Sat, 1 Mar 2003, Stas Bekman wrote:
> >>There are two ways to debug this if you want to help.
> >>
> >>The easy way is to set in httpd.conf
> >>PerlTrace i
> >>as explained here:
> >>http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlTrace_
> > 
> > Would be glad to help but I use Randy Kobes' (latest) win32 build (don't
> > have the MS compiler so I can't build my own) and this don't have the
> > MP_TRACE enabled it seems...
> 
> oops, looks like we need to have one binary, armored for debugging? Randy?

I'm planning to do this, and have a working set-up on my
system, but it's fairly big to maintain - it entails building
a debug Perl and Apache version, and keeping them up-to-date,
including the extra packages used by mod_perl (Win32, LWP, ...).
I'll try to find some time in the next little while to
package this up.

-- 
best regards,
randy


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


Re: Misc PerlOptions +Parent + PerlInterp*

Posted by Stas Bekman <st...@stason.org>.
Kurt George Gjerde wrote:
> On Sat, 1 Mar 2003, Stas Bekman wrote:
> 
> 
>>There are two ways to debug this if you want to help.
>>
>>The easy way is to set in httpd.conf
>>PerlTrace i
>>as explained here:
>>http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlTrace_
> 
> 
> Would be glad to help but I use Randy Kobes' (latest) win32 build (don't
> have the MS compiler so I can't build my own) and this don't have the
> MP_TRACE enabled it seems...

oops, looks like we need to have one binary, armored for debugging? Randy?

>>you probably want to move
>>my $tid = APR::OS::thread_current();
>>into the handler, otherwise you reprint the old value ;)
> 
> 
> Good point.
> 
> 
>>though your $cnt does the right job to reproduce the problem.
>>
>>Also you probably want:
>>my $tid = ${ APR::OS::thread_current() };
> 
> 
> Yes I wondered about that. But ${...} *always* gives me the same ID,
> '4294967294' (always), while the ref itself changes for every new
> interpreter...

because it probably creates a new SV every time, which you print the reference 
to. Though the value is the same. Meaning that you hit the same thread.

__________________________________________________________________
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


Re: Misc PerlOptions +Parent + PerlInterp*

Posted by Kurt George Gjerde <ku...@intermedia.uib.no>.
On Sat, 1 Mar 2003, Stas Bekman wrote:

> There are two ways to debug this if you want to help.
>
> The easy way is to set in httpd.conf
> PerlTrace i
> as explained here:
> http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlTrace_

Would be glad to help but I use Randy Kobes' (latest) win32 build (don't
have the MS compiler so I can't build my own) and this don't have the
MP_TRACE enabled it seems...

> you probably want to move
> my $tid = APR::OS::thread_current();
> into the handler, otherwise you reprint the old value ;)

Good point.

> though your $cnt does the right job to reproduce the problem.
>
> Also you probably want:
> my $tid = ${ APR::OS::thread_current() };

Yes I wondered about that. But ${...} *always* gives me the same ID,
'4294967294' (always), while the ref itself changes for every new
interpreter...


BTW: I've fixed my "can't coerce GLOB to string" problem I had last week.
Was unrelated to mod_perl (sorry). It seems XML::LibXSLT produced some
errors which went straight to STDERR. Under CGI these ends up in the
error_log but under mod_perl it seems STDERR is just a black hole (?).
Would it be possible to map STDERR to log_error()?



__________
kurt george gjerde <ku...@intermedia.uib.no>
intermedia uib, university of bergen



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