Re: [mp2][QUESTION]: Filter to modify request headers on a proxy server

2003-09-19 Thread Stas Bekman
Pringle, Chris (HP-PSG) wrote:
Thanks for this. I had put 'PerlInputFilterHandler
iPAQApache::ResetBrowser' inside the proxy block, and it should have
been outside like you said.
So it did work this time, right? Perhaps we should issue a warning if a 
connection filter is found insider  or alike.

PerlInputFilterHandler iPAQApache::ResetBrowser

Is this the correct directive?


The directive is correct, but you don't show your code and your config,
so I 
have no idea if the rest is correct or not. This directive is used to 
configure both, connection and request level filters. It's the attribute
of 
the handler subroutine is what makes the difference and the placement in

httpd.conf.

You need to declare it as:

package iPAQApache::ResetBrowser;
use base qw(Apache::Filter);
sub handler : FilterConnectionHandler { your code is here }
1;
and you need to put it outside of  or similar block in
httpd.conf 
just like shown at:
http://perl.apache.org/docs/2.0/user/handlers/filters.html#Connection_In
put_Filters

Also make sure that you run at least mod_perl 1.99_09, or even better
the 
current cvs. And in the future please follow the info at 
http://perl.apache.org/bugs/ so we know more about your setup.
__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


RE: [mp2][QUESTION]: Filter to modify request headers on a proxy server

2003-09-19 Thread Pringle, Chris (HP-PSG)
Thanks for this. I had put 'PerlInputFilterHandler
iPAQApache::ResetBrowser' inside the proxy block, and it should have
been outside like you said.


   _/***
* _/   **Chris Pringle**
 _/ *Industrial Trainee   **
*** _/_/_/ _/_/_/   *Personal Systems Group (PSG) **
***_/  _/ _/  _/*Hewlett Packard - Bristol**
***   _/  _/ _/_/_/ * **
_/ INVENT  **Tel   - +44 (0) 117 31 29664 **
** _/Email - [EMAIL PROTECTED] **
***   _/   * 



> PerlInputFilterHandler iPAQApache::ResetBrowser
> 
> Is this the correct directive?

The directive is correct, but you don't show your code and your config,
so I 
have no idea if the rest is correct or not. This directive is used to 
configure both, connection and request level filters. It's the attribute
of 
the handler subroutine is what makes the difference and the placement in

httpd.conf.

You need to declare it as:

package iPAQApache::ResetBrowser;
use base qw(Apache::Filter);
sub handler : FilterConnectionHandler { your code is here }
1;

and you need to put it outside of  or similar block in
httpd.conf 
just like shown at:
http://perl.apache.org/docs/2.0/user/handlers/filters.html#Connection_In
put_Filters

Also make sure that you run at least mod_perl 1.99_09, or even better
the 
current cvs. And in the future please follow the info at 
http://perl.apache.org/bugs/ so we know more about your setup.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Re: [mp2][QUESTION]: Filter to modify request headers on a proxy server

2003-09-19 Thread Stas Bekman
Pringle, Chris (HP-PSG) wrote:
Hi,

I've just tried that script again (see link below) using a POST request.
In the error log file, there is the content of the POST Request e.g.
user=cpringle&password=x but nothing else. There is no HTTP headers.
My Apache directive to enable the filter is
PerlInputFilterHandler iPAQApache::ResetBrowser

Is this the correct directive?
The directive is correct, but you don't show your code and your config, so I 
have no idea if the rest is correct or not. This directive is used to 
configure both, connection and request level filters. It's the attribute of 
the handler subroutine is what makes the difference and the placement in 
httpd.conf.

You need to declare it as:

package iPAQApache::ResetBrowser;
use base qw(Apache::Filter);
sub handler : FilterConnectionHandler { your code is here }
1;
and you need to put it outside of  or similar block in httpd.conf 
just like shown at:
http://perl.apache.org/docs/2.0/user/handlers/filters.html#Connection_Input_Filters

Also make sure that you run at least mod_perl 1.99_09, or even better the 
current cvs. And in the future please follow the info at 
http://perl.apache.org/bugs/ so we know more about your setup.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


RE: [mp2][QUESTION]: Filter to modify request headers on a proxy server

2003-09-19 Thread Pringle, Chris (HP-PSG)
Hi,

I've just tried that script again (see link below) using a POST request.
In the error log file, there is the content of the POST Request e.g.
user=cpringle&password=x but nothing else. There is no HTTP headers.
My Apache directive to enable the filter is

PerlInputFilterHandler iPAQApache::ResetBrowser

Is this the correct directive?


   _/***
* _/   **Chris Pringle**
 _/ *Industrial Trainee   **
*** _/_/_/ _/_/_/   *Personal Systems Group (PSG) **
***_/  _/ _/  _/*Hewlett Packard - Bristol**
***   _/  _/ _/_/_/ * **
_/ INVENT  **Tel   - +44 (0) 117 31 29664 **
** _/Email - [EMAIL PROTECTED] **
***   _/   * 



-Original Message-
From: Stas Bekman [mailto:[EMAIL PROTECTED] 
Sent: 18 September 2003 11:37
To: Pringle, Chris (HP-PSG)
Cc: [EMAIL PROTECTED]
Subject: Re: [mp2][QUESTION]: Filter to modify request headers on a
proxy server


Pringle, Chris (HP-PSG) wrote:
> Hi,
> 
> I am trying to write a filter that will sit on a proxy server and
> alter HTTP requests. Basically, what I want it to do is modify the 
> User-Agent header field so that when the request is proxied, the 
> remote web server gets a different User-Agent header field to the one 
> that was originally sent by the browser. There are also other header 
> fields I may need to modify, but I would imagine this is a simple task

> once I've worked out how to alter the User-Agent field.
> 
> Does anyone have any ideas how I might go about doing this? I've tried
> writing several PerlInputFilterHandlers, all with no success. Will 
> input filters work with a proxy? I've got output filters working with 
> no problem.
> 
> Any sample code to do what I want, along with the relavent Apache
> directives would be very  much appreciated!

The sample code that you need is here:
http://perl.apache.org/docs/2.0/user/handlers/filters.html#Connection_In
put_Filters

I haven't tried to mix filters with proxy, but I see no reason why
shouldn't 
it work. It might not work if proxy is implemented as a filter itself
and is 
running before the modperl filters, need to look at the actual
implementation.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Re: [mp2][QUESTION]: Filter to modify request headers on a proxy server

2003-09-18 Thread Stas Bekman
Pringle, Chris (HP-PSG) wrote:
Hi,

I am trying to write a filter that will sit on a proxy server and alter
HTTP requests. Basically, what I want it to do is modify the User-Agent
header field so that when the request is proxied, the remote web server
gets a different User-Agent header field to the one that was originally
sent by the browser. There are also other header fields I may need to
modify, but I would imagine this is a simple task once I've worked out
how to alter the User-Agent field.
Does anyone have any ideas how I might go about doing this? I've tried
writing several PerlInputFilterHandlers, all with no success. Will input
filters work with a proxy? I've got output filters working with no
problem. 

Any sample code to do what I want, along with the relavent Apache
directives would be very  much appreciated!
The sample code that you need is here:
http://perl.apache.org/docs/2.0/user/handlers/filters.html#Connection_Input_Filters
I haven't tried to mix filters with proxy, but I see no reason why shouldn't 
it work. It might not work if proxy is implemented as a filter itself and is 
running before the modperl filters, need to look at the actual implementation.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [PATCH] Re: mp2 with perl-5.8.1 on Windows

2003-09-15 Thread Randy Kobes
On Mon, 15 Sep 2003, Steve Hay wrote:

> I've actually rebuilt Perl and Apache as full debug builds
> so I have all these .pdb files already.  mod_perl gets
> them too because it inherits Perl's "debug build" mode.
>
> My question was where in the DevStudio GUI do you get at
> the stacktrace that you posted, or how do you get
> DevStudio to dump it out for you?  All I can find is a
> "Context" drop-down (in the panel showing variables'
> values) from which I have to manually copy down the
> information (hence I only posted a list of functions!)
> It doesn't look like you've done that!

Hi Steve,
   I see now; that's something I struggled with too,
until Doug pointed this out; try Alt+7 to give a
stacktrace window (look under View -> Debug Windows).
And perhaps also to save some grief, if you want to
copy it, select+right-click within that window
doesn't work; you have to select+Edit->Copy.

-- 
best regards,
randy


Re: [PATCH] Re: mp2 with perl-5.8.1 on Windows

2003-09-15 Thread Steve Hay
Randy Kobes wrote:

On Mon, 15 Sep 2003, Steve Hay wrote:

 

PS.  Randy: How do you that stacktrace output that you've
posted?  Is that using MSVC++, or something else?
   

Hi Steve,
 I'm using MSVC++ ... When a problem like this occurs,
an offer is made to call up the VC++ debugger, where
the trace is then done.
 In order to get a more useful trace (with symbol
information), I compiled Perl using some patches to
perl-5.8.x/win32/Makefile that ActiveState introduced
(http://aspn.activestate.com/ASPN/Downloads/ActivePerl/Source).
This patch enables debug symbols in release builds, and
involves using '-Zi' in $(OPTIMIZE) and '-debug
-opt:ref,icf' for $(LINK_DBG). With this, one gets .pdb
files corresponding to compiled libraries, which hold the
symbol information (I had to manually copy perl58.pdb
[corresponding to perl58.dll] to C:\Perl\bin). The
Apache/2.0.47 sources have this also enabled for the release
build, by default, and building mod_perl as 'perl
Makefile.PL ... MP_DEBUG=1' will enable them in mod_perl as
well.
Sorry, I should have made my question more specific.

I've actually rebuilt Perl and Apache as full debug builds so I have all 
these .pdb files already.  mod_perl gets them too because it inherits 
Perl's "debug build" mode.

My question was where in the DevStudio GUI do you get at the stacktrace 
that you posted, or how do you get DevStudio to dump it out for you?  
All I can find is a "Context" drop-down (in the panel showing variables' 
values) from which I have to manually copy down the information (hence I 
only posted a list of functions!)  It doesn't look like you've done that!

- Steve



Re: [PATCH] Re: mp2 with perl-5.8.1 on Windows

2003-09-15 Thread Randy Kobes
On Mon, 15 Sep 2003, Steve Hay wrote:

> PS.  Randy: How do you that stacktrace output that you've
> posted?  Is that using MSVC++, or something else?

Hi Steve,
  I'm using MSVC++ ... When a problem like this occurs,
an offer is made to call up the VC++ debugger, where
the trace is then done.
  In order to get a more useful trace (with symbol
information), I compiled Perl using some patches to
perl-5.8.x/win32/Makefile that ActiveState introduced
(http://aspn.activestate.com/ASPN/Downloads/ActivePerl/Source).
This patch enables debug symbols in release builds, and
involves using '-Zi' in $(OPTIMIZE) and '-debug
-opt:ref,icf' for $(LINK_DBG). With this, one gets .pdb
files corresponding to compiled libraries, which hold the
symbol information (I had to manually copy perl58.pdb
[corresponding to perl58.dll] to C:\Perl\bin). The
Apache/2.0.47 sources have this also enabled for the release
build, by default, and building mod_perl as 'perl
Makefile.PL ... MP_DEBUG=1' will enable them in mod_perl as
well.

-- 
best regards,
randy


Re: [PATCH] Re: mp2 with perl-5.8.1 on Windows

2003-09-15 Thread Rafael Garcia-Suarez
Steve Hay wrote:
> I still haven't found out what the problem with the server crashing on 
> startup is, but the attached patch against CVS seems to fix the 
> fprintf() problem that you refer to.

Your patch passes the current interpreter context to
modperl_hash_seed_init(), and thus the interpreter-wide variables. I
don't see problems with it, but I don't know anything about the mod_perl
2 internals.

I've a minor comment :

> @@ -63,7 +63,8 @@
>  if (s) {
>  int i = atoi(s);
>  if (i == 1) {
> -fprintf(stderr, "\nmod_perl: using init hash seed: %"UVuf"\n",
> +PerlIO_printf(PerlIO_stderr(),

When possible, try to use Perl_error_log instead of PerlIO_stderr().
It's equivalent to it, but checks for the availability of STDERR
beforehand. And BTW the trace below should probably be out#defined for
non-debug builds.

> + "\nmod_perl: using init hash seed: %"UVuf"\n",
>  MP_init_hash_seed);
>  }
>  }
> @@ -587,10 +588,12 @@


[PATCH] Re: mp2 with perl-5.8.1 on Windows

2003-09-15 Thread Steve Hay
Randy Kobes wrote:

On Fri, 12 Sep 2003, Steve Hay wrote:

 

Hi,

Has anybody else got mp2 (CVS) working with recent perl-5.8.1's on Windows?

I've got it building, but I can't start the Apache server at all.  (It's
fine without the mod_perl bits in the httpd.conf file.)
See this thread on p5p for what I'm getting:

http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-09/msg00795.html

Cheers,
- Steve
   

I also found a problem, as below:
==
Perl_safesysmalloc(unsigned int 0x0010) line 70 + 21 bytes
 : perl-5.8.1/util.c
modperl_hash_seed_init(apr_pool_t * 0x0026a7f0) line 44 + 7 bytes
 : modperl-2.0/src/modules/perl/mod_perl.c
modperl_hook_pre_config(apr_pool_t * 0x0026a7f0,
apr_pool_t * 0x00848100, apr_pool_t * 0x0084a108) line 594 + 9 bytes
 : modperl-2.0/src/modules/perl/mod_perl.c
ap_run_pre_config(apr_pool_t * 0x00401441, apr_pool_t * 0x0026a7f0,
 apr_pool_t * 0x00848100) line 126 + 49 bytes
main(int 0x00401d82, const char * const * 0x0008) line 575 + 19 bytes

APACHE! mainCRTStartup + 227 bytes

==
which seems to be related to the safemalloc() call on line
44 of src/modules/perl/mod_perl.c. (by the way, I had to
comment out the fprintf() call at line 66 to get it to
compile, otherwise an error about my_perl being undeclared
was found).
I still haven't found out what the problem with the server crashing on 
startup is, but the attached patch against CVS seems to fix the 
fprintf() problem that you refer to.

I've no idea how advisable what I've done is, but without it I get:

=
   cl -IC:/Temp/modperl-2.0/src/modules/perl 
-IC:/Temp/modperl-2.0/xs -IC:\
apache2/include -IC:\apache2/include -nologo -Gf -W3 -Od -MD -Zi 
-DDEBUGGING -DW
IN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT  -DPERL_IMPLICIT_CONTEXT 
-DPERL_IM
PLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX  -I"C:\perl\lib\CORE" 
-DMOD_PERL -
DMP_COMPAT_1X -Od -MD -Zi -DDEBUGGING   -c mod_perl.c && 
C:\perl\bin\perl.exe -M
ExtUtils::Command -e mv mod_perl.obj mod_perl.lo
mod_perl.c
mod_perl.c(66) : error C2065: 'my_perl' : undeclared identifier
mod_perl.c(66) : warning C4047: 'function' : 'struct interpreter *' 
differs in l
evels of indirection from 'int '
mod_perl.c(66) : warning C4024: 'Perl_IStdIO_ptr' : different types for 
formal a
nd actual parameter 1
mod_perl.c(66) : warning C4047: 'function' : 'struct interpreter *' 
differs in l
evels of indirection from 'int '
mod_perl.c(66) : warning C4024: 'Perl_IStdIO_ptr' : different types for 
formal a
nd actual parameter 1
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
=

and with it, it all builds OK.

- Steve

PS.  Randy: How do you that stacktrace output that you've posted?  Is 
that using MSVC++, or something else?

--- mod_perl.c.orig 2003-09-11 19:10:39.0 +0100
+++ mod_perl.c  2003-09-15 12:00:30.273019100 +0100
@@ -22,7 +22,7 @@
 #endif
 
 /* see modperl_hash_seed_set() */
-static void modperl_hash_seed_init(apr_pool_t *p) 
+static void modperl_hash_seed_init(pTHX_ apr_pool_t *p) 
 {
 #ifdef MP_NEED_HASH_SEED_FIXUP
 char *s;
@@ -63,7 +63,8 @@
 if (s) {
 int i = atoi(s);
 if (i == 1) {
-fprintf(stderr, "\nmod_perl: using init hash seed: %"UVuf"\n",
+PerlIO_printf(PerlIO_stderr(),
+   "\nmod_perl: using init hash seed: %"UVuf"\n",
 MP_init_hash_seed);
 }
 }
@@ -587,10 +588,12 @@
 int modperl_hook_pre_config(apr_pool_t *p, apr_pool_t *plog,
 apr_pool_t *ptemp)
 {
+dTHX;
+
 /* we can't have PerlPreConfigHandler without first configuring mod_perl */
 
 /* perl 5.8.1+ */
-modperl_hash_seed_init(p);
+modperl_hash_seed_init(aTHX_ p);
 
 return OK;
 }


Re: mp2 with perl-5.8.1 on Windows

2003-09-14 Thread Randy Kobes
On Fri, 12 Sep 2003, Steve Hay wrote:

> Hi,
>
> Has anybody else got mp2 (CVS) working with recent perl-5.8.1's on Windows?
>
> I've got it building, but I can't start the Apache server at all.  (It's
> fine without the mod_perl bits in the httpd.conf file.)
>
> See this thread on p5p for what I'm getting:
>
> http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-09/msg00795.html
>
> Cheers,
> - Steve

I also found a problem, as below:
==
Perl_safesysmalloc(unsigned int 0x0010) line 70 + 21 bytes
  : perl-5.8.1/util.c

modperl_hash_seed_init(apr_pool_t * 0x0026a7f0) line 44 + 7 bytes
  : modperl-2.0/src/modules/perl/mod_perl.c

modperl_hook_pre_config(apr_pool_t * 0x0026a7f0,
 apr_pool_t * 0x00848100, apr_pool_t * 0x0084a108) line 594 + 9 bytes
  : modperl-2.0/src/modules/perl/mod_perl.c

ap_run_pre_config(apr_pool_t * 0x00401441, apr_pool_t * 0x0026a7f0,
  apr_pool_t * 0x00848100) line 126 + 49 bytes

main(int 0x00401d82, const char * const * 0x0008) line 575 + 19 bytes

APACHE! mainCRTStartup + 227 bytes

==
which seems to be related to the safemalloc() call on line
44 of src/modules/perl/mod_perl.c. (by the way, I had to
comment out the fprintf() call at line 66 to get it to
compile, otherwise an error about my_perl being undeclared
was found).

This is with Apache/2.0.47, the current mod_perl 2 cvs, and
===
Summary of my perl5 (revision 5 version 8 subversion 1) configuration:
  Platform:
osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
uname=''
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
usethreads=undef use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
  Compiler:
cc='cl', ccflags ='-nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE 
-DNO_STRICT -DHAVE_DES_FCRYPT  -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS 
-DUSE_PERLIO -DPERL_MSVCRT_READFIX',
optimize='-MD -Zi -DNDEBUG -O1',
cppflags='-DWIN32'
ccversion='', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8
alignbytes=8, prototype=define
  Linker and Libraries:
ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf  
-libpath:"C:\Perl\lib\CORE"  -machine:x86'
libpth=\lib
libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib  comdlg32.lib 
advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.lib wsock32.lib 
mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib msvcrt.lib
perllibs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib  
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib uuid.lib 
wsock32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib msvcrt.lib
libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib
gnulibc_version='undef'
  Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf  
-libpath:"C:\Perl\lib\CORE"  -machine:x86'


Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES 
PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
  Locally applied patches:
MAINT21199
  Built under MSWin32
  Compiled at Sep 14 2003 14:32:50
  @INC:
C:/Perl/lib
C:/Perl/site/lib
.
=

-- 
best regards,
randy


Re: [MP2] Strange slow MySQL queries

2003-09-08 Thread Patrick Mulvany
Hi,

This looks more like a MySQL problem than a specific MP2 issue. However here are a 
couple of pointers.

All the queries below are updates on the same table this would indicate to me you may 
be having a locking issue. What you need to do is locate the locking transaction it 
may be as simple as :-

select * from innodb_tbl for update;  

This locks the whole table and would block all of the quiries highlighted.

Hope it helps

Paddy

P.S. Please feel free to contact me off list if you wish to go into more depth.


Are you using Apache::DBI or transactions? 

On Mon, Sep 08, 2003 at 01:13:31PM +0200, Erlend Simonsen wrote:
> I run a site with a few million MySQL requests a day, but I've run
> into a strange problem which I'm trying to slove.
> 
> The server is running Apache 2.0.47, mod_perl2-1.99r09, DBI 1.38 and
> DBD-mysql 2.1026 on a FreeBSD 4.8 machine. 
> 
> About once or twice a day, I get a bunch of slow queries that doesn't
> look like they should be slow. And most of the day they aren't. 
> 
> Examples:
> 
> # Query_time: 51  Lock_time: 0  Rows_sent: 0  Rows_examined: 0
> update innodb_tbl set col1=col1-1000, col2=col2-1000, col3=col3-1000 
> where primary_key=50;
> 
> # Query_time: 46  Lock_time: 0  Rows_sent: 0  Rows_examined: 0
> update innodb_tbl set col4=1 where primary_key=50;
> 
> # Query_time: 11  Lock_time: 0  Rows_sent: 1  Rows_examined: 0
> select * from innodb_tbl where primary_key=1 for update;
> 
> .
> 
> The list goes on and on... All of my slow queries are really fast at
> all other times. Fast as in instant. This doesn't look like a load
> issue, and I'm having problems figuring out what is causing this. 
> 
> Any ideas where to start digging and what I should try doing? I really
> need this solved.
> 
> Regards,
> Erlend Simonsen


Re: ***SPAM 06.50 / 05.00 *** Re: [mp2] ModPerl-Registry/t/bad_scritps.t returns 403 not 500

2003-09-05 Thread Ernest Lergon
Beau E. Cox wrote:

SPAM:  Start SpamAssassin results --
SPAM: This mail is probably spam.  The original message has been altered
SPAM: so you can recognise or block similar unwanted mail in future.
SPAM: See http://spamassassin.org/tag/ for more details.
SPAM: 
SPAM: Content analysis details:   (6.5 hits, 5 required)
SPAM: Hit! (2.7 points)  BODY: Nigerian scam key phrase ($NN,NNN,NNN.NN)
SPAM: Hit! (1.8 points)  No MX records for the From: domain
SPAM: Hit! (2.0 points)  Received via a relay in relays.osirusoft.com
SPAM:[RBL check: found 131.239.131.213.relays.osirusoft.com.]
SPAM: 
SPAM:  End of SpamAssassin results -

Stas -

Yep - ALL SET! Thanks a $1,000,000.

Aloha => Beau;

PS: I wonder whose anti-spam filter is going to
junk this email? :)



Mine ;-)

Ernest

--
  ProgramV - Alice on Perl - available at
   http://www.virtualitas.net/perl/aiml/
  VIRTUALITAS - Manufacturer of fine OOPPS - since 1996
*
* VIRTUALITAS Inc.   *   http://www.virtualitas.net *
* Ernest Lergon  *mailto:[EMAIL PROTECTED] *
*
  PGP-Fingerprint 6E6F DC17 A886 342D  D63F 7880 12F5 6BA9
PGP-Key http://www.virtualitas.net/Ernest_Lergon.asc
   Member of the Alicebot and AIML Architecture Committee
http://www.alicebot.org/committees/architecture.html
-
SPAM ALERT   http://www.virtualitas.net/spam.html
-




--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: [mp2] ModPerl-Registry/t/bad_scritps.t returns 403 not 500

2003-09-05 Thread Beau E. Cox
Stas -

Yep - ALL SET! Thanks a $1,000,000.

Aloha => Beau;

PS: I wonder whose anti-spam filter is going to
junk this email? :)




-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html



Re: [mp2] ModPerl-Registry/t/bad_scritps.t returns 403 not 500

2003-09-05 Thread Stas Bekman
Beau E. Cox wrote:

May be you have an old checkout of this file, try to do:

rm ModPerl-Registry/t/cgi-bin/r_inherited.pl
cvs up ModPerl-Registry/t/cgi-bin/r_inherited.pl
and try again.
Thanks Stas -

Sorry I missed the error. I did the 'rm' and re-cvs'ed -
flags correct and test OK. Next I rmeoved my entire
source tree and re-cvs'ed. Flags on r_inherit... OK.
Test OK.
It's a drawback of cvs, which can't update perms if they have changed after 
checking out the file. One has to delete and re-check out the file.

There are three scripts w/o execute permission:

 not_executable.pl (I guess that's correct)
 lib.pl
 local-conf.pl
That's fine.

So we are all set ;)

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: [mp2] ModPerl-Registry/t/bad_scritps.t returns 403 not 500

2003-09-05 Thread Beau E. Cox
- Original Message - 
From: "Stas Bekman" <[EMAIL PROTECTED]>
To: "Beau E. Cox" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, September 04, 2003 9:09 PM
Subject: Re: [mp2] ModPerl-Registry/t/bad_scritps.t returns 403 not 500


> Thank you Beau for a complete bug report.
>
> > a. ModPerl-Registry/t/bad_scritps.t returns 403 not 500.
>
> > bad_scripts1..1
> > # Running under perl version 5.008 for linux
> > # Current time local: Thu Sep  4 16:19:34 2003
> > # Current time GMT:   Fri Sep  5 02:19:34 2003
> > # Using Test.pm version 1.24
> > # testing : the script hasn't declared its private $r
> > # Failed test 1 in bad_scripts.t at line 13
> > # expected: 500
> > # received: 403
> > not ok 1
>
> > c. Error log:
> [...]
>
> The error message is right there:
>
> > [Thu Sep 04 16:19:34 2003] [error] file permissions deny server
> >
execution/usr/local/src/modperl2/modperl-2.0/ModPerl-Registry/t/cgi-bin/r_in
> > herited.pl
>
> What perms do you get when you do:
>
> ls -l ModPerl-Registry/t/cgi-bin/r_inherited.pl
>
> it should be a+rx, e.g. on my machine it's:
> -rwxr-xr-x1 stas stas  248 Mar  7 19:58
>
> I think when I have added this file to cvs it didn't have the +x bit,
which I
> then have fixed directly in the cvs repository. I have just made a fresh
> checkout and the perms seem to be correct.
>
> May be you have an old checkout of this file, try to do:
>
> rm ModPerl-Registry/t/cgi-bin/r_inherited.pl
> cvs up ModPerl-Registry/t/cgi-bin/r_inherited.pl
> and try again.
>
Thanks Stas -

Sorry I missed the error. I did the 'rm' and re-cvs'ed -
flags correct and test OK. Next I rmeoved my entire
source tree and re-cvs'ed. Flags on r_inherit... OK.
Test OK.

There are three scripts w/o execute permission:

 not_executable.pl (I guess that's correct)
 lib.pl
 local-conf.pl

Aloha => Beau;
== please visit ==
<http://beaucox.com> => main site
<http://howtos.beaucox.com> => howtos
<http://PPM.beaucox.com> => perl PPMs
<http://CPAN.beaucox.com> => CPAN
== thank you ==




-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html



Re: [mp2] ModPerl-Registry/t/bad_scritps.t returns 403 not 500

2003-09-05 Thread Stas Bekman
Thank you Beau for a complete bug report.

a. ModPerl-Registry/t/bad_scritps.t returns 403 not 500.

bad_scripts1..1
# Running under perl version 5.008 for linux
# Current time local: Thu Sep  4 16:19:34 2003
# Current time GMT:   Fri Sep  5 02:19:34 2003
# Using Test.pm version 1.24
# testing : the script hasn't declared its private $r
# Failed test 1 in bad_scripts.t at line 13
# expected: 500
# received: 403
not ok 1

c. Error log:
[...]

The error message is right there:

[Thu Sep 04 16:19:34 2003] [error] file permissions deny server
execution/usr/local/src/modperl2/modperl-2.0/ModPerl-Registry/t/cgi-bin/r_in
herited.pl
What perms do you get when you do:

ls -l ModPerl-Registry/t/cgi-bin/r_inherited.pl

it should be a+rx, e.g. on my machine it's:
-rwxr-xr-x1 stas stas  248 Mar  7 19:58
I think when I have added this file to cvs it didn't have the +x bit, which I 
then have fixed directly in the cvs repository. I have just made a fresh 
checkout and the perms seem to be correct.

May be you have an old checkout of this file, try to do:

rm ModPerl-Registry/t/cgi-bin/r_inherited.pl
cvs up ModPerl-Registry/t/cgi-bin/r_inherited.pl
and try again.
__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: [mp2] Failed to obtain the MPM name

2003-09-04 Thread Stas Bekman
Beau E. Cox wrote:

   $BASE_DIR/$SOURCE_DIR/configure \
--enable-layout=SuSE \
that's probably the problem. You can use MP_AP_PREFIX= only if you install
all

apache files under the same tree, which is the default layout. Otherwise
you

should use the MP_APXS option pointing to apxs, which will know the rest
of

the details about the layout. Please check if it works for you.

I've already adjusted the install docs to mention MP_APXS, I suppose we
need

to put it as the very first one.

Yep - MP_APXS=... works, thanks Stas.
I have updated the install docs to reflect the ever-changing reality...

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: [mp2] Failed to obtain the MPM name

2003-09-04 Thread Beau E. Cox
- Original Message - 
From: "Stas Bekman" <[EMAIL PROTECTED]>
To: "Beau E. Cox" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, September 04, 2003 6:45 AM
Subject: Re: [mp2] Failed to obtain the MPM name


> Beau E. Cox wrote:
> > Hi -
> >
> > 1) Downloaded (via CVS) latest mod_perl source (9/4/2003)
> >
> > 2) Cannot configure:
> >
> >perl Makefile.PL MP_AP_PREFIX=/usr/local/apache2/ MP_INST_APACHE2=1
> >Reading Makefile.PL args from @ARGV
> >   MP_AP_PREFIX = /usr/local/apache2
> >   MP_INST_APACHE2 = 1
> >Configuring Apache/2.0.47 mod_perl/1.99_10-dev Perl/v5.8.0
> >Failed to obtain the MPM name at lib/Apache/Build.pm line 185.
>
> This is a recent change where we extract the MPM name to know whether to
> require ithreads enabled Perl or not.
>
> > 3) Apache2 (2.0.47) configuration (Apache works)
> >
> > $BASE_DIR/$SOURCE_DIR/configure \
> >  --enable-layout=SuSE \
>
> that's probably the problem. You can use MP_AP_PREFIX= only if you install
all
> apache files under the same tree, which is the default layout. Otherwise
you
> should use the MP_APXS option pointing to apxs, which will know the rest
of
> the details about the layout. Please check if it works for you.
>
> I've already adjusted the install docs to mention MP_APXS, I suppose we
need
> to put it as the very first one.
>
> __
> Stas BekmanJAm_pH --> Just Another mod_perl Hacker


Yep - MP_APXS=... works, thanks Stas.

Aloha => Beau;
== please visit ==
<http://beaucox.com> => main site
<http://howtos.beaucox.com> => howtos
<http://PPM.beaucox.com> => perl PPMs
<http://CPAN.beaucox.com> => CPAN
== thank you ==




-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html



Re: [mp2] Failed to obtain the MPM name

2003-09-04 Thread Stas Bekman
Beau E. Cox wrote:
Hi -

1) Downloaded (via CVS) latest mod_perl source (9/4/2003)

2) Cannot configure:

   perl Makefile.PL MP_AP_PREFIX=/usr/local/apache2/ MP_INST_APACHE2=1
   Reading Makefile.PL args from @ARGV
  MP_AP_PREFIX = /usr/local/apache2
  MP_INST_APACHE2 = 1
   Configuring Apache/2.0.47 mod_perl/1.99_10-dev Perl/v5.8.0
   Failed to obtain the MPM name at lib/Apache/Build.pm line 185.
This is a recent change where we extract the MPM name to know whether to 
require ithreads enabled Perl or not.

3) Apache2 (2.0.47) configuration (Apache works)

$BASE_DIR/$SOURCE_DIR/configure \
 --enable-layout=SuSE \
that's probably the problem. You can use MP_AP_PREFIX= only if you install all 
apache files under the same tree, which is the default layout. Otherwise you 
should use the MP_APXS option pointing to apxs, which will know the rest of 
the details about the layout. Please check if it works for you.

I've already adjusted the install docs to mention MP_APXS, I suppose we need 
to put it as the very first one.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: [mp2] executing subprocesses from mod_perl

2003-09-04 Thread Haroon Rafique
On Yesterday at 2:06pm, SB=>Stas Bekman <[EMAIL PROTECTED]> wrote:

SB> 
SB> Also you may want to use Apache::SubProcess to stress it out and see
SB> if there is something that we need to fix, if it's not used we might
SB> not be aware of existings bugs that the tests don't catch. You can
SB> always switch to IPC::Run if you encounter some problems.
SB> 

Apache::SubProcess it is then. I will keep the list posted in case of 
problems.
--
Haroon Rafique
<[EMAIL PROTECTED]>



-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html



Re: [mp2] executing subprocesses from mod_perl

2003-09-03 Thread Stas Bekman
Haroon Rafique wrote:
Hi listers,

Just needed a quick opinion:

http://perl.apache.org/docs/2.0/api/Apache/SubProcess.html
suggests that Apache::SubProcess be used for executing subprocesses.
Howerver, in an earlier list message,
http://marc.theaimsgroup.com/?l=apache-modperl&m=102541721726752&w=2
Stas had suggested that either IPC::Run or Apache::SubProcess could be 
used.

I have 2 versions of a mod_perl script using either of the modules. Which 
one would be preferred and why?

Some reasons come to mind right away, e.g.,

* IPC::Run may be more mature (version 0.75), so use it.
Don't forget that Apache::SubProcess is just a glue for the C library, which 
is quite mature as well. This C library works on all platforms Apache works. 
I'm not sure about IPC::Run. Spawning processes on different OSes is quite 
different.

* IPC::Run is a separate install, so don't use it.
* Apache::SubProcess is distributed with mod_perl, so use it.
etc...
IPC::Run should be used instead of IPC::Open3, since the latter doesn't work 
under mod_perl. You probably should be able to use any of the two (IPC::Run or 
Apache::SubProcess). You could try to benchmark to see which one is faster.
Apache::SubProcess is written in C.

Apache::SubProcess has extra features (see appendix B in the "practical 
mod_perl" book and should also be in the guide, but not all were ported yet). 
e.g. in mod_perl 1's Apache::SubProcess, you can send the output of system() 
to the client:

  use Apache::SubProcess qw(system);
  my $r = shift;
  $r->send_http_header('text/plain');
  system "/bin/echo hi there";

but this wasn't ported yet.

in 2.0 you can set subprocess env:

$r->subprocess_env->set(SubProcess => $value);
my $out_fh = Apache::SubProcess::spawn_proc_prog($r, $perl, [$script]);
my $output = read_data($out_fh);
Also you may want to use Apache::SubProcess to stress it out and see if there 
is something that we need to fix, if it's not used we might not be aware of 
existings bugs that the tests don't catch. You can always switch to IPC::Run 
if you encounter some problems.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: [mp2] make test failed

2003-08-29 Thread Stas Bekman
Alan Rafagudinov wrote:
Hi!


My guess is that you've been hit by this Apache problem:
http://httpd.apache.org/docs-2.0/faq/error.html#error.sendfile
[...]
Thank you, but your advice helped with hooks/trans.t only,
ok, I have added this to the troubleshooting section.

filter/in_bbs_msg.t is still failed:

 t/TEST -v filter/in_bbs_msg.t
[...]
Test returned status 29 (wstat 7424, 0x1d00)
[...]
> [Fri Aug 29 18:10:58 2003] [error] [client 127.0.0.1] File does not exist:
> /usr/src/httpd_perl/mod_perl-1.99_09/t/htdocs/input_filter.html
that means that the filter doesn't work. Please update your cvs and show me 
the error_log's output when you run:

t/TEST -v -trace=debug filter/in_bbs_msg

Mine shows:

==> FILTER CALLED
==> FILTER READ:
GET /input_filter.html HTTP/1.0
==> GET line rewritten to be:
GET /TestFilter__in_bbs_msg HTTP/1.0
==> FILTER CALLED
==> FILTER READ:
Host: localhost.localdomain:8536
==> FILTER CALLED
==> FILTER READ:
User-Agent: libwww-perl/5.69
==> FILTER CALLED
==> FILTER READ:
As you can see it rewrites a non-existing resource /input_filter.html to an 
existing one: /TestFilter__in_bbs_msg. For some reason it fails to do that for 
you.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: [mp2] make test failed

2003-08-28 Thread Stas Bekman

My guess is that you've been hit by this Apache problem:
http://httpd.apache.org/docs-2.0/faq/error.html#error.sendfile
As the URL above suggests, try to add 'EnableSendfile On' somewhere in 
t/conf/httpd.conf and rerun:

t/TEST -v filter/in_bbs_msg.t hooks/trans.t

don't run 'make test' as it'll rewrite t/conf/httpd.conf, use t/TEST 
instead.

I wonder why http://httpd.apache.org/docs-2.0/mod/core.html#enablesendfile
says that it's on by default.
Argh, I confused "simply use the EnableSendfile directive" as to be turned on. 
It should be:

  EnableSendfile Off

of course.



__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: [mp2] make test failed

2003-08-28 Thread Stas Bekman
Alan Rafagudinov wrote:
Hello!

1. Problem Description:
Thanks for the detailed report, Alan.

Errors while 'make test' was in filter/in_bbs_msg.t and hooks/trans.t

[Thu Aug 28 20:34:19 2003] [info] (22)Invalid argument: core_output_filter: writing 
data to the network
[Thu Aug 28 20:34:19 2003] [error] [client 127.0.0.1] File does not exist: 
/usr/src/httpd_perl/mod_perl-1.99_09/t/htdocs/inpu
t_filter.html
[...]
*** /usr/local/httpd_perl/bin/httpd -V
Server version: Apache/2.0.47
Server built:   Aug 28 2003 18:59:50
Server's Module Magic Number: 20020903:4
Architecture:   32-bit
Server compiled with
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
My guess is that you've been hit by this Apache problem:
http://httpd.apache.org/docs-2.0/faq/error.html#error.sendfile
As the URL above suggests, try to add 'EnableSendfile On' somewhere in 
t/conf/httpd.conf and rerun:

t/TEST -v filter/in_bbs_msg.t hooks/trans.t

don't run 'make test' as it'll rewrite t/conf/httpd.conf, use t/TEST instead.

I wonder why http://httpd.apache.org/docs-2.0/mod/core.html#enablesendfile
says that it's on by default.
__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: [mp2] Child process exited

2003-08-20 Thread Chuck Tribolet
I just stumbled into this thread, trying to figure out how to fix
the same error, generated by a C module.

Convert 3221225725 to hex, and you get C0FD and THAT's
the code for a stack overflow.  Maybe a recursive function in your
PERL code?




-- 
Chuck Tribolet
[EMAIL PROTECTED]
http://www.almaden.ibm.com/cs/people/triblet



"Jean-Sebastien Guay" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
Hello,

I think I've made good steps towards getting my scripts to work (Apache/2.0.47 (Win32) 
mod_perl/1.99_10-dev Perl/v5.8.0). However,
now, when I try to reload one of the pages to test, IE tells me that

"The exception unknown software exception (0xc0fd) occured in the application at 
location 0x2805caa2. Click on OK to terminate
the program, Click on CANCEL to debug the program"

(in a dialog box with the big red X). This is what I get in my error_log:

[Tue Aug 05 11:10:58 2003] [notice] Parent: child process exited with status 
3221225725 -- Restarting.
[Tue Aug 05 11:11:00 2003] [notice] Parent: Created child process 1360

What could I be doing that would make one of the Apache processes crash? Does anyone 
have an idea, or should I post code? The same
thing happens when I try to telnet into the webserver's port 80 and type "GET 
/filename.cgi HTTP/1.0". The specific CGI I want to
test generates valid HTML if run from the command line.

Any ideas? Thanks in advance,

J-S

___
Jean-Sébastien Guay  [EMAIL PROTECTED]
Software Developer, Hybride http://www.hybride.com
Piedmont, Québec, Canada




-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html



Re: mp2 on osx jaguar won't load mod_perl.so

2003-08-16 Thread Michael Chamberlain
On Saturday, August 16, 2003, at 05:16  pm, Stas Bekman wrote:

Michael Chamberlain wrote:
On Saturday, August 16, 2003, at 07:03  am, Douglas Theobald wrote:
I've been quite successful with mp1 (Apache/1.3.28, mod_perl/1.28, 
perl
5.8.0, OSX jaguar 10.2.6.), but I'd really like to get mp2 going on 
OSX.
Has anyone had any luck or experienced this same problem?

Rebuild your perl with threads support, and only use '-lm -lc'.
Michael, what's the deal with using only '-lm -lc' on jaguar? Care to 
send a patch so it'll work out of box?

I'll double check if it's significant or not. I was having major 
problems getting stuff to build
before you posted your link initially to that working config. The -lm 
-lc and threads bits
where the only areas which where different. Changing to those 
everything worked.

Mike.



--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: mp2 on osx jaguar won't load mod_perl.so

2003-08-16 Thread Stas Bekman
[moving the thread back to the list, so others can benefit from it as well]

Douglas Theobald wrote:
Thanks Stas and Michael, I guess I'll have to recompile perl with ithreads.
I'll probably have two perl builds, since I don't want threads in my
standard perl.
It'd be much better if somebody could figure out what the problem is with 
non-threaded builds and fix it.

Stas, I didn't realize this was a bug, I figured this was more likely a
configuration problem on my end. 
It doesn't matter, the bug report includes all the information about your 
environment, including the configuration parameters. And without having those 
we can't tell what your problem is, whether it's a bug in mp or your 
configuration problem.

Anyway, I have thoroughly scoured this
list, google, and the mod_perl site for any and all information on this
subject (OSX, jaguar, mp2, mod_perl) and have turned up nothing but
mp1-related issues. Now that I know the solution I can easily find the
relevant posts. It would be particularly helpful if there were a "known
bugs" page at perl.apache.org (is there one? I can't find it).
It's in the STATUS file. Under 'Platforms on which mod_perl won't build/load'. 
I will add an entry on osx as soon as somebody tells me the exact details, 
besides requiring -Dusethreads. Michael has mentioned -lc -lm...

It would be
even more useful if Eric Cholet's information you gave me below was
available on the "OS-specific Info" mp2 page:
http://perl.apache.org/docs/2.0/os/index.html
You know, secretly I hope that the frustration will make someone, with osx 
knowledge, fix the problem. So instead of advertising the workaround, I'd 
rather see it fixed. However if the general opinion is that we want to make 
the workaround more visible, we can do that as well.

Another solution to this problem is to use the static build, which is 
incomplete yet. If someone wants to do that, patches are *very* welcome.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: mp2 on osx jaguar won't load mod_perl.so

2003-08-16 Thread Stas Bekman
Michael Chamberlain wrote:
On Saturday, August 16, 2003, at 07:03  am, Douglas Theobald wrote:

I've been quite successful with mp1 (Apache/1.3.28, mod_perl/1.28, perl
5.8.0, OSX jaguar 10.2.6.), but I'd really like to get mp2 going on OSX.
Has anyone had any luck or experienced this same problem?
Rebuild your perl with threads support, and only use '-lm -lc'.
Michael, what's the deal with using only '-lm -lc' on jaguar? Care to send a 
patch so it'll work out of box?

All should work fine as a DSO then.
__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: mp2 on osx jaguar won't load mod_perl.so

2003-08-16 Thread Michael Chamberlain
On Saturday, August 16, 2003, at 07:03  am, Douglas Theobald wrote:

I've been quite successful with mp1 (Apache/1.3.28, mod_perl/1.28, perl
5.8.0, OSX jaguar 10.2.6.), but I'd really like to get mp2 going on 
OSX.
Has anyone had any luck or experienced this same problem?

Rebuild your perl with threads support, and only use '-lm -lc'.

All should work fine as a DSO then.

Mike.



--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: mp2 on osx jaguar won't load mod_perl.so

2003-08-15 Thread Stas Bekman
Douglas, when reporting problems/bugs please follow the guidelines at 
http://perl.apache.org/bugs/

It's a known issue with certain builds of perl, please look in the list 
archives for similar reports.

Several people reported success with max os x using perl built with usethreads 
enabled. Here is one of them:
http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=105955380011549&w=2

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: [mp2] Child process exited

2003-08-14 Thread Jean-Sebastien Guay
> I'll try to make a small test case so you can try to repro. I think it's
> related to DBI (only a hunch), so I'll start there.

Ok, I've got it as simple as I can (I think - 25.1k zip). It isn't related
to DBI, but to template toolkit. So to try my test case, you'll need that
installed.

Should I send the zip to the list or to your private address? I'll also
include the short setup instructions.

Thanks,

J-S

___
Jean-Sébastien Guay  [EMAIL PROTECTED]
Software Developer, Hybride http://www.hybride.com
Piedmont, Québec, Canada




Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error string not specified)

2003-08-14 Thread Stas Bekman
Bill Marrs wrote:

Try this patch:
[...]
Feel free to submit this bug report and the fix to httpd-dev. Please 
let me know if you do that, so I won't duplicate it. But I'd prefer 
that you do it so you can make sure that it gets fixed in the next 
release, since you need it working.


I've just verified that your patch fixes my problem.
Great!

I've never submitted a but report and fix to httpd-dev, but I'm willing 
to do it.

How do I do it?
Open a bugzilla account and add a new bug report:
http://httpd.apache.org/bug_report.html
Please report to the list the bug id so we can document this issue for those 
who have the same problem with older httpds. Thanks.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [mp2] Child process exited

2003-08-14 Thread Jean-Sebastien Guay
> Can't get http://whitestar02.webhop.org/Files/ApacheCrash.zip
>
> it resolves to an internal address: 192.168.0.3

Darn, looks like my web server didn't come back up right last night.
I'll have to be there to fix it, because ssh doesn't get through either.

Here's another link, on my ISP's server:
http://pages.infinit.net/jeans13/ApacheCrash.zip

Sorry for the inconvenience,

J-S

___
Jean-Sébastien Guay  [EMAIL PROTECTED]
Software Developer, Hybride http://www.hybride.com
Piedmont, Québec, Canada




Re: [mp2] Child process exited

2003-08-14 Thread Jean-Sebastien Guay
> >>Is it only mp2 that it fails under?
> >>I've tried it under mp1.28/perl5.8.0/apache1.3.27 on WinXP and it
runs
> >
> > fine.
> >
> > I haven't tried other mod_perl versions, since the threading issue
would
> > render the site unusable.
>
> so I assume that there is no point trying it on linux, if Steve can't
see it
> on win. right?

Not at all, Steve didn't see it on Windows with *another* version of
mod_perl... I'm using 1.99_10, he was using 1.28. So if you can test
under Linux with 1.99_10, it might have the same problem.

And if someone else on Windows could test with 1.99_10 as well, I would
be grateful.

Thanks,

J-S

___
Jean-Sébastien Guay  [EMAIL PROTECTED]
Software Developer, Hybride http://www.hybride.com
Piedmont, Québec, Canada




Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error string not specified)

2003-08-14 Thread Bill Marrs

Please report to the list the bug id so we can document this issue for 
those who have the same problem with older httpds. Thanks.
OK, I've posted it.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22259

Thanks for the fix!

-bill



Re: [mp2] Child process exited

2003-08-14 Thread Steve Hay
Jean-Sebastien Guay wrote:

Can't get http://whitestar02.webhop.org/Files/ApacheCrash.zip

it resolves to an internal address: 192.168.0.3
   

Darn, looks like my web server didn't come back up right last night.
I'll have to be there to fix it, because ssh doesn't get through either.
Here's another link, on my ISP's server:
http://pages.infinit.net/jeans13/ApacheCrash.zip
 

Is it only mp2 that it fails under?

I've tried it under mp1.28/perl5.8.0/apache1.3.27 on WinXP and it runs fine.

What version of Template-Toolkit do you have?  It's worth ensuring that 
you're running the latest version (2.10, I think) if you suspect that it 
might be involved in the problem.

- Steve



RE: [mp2] ModPerl::Test::read_post destructive?

2003-08-14 Thread Michael Maciag
Yikes, you're right! I just found a recent thread in the apache dev list
discussing this.

Thanks, I'll approach my problem another way.

- Mike.

-Original Message-
From: Ged Haywood [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 10, 2003 12:47 PM
To: Michael Maciag
Cc: Modperl Mailing List
Subject: Re: [mp2] ModPerl::Test::read_post destructive?


Hi there,

On Sun, 10 Aug 2003, Michael Maciag wrote:

> Is the read_post in ModPerl::Test destructive in some way? If so, could
> someone point me in the right direction I might take to modify it to be
> non-destructive?

I think you'll find that reading POST data has always been destructive.
If you want to read it more than once you have to save it somewhere.
Check the archives for more information.

73,
Ged.





Re: [mp2] Child process exited

2003-08-14 Thread Steve Hay
Jean-Sebastien Guay wrote:

So, did anyone have time to check this out? This is pretty major for me,
I can't implement mod_perl at my site until I find out what is causing
this crash and fix it. And I really have no idea what could be causing
it.
I'm using CGI.pm 2.98, Template-Toolkit 2.10, Apache/2.0.47 (Win32)
mod_perl/1.99_10-dev Perl/v5.8.0.
I'm willing to try this out using Apache 2 -- I've been meaning to take 
a look at Apache 2 for some now, but just never quite got around to it 
:-( -- but at the moment I can't even build it!

I've download httpd-2.0.47.tar.gz, unpacked it, cd'd to the top-level 
directory and typed "nmake /f makefile.win installr", which I believe 
should build and install (into the default location, C:\apache2) a 
release build of Apache 2.

However, that command produces this output:

==
C:\Temp\httpd-2.0.47>nmake /f makefile.win installr
Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
Please check out or download and unpack the Apache Portability Runtime
sources (apr, apr-iconv and apr-util) into your \srclib dir.
Apache cannot build without these libraries!
makefile.win(39) : fatal error U1050: Need \srclib\  apr, apr-iconv and 
apr-util

Stop.
==
If I look inside the "srclib" directory then I only find "apr", 
"apr-util" and "pcre", not "apr-iconv".  Where is that supposed to come 
from?

How did you build Apache 2?

Steve



Re: [mp2] Child process exited

2003-08-14 Thread Jean-Sebastien Guay
Steve,

> How did you build Apache 2?

I downloaded the binaries... Sorry, can't help there.

Please keep me posted as to your progress.

Thanks,

J-S


- Original Message - 
From: "Steve Hay" <[EMAIL PROTECTED]>
To: "Jean-Sebastien Guay" <[EMAIL PROTECTED]>
Cc: "Stas Bekman" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, August 12, 2003 3:40 AM
Subject: Re: [mp2] Child process exited


> Jean-Sebastien Guay wrote:
>
> >So, did anyone have time to check this out? This is pretty major for
me,
> >I can't implement mod_perl at my site until I find out what is
causing
> >this crash and fix it. And I really have no idea what could be
causing
> >it.
> >
> >I'm using CGI.pm 2.98, Template-Toolkit 2.10, Apache/2.0.47 (Win32)
> >mod_perl/1.99_10-dev Perl/v5.8.0.
> >
> I'm willing to try this out using Apache 2 -- I've been meaning to
take
> a look at Apache 2 for some now, but just never quite got around to it
> :-( -- but at the moment I can't even build it!
>
> I've download httpd-2.0.47.tar.gz, unpacked it, cd'd to the top-level
> directory and typed "nmake /f makefile.win installr", which I believe
> should build and install (into the default location, C:\apache2) a
> release build of Apache 2.
>
> However, that command produces this output:
>
> ==
> C:\Temp\httpd-2.0.47>nmake /f makefile.win installr
>
> Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0
> Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
>
> Please check out or download and unpack the Apache Portability Runtime
> sources (apr, apr-iconv and apr-util) into your \srclib dir.
> Apache cannot build without these libraries!
>
> makefile.win(39) : fatal error U1050: Need \srclib\  apr, apr-iconv
and
> apr-util
>
> Stop.
> ==
>
> If I look inside the "srclib" directory then I only find "apr",
> "apr-util" and "pcre", not "apr-iconv".  Where is that supposed to
come
> from?
>
> How did you build Apache 2?
>
> Steve
>
>
>




Re: [mp2] Child process exited

2003-08-14 Thread Stas Bekman
I can't help you with those things without being able to reproduce the problem :(

but see below regarding the reload confusion.

[...]
# Add the top-level directory for the modules into the module search
path.
use lib qw($ENV{SCRIPT_ROOT});

Apache::Reload didn't seem to want to reload my modules.
because it probably couldn't find them.


I had followed the instructions you stated before, and you can even see
my "use libs" in the startup.pl I included above. Let's say
$ENV{SCRIPT_ROOT} (as set in my httpd.conf with a PerlSetEnv) is set to
"d:/htdocs", that means that a module being use()d as Hybride::Blah
would be found at d:/htdocs/Hybride/Blah.pm right? So Apache::Reload
should find it at the same place, since the "use libs" is in the startup
script.
But Apache::Reload still does not reload my modules... And as I said,
"ReloadDebug On" didn't even tell me if it was trying to reload them.
Nothing in my error_log, same as with the warnings.
No, that won't work, unless you set SCRIPT_ROOT env var in your shell.
PerlSetEnv has an effect only during a request time. You want it during the 
startup time.

You can dump the value of @INC, so see that d:/htdocs is not there (at the 
server startup).

One of the following will work.

PerlSwitches -Id:/htdocs

or

PerlSwitches -Mlib=d:/htdocs

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [mp2] Child process exited

2003-08-14 Thread Stas Bekman

It's possible that some of your code or the modules that you use
either misuse

$^W or trap $SIG{__WARN__} which prevents from warnings to be printed.
grep

for these two things.


Remember - there's only the code I showed you. No other modules (other
than Template, strict and warnings which are use()d in index.cgi) and no
other code than the index.cgi I sent you.
You did load things in startup.pl, remember? some module could override 
$SIG{__WARN__}. Don't load those modules if you don't need them.

You could also try to reset it in your code:

perl -wle '$SIG{__WARN__} = sub {}; $SIG{__WARN__} = sub {CORE::warn(@_)}; 
warn "foo"'
foo at -e line 1.

but you need to do that in the BEGIN block, so it'll happen before the 
compilation of the rest of the code is done:

BEGIN {
  $SIG{__WARN__} = sub {CORE::warn(@_)};
}
use strict;
use warnings;
the rest of your code

In any case your problem with variables not staying shared (even though you 
can't see it reported is easy to see).
http://perl.apache.org/docs/general/perl_reference/perl_reference.html#my___Scoped_Variable_in_Nested_Subroutines

You also don't want to initialize $template on every request, see the Template 
docs/list archive to how make it more efficient (which will also remove the 
my() problem).

make $vars and $config global as one of the workarounds.

So if on your side there are warnings and not on my side, with the same
code, then that's a problem too...
Yes, especially since you have a scoped warnings enabled explicitly in your 
file. Does you perl print this warnings when you run a test script from the 
above URL?

Now that I think of it, when I started testing mod_perl (back when my
code was not correct and I was fixing errors to make it work), I
remember that Apache::Reload didn't seem to want to reload my modules.
Even with the ReloadDebug variable on, nothing was ever printed to my
error_log saying that my modules were reloaded... So the warnings issue
could be related to this too.
because it probably couldn't find them. See:
http://perl.apache.org/docs/2.0/api/Apache/Reload.html#Description
or even this:
http://perl.apache.org/docs/2.0/api/Apache/Reload.html#Problems_With_Reloading_Modules_Which_Do_Not_Declare_Their_Package_Name
__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [mp2] Child process exited

2003-08-14 Thread Jean-Sebastien Guay
Stas,

I just checked, and when the Apache crash occurs, nothing gets written
to access_log. It would seem that the crash happens before the request
is logged.

Also,

> b) why my warnings don't show up in the error_log.

I just moved my mod_perl config from httpd.conf to another file,
mod_perl.conf, and Include that in httpd.conf. (I did that so that I
don't have to comment the whole section for mod_perl when I want to
deactivate it, I just have to comment the Include line).

Now, magically, the warnings and the Apache::Reload debug messages show
up in my error_log! The only other thing I changed between now and
before is that I added the "PerlSwitches -Id:/htdocs" directive. But
that should have no influence on whether warnings are written to the
error_log or not...

What's happening? Is my whole Apache setup whacked? Maybe I should
reinstall Apache and mod_perl?


J-S




Re: [mp2] Child process exited

2003-08-14 Thread Jean-Sebastien Guay
Stas,

Thanks for the quick response.

> You did load things in startup.pl, remember? some module could
override
> $SIG{__WARN__}. Don't load those modules if you don't need them.

I very much doubt anything in my startup.pl would modify the signal
handlers. Here's my startup.pl, for reference:

use strict;
use warnings;

#---

# Default module inclusions as per the Apache
# mod_perl installation instructions
use Apache2 ();
use ModPerl::Util ();
use Apache::RequestRec ();
use Apache::RequestIO ();
use Apache::RequestUtil ();
use Apache::Server ();
use Apache::ServerUtil ();
use Apache::Connection ();
use Apache::Log ();
use Apache::Const -compile => ':common';
use APR::Const -compile => ':common';
use APR::Table ();
use Apache::compat ();
use ModPerl::Registry ();
use CGI ();

#---

# General modules
use Time::localtime;
use Data::Dumper;
use Date::Calc qw(:all);

# Add the top-level directory for the modules into the module search
path.
use lib qw($ENV{SCRIPT_ROOT});

# Hybride:: modules commented out for now, until I resolve the crash
issue...

> You could also try to reset it in your code:

Even with the BEGIN { ... code before anything else in my source, I
still get no warnings.

> > So if on your side there are warnings and not on my side, with the
same
> > code, then that's a problem too...
>
> Yes, especially since you have a scoped warnings enabled explicitly in
your
> file. Does you perl print this warnings when you run a test script
from the
> above URL?

No. I just tried it. It does show the erroneous response (5^2 = 25 6^2 =
25) but no warnings. I also tried with the code to restore
SIG{__WARN__}, and it didn't change anything.

>> Apache::Reload didn't seem to want to reload my modules.
> because it probably couldn't find them.

I had followed the instructions you stated before, and you can even see
my "use libs" in the startup.pl I included above. Let's say
$ENV{SCRIPT_ROOT} (as set in my httpd.conf with a PerlSetEnv) is set to
"d:/htdocs", that means that a module being use()d as Hybride::Blah
would be found at d:/htdocs/Hybride/Blah.pm right? So Apache::Reload
should find it at the same place, since the "use libs" is in the startup
script.

But Apache::Reload still does not reload my modules... And as I said,
"ReloadDebug On" didn't even tell me if it was trying to reload them.
Nothing in my error_log, same as with the warnings.

So that's a bit weird.


Thanks,


J-S




Re: [mp2] Child process exited

2003-08-14 Thread Jean-Sebastien Guay
Stas,

> e.g. I'd check the access_log to see whether it issues only one
request or
> more.
> Also make sure to debug in the single process (thread?) mode
(httpd -X)

I'll check those out this afternoon.

> It's possible that some of your code or the modules that you use
either misuse
> $^W or trap $SIG{__WARN__} which prevents from warnings to be printed.
grep
> for these two things.

Remember - there's only the code I showed you. No other modules (other
than Template, strict and warnings which are use()d in index.cgi) and no
other code than the index.cgi I sent you.

So if on your side there are warnings and not on my side, with the same
code, then that's a problem too...

Now that I think of it, when I started testing mod_perl (back when my
code was not correct and I was fixing errors to make it work), I
remember that Apache::Reload didn't seem to want to reload my modules.
Even with the ReloadDebug variable on, nothing was ever printed to my
error_log saying that my modules were reloaded... So the warnings issue
could be related to this too.

This is my mod_perl section in httpd.conf, is there anything wrong with
it that would make these two things (PerlSwitches -wT and PerlModule
Apache::Reload) not work?

LoadModule  perl_module modules/mod_perl.so
LoadFile"D:/Perl/bin/perl58.dll"

PerlModule  Apache2
PerlModule  Apache::Reload
PerlSetEnv  SCRIPT_ROOT "D:/htdocs/test"
PerlRequire "D:/htdocs/_startup.pl"
PerlSetVar  ReloadAll   On
PerlSetVar  ReloadDebug On
PerlSwitches -wT

  # This is so that we don't have to run mod_perl CGI scripts from
another
  # location than the normal directories (DocumentRoot, etc)
  
 SetHandler perl-script

 PerlResponseHandler ModPerl::Registry
 Options +ExecCGI
 PerlOptions +ParseHeaders +GlobalRequest

 PerlInitHandler Apache::Reload

  

Thanks,

J-S

___
Jean-Sébastien Guay  [EMAIL PROTECTED]
Software Developer, Hybride http://www.hybride.com
Piedmont, Québec, Canada




Re: [mp2] Child process exited

2003-08-14 Thread Stas Bekman
Jean-Sebastien Guay wrote:
So, did anyone have time to check this out? This is pretty major for me,
I can't implement mod_perl at my site until I find out what is causing
this crash and fix it. And I really have no idea what could be causing
it.
I'm using CGI.pm 2.98, Template-Toolkit 2.10, Apache/2.0.47 (Win32)
mod_perl/1.99_10-dev Perl/v5.8.0.
So please, if someone on a similar setup could download the test case at
http://pages.infinit.net/jeans13/ApacheCrash.zip and see if the crash
happens for them too... Remember to read the README file first...
Jean-Sebastien, are you *sure* that what crashes is apache and not your 
client? it seems that you have the client crashing if removing  changes 
everything. What's your error_log says?

BTW, I can't reproduce you problem. You must run your code with warnings 
enabled, add to httpd.conf:

PerlSwitches -wT

and you will see:

Variable "$template" will not stay shared at /tmp/CRUSH/index.cgi line 26.
Variable "$vars" will not stay shared at /tmp/CRUSH/index.cgi line 26.
which is probably unrelated to your problem, but it's very bad. Search 
perl.apache.org for hints how to resolve the latter.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [mp2] Child process exited

2003-08-14 Thread Jean-Sebastien Guay
Steve,

> and the good news for you is that I've reproduced your problem.

GREAT! Thank you so much for persevering through this! So do you have a
traceback or some info that the developers might be able to use to track
this down?

> The "variable will not stay shared" error is a common problem with
> mod_perl scripts that have file-scope lexical variables in them which
> subroutines access.

I know, Stas alerted me to those and I fixed them in my local version.


Thanks for reproducing this. A good first step to a resolution. It's
just good to know it probably isn't my setup.

I'll try removing modules from my startup.pl as Randy Kobes suggested,
see if that changes anything.


Again, thank you.

J-S

___
Jean-Sébastien Guay  [EMAIL PROTECTED]
Software Developer, Hybride http://www.hybride.com
Piedmont, Québec, Canada




Re: [mp2] Child process exited

2003-08-14 Thread Randy Kobes
On Wed, 13 Aug 2003, Stas Bekman wrote:

> Jean-Sebastien Guay wrote:
> > Stas,
> >
> > I just checked, and when the Apache crash occurs, nothing gets written
> > to access_log. It would seem that the crash happens before the request
> > is logged.
>
> That's possible, but at least you can see that it's not IE
> that generates some followup request that causes the
> crash, but the original one.
>
> Now you need to get the crash backtrace. You probably need
> to start the server under debugger and get the backtrace
> from there. (don't ask me how to do that on win32 ;)

I'll be back next week, and I could take a look at it
then ... One can get a (mod_perl) backtrace on Win32
by compiling it with MP_DEBUG=1, and when the crash
happens, an option is presented to call up the debugger.

I haven't been able to follow this in detail yet, but
I noticed that Apache::Reload was being used. Does anything
change if this (or any other non-essential modules) aren't
used? In other words, can you pare things down to a working
version, and then start adding things until a crash is
invoked?

-- 
best regards,
randy


Re: [mp2] Child process exited

2003-08-14 Thread Stas Bekman
Jean-Sebastien Guay wrote:
Stas,


One of the following will work.

PerlSwitches -Id:/htdocs

or

PerlSwitches -Mlib=d:/htdocs


Thanks, I'll try those.

But I still don't know

a) why Apache crashes (I know you can't repro, maybe someone else on
Win32 will, so this is stalled for now).
b) why my warnings don't show up in the error_log.
Do you have anything that could help me find the solution to b) ?
I think Randy should be back soon. He will certainly help with win32. It would 
be really nice to have a few more folks helping mod_perl on win32, to get some 
load off Randy. win32 guys, please come out from the lurker shadows and try to 
give your fellas some help.

As for the warnings, even though you can't see them you can fix them. You 
can't have lexical variables in registry scripts that are used in sub-routines 
defined in the same file. I gave you all the URLs to read more on the topic. 
the simplest solution is to turn them into globals (and make sure that they 
are always initialized, which you already do). if you run 5.6.0 and higher 
just s/my/our/; on all top level vars that are used in the subs defined in the 
same file.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [mp2] Child process exited

2003-08-14 Thread Steve Hay
Jean-Sebastien Guay wrote:

Steve,

 

How did you build Apache 2?
   

I downloaded the binaries... Sorry, can't help there.

Please keep me posted as to your progress.
 

OK, I've now got Apache 2 building (with a little off-list help from 
Randy Kobes - the secret is to use the .zip sources rather than the 
.tar.gz sources!), and I've built mod_perl 1.99_09 (not 1.99_10-dev as 
your have) and the good news for you is that I've reproduced your problem.

The bads news is that I haven't solved it, but I'll keep trying and let 
you know if/when I do.

I don't any Application Error popup window, but my NS7.1 browser says 
"The document contained no data", while IE6.0 gives the usual useless 
"The page cannot be displayed" crap that it always does.

I also get nothing in the access.log.

The error.log contained this:

Variable "$template" will not stay shared at 
C:/apache2/perl-bin/index.cgi line 26.
Variable "$vars" will not stay shared at C:/apache2/perl-bin/index.cgi 
line 26.
[Thu Aug 14 10:37:04 2003] [notice] Parent: child process exited with 
status 128 -- Restarting.

The "variable will not stay shared" error is a common problem with 
mod_perl scripts that have file-scope lexical variables in them which 
subroutines access.  My usual solution is to put the main part of the 
program into a block labelled "MAIN:".  That way they can't be "shared" 
to start with, and I have to explicitly pass them into any subroutines 
that require them.  The attached new version of your "index.cgi" does 
this, and makes these errors go away.  I now have just this in the 
error.log:

[Thu Aug 14 10:41:42 2003] [notice] Parent: child process exited with 
status 128 -- Restarting.

The index.cgi program runs fine in a command prompt (with SCRIPT_ROOT 
set in the environment), so its not an obvious TT error.

TTYL,

Steve
#!D:\perl\bin\perl -w
#---
use strict;
use warnings;

use Template;

MAIN: {
#---
my $vars = {
VERSION => 0.75,
};

# Template toolkit config.
my $config = {
INCLUDE_PATH => $ENV{SCRIPT_ROOT},
INTERPOLATE  => 1,  # expand "$var" in plain text
POST_CHOMP   => 1,  # cleanup whitespace
};

my $template = Template->new($config);
#---

print qq[Content-Type: text/html\n\n];

processTemplate($template, 'header.html.tmpl', $vars);

#print qq[Apache should hopefully 
crash...];

print plural('bottle', $_) . " of beer on the wall, " .
  plural('bottle', $_) . " of beer, " .
  "Take one down and pass it around, " .
  plural('bottle', $_ - 1) . " of beer on the wall.\n"
foreach (reverse (1 .. 99));

print qq[];
}

#---
sub processTemplate {
my $template = shift;
my $t_file = shift;
my $vars = shift;
$template->process($t_file, $vars)
or die("Error pressing $t_file: " . $template->error);
}

sub plural {
my ($word, $number) = @_;
return ($number == 0 ? 'no' : $number) .
   " $word" .
   ($number == 1 ? '' : 's');
}


Re: [mp2] Child process exited

2003-08-14 Thread Stas Bekman
Jean-Sebastien Guay wrote:
Stas,

Thanks for trying out my code.


Jean-Sebastien, are you *sure* that what crashes is apache and not
your

client? it seems that you have the client crashing if removing 
changes

everything. What's your error_log says?


My client is IE, and it stays open and responsive after the crash
message. The crash message itself is a dialog box titled "Apache.exe -
Application Error"... That's pretty much a dead giveaway that it isn't
my client that's crashing.
My error_log says:

   [Tue Aug 05 11:10:58 2003] [notice] Parent: child process exited
with status 3221225725 -- Restarting.
   [Tue Aug 05 11:11:00 2003] [notice] Parent: Created child process
1360
so I'm pretty sure it's either Apache or the Perl instance started by
Apache that's crashing. What's more, from the command line and from
normal CGI, the same script (with identical output) runs without any
crash - client or otherwise.
Good, just a sanity check. it sounds silly that changing an html will break 
the server, but anything could happen. Is it possible that the broken(?) html 
makes IE do silly things, that cause the server crash in the afteraction? e.g. 
I'd check the access_log to see whether it issues only one request or more.

Also make sure to debug in the single process (thread?) mode (httpd -X)

BTW, I can't reproduce you problem.


That's bad news. Of course, this may be platform-specific... Did you try
on Win32?
I don't have win32.

Where should I go from here? This is really preventing me from using
mod_perl at all. As I said, the same things run without problems in
normal CGI.
I'm not a win32 person, so I'm not quite sure how you debug things there. But 
what you need to do is to get the server dump the core file, which will tell 
us where exactly it crushes.

Hopefully Randy will come back from vacation soon and will help you out. Or 
may be someone else.

You must run your code with warnings
enabled, add to httpd.conf:
PerlSwitches -wT

and you will see:

Variable "$template" will not stay shared at /tmp/CRUSH/index.cgi line
26.

Variable "$vars" will not stay shared at /tmp/CRUSH/index.cgi line 26.

which is probably unrelated to your problem, but it's very bad. Search
perl.apache.org for hints how to resolve the latter.


Thanks for the hint. I just modified my httpd.conf to include the
PerlSwitches line, and I don't get the same warning messages you do...
(actually I don't get any warning message) Is there a reason for this?
It's possible that some of your code or the modules that you use either misuse 
$^W or trap $SIG{__WARN__} which prevents from warnings to be printed. grep 
for these two things.

whenever you override $^W, this must be done with:

local $^W = $whatever;

so it won't affect other code. same with $SIG{__WARN__} if possible.

I'd suggest that you first get these warnings working and reported, then you 
fix your code to avoid these warnings (with the non-crashing version of the 
template), then move to solve the original problem.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [mp2] Child process exited

2003-08-14 Thread Stas Bekman
Jean-Sebastien Guay wrote:
I'll try to make a small test case so you can try to repro. I think it's
related to DBI (only a hunch), so I'll start there.


Ok, I've got it as simple as I can (I think - 25.1k zip). It isn't related
to DBI, but to template toolkit. So to try my test case, you'll need that
installed.
25k zip? that's a not quite a short test case ;) Can it possibly be 25 lines 
of code instead?

Should I send the zip to the list or to your private address? I'll also
include the short setup instructions.
Most likely someone on win32 will have to try it. If you can put it online 
somewhere and post the URL to it, that will be the best.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [mp2] Child process exited

2003-08-14 Thread Jean-Sebastien Guay
Sorry about the off-list reply Stas, I'm used to mailing lists that put
their own address in the reply-to field of incoming mails...

> How is it possible that IE pops this window, when Apache crashes?

OK, you got me, it isn't IE that pops the message, it only looked that way
because it would appear directly over the IE window. Sorry for the
mistake...

> we need the core backtrace and/or a short script that Randy or someone
else
> can reproduce the problem with on windows. I can try it on linux as well.

I'll try to make a small test case so you can try to repro. I think it's
related to DBI (only a hunch), so I'll start there.

Keep you posted... Thanks

J-S

- Original Message - 
From: "Stas Bekman" <[EMAIL PROTECTED]>
To: "Jean-Sebastien Guay" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, August 05, 2003 12:03 PM
Subject: Re: [mp2] Child process exited


> Jean-Sebastien Guay wrote:
> > Hello,
> >
> > I think I've made good steps towards getting my scripts to work
> > (Apache/2.0.47 (Win32) mod_perl/1.99_10-dev Perl/v5.8.0). However, now,
> > when I try to reload one of the pages to test, IE tells me that
> >
> > "The exception unknown software exception (0xc0fd) occured in the
> > application at location 0x2805caa2. Click on OK to terminate the
> > program, Click on CANCEL to debug the program"
>
> How is it possible that IE pops this window, when Apache crashes?
>
> > (in a dialog box with the big red X). This is what I get in my
error_log:
> >
> > [Tue Aug 05 11:10:58 2003] [notice] Parent: child process exited with
> > status 3221225725 -- Restarting.
> > [Tue Aug 05 11:11:00 2003] [notice] Parent: Created child process 1360
> >
> > What could I be doing that would make one of the Apache processes crash?
> > Does anyone have an idea, or should I post code? The same thing happens
> > when I try to telnet into the webserver's port 80 and type "GET
> > /filename.cgi HTTP/1.0". The specific CGI I want to test generates valid
> > HTML if run from the command line.
> >
> > Any ideas? Thanks in advance,
>
> we need the core backtrace and/or a short script that Randy or someone
else
> can reproduce the problem with on windows. I can try it on linux as well.
>
>
> __
> Stas BekmanJAm_pH --> Just Another mod_perl Hacker
> http://stason.org/ mod_perl Guide ---> http://perl.apache.org
> mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com
>
>
>




Re: [mp2] Child process exited

2003-08-14 Thread Stas Bekman
Jean-Sebastien Guay wrote:
Hello,
 
I think I've made good steps towards getting my scripts to work 
(Apache/2.0.47 (Win32) mod_perl/1.99_10-dev Perl/v5.8.0). However, now, 
when I try to reload one of the pages to test, IE tells me that
 
"The exception unknown software exception (0xc0fd) occured in the 
application at location 0x2805caa2. Click on OK to terminate the 
program, Click on CANCEL to debug the program"
How is it possible that IE pops this window, when Apache crashes?

(in a dialog box with the big red X). This is what I get in my error_log:
 
[Tue Aug 05 11:10:58 2003] [notice] Parent: child process exited with 
status 3221225725 -- Restarting.
[Tue Aug 05 11:11:00 2003] [notice] Parent: Created child process 1360
 
What could I be doing that would make one of the Apache processes crash? 
Does anyone have an idea, or should I post code? The same thing happens 
when I try to telnet into the webserver's port 80 and type "GET 
/filename.cgi HTTP/1.0". The specific CGI I want to test generates valid 
HTML if run from the command line.
 
Any ideas? Thanks in advance,
we need the core backtrace and/or a short script that Randy or someone else 
can reproduce the problem with on windows. I can try it on linux as well.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [mp2] Child process exited

2003-08-14 Thread Jean-Sebastien Guay
> I've actually pinpointed the problem to one HTML tag in the output that
> Template-Toolkit sends to Apache as a result of the cgi script's run.

Actually, I've just found out another thing, which is really weird. If I
just change the amount of whitespace in the template file (see the zip file
linked in my last post), I can make Apache crash or not.

Open up the template file, remove the  and  tags, and refresh
the browser. It should display the page with the header. Go back to the
template file, place the cursor right after the  tag (on the same
line), and press enter 3 times. There should be 3 blank lines between the
title tags and the  tag. Refresh the browser. In my case, it crashes.
Also, 1 or 2 empty lines doesn't crash, but 3 or more does.

I'm beginning to think there must be something very wrong with my own code.
I'm almost sure it isn't something with Apache or TT. I must just not be
seeing it.

Thanks for helping,

J-S

___
Jean-Sébastien Guay  [EMAIL PROTECTED]
Software Developer, Hybride http://www.hybride.com
Piedmont, Québec, Canada




Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error string not specified)

2003-08-14 Thread Bill Marrs

Try this patch:
[...]
Feel free to submit this bug report and the fix to httpd-dev. Please let 
me know if you do that, so I won't duplicate it. But I'd prefer that you 
do it so you can make sure that it gets fixed in the next release, since 
you need it working.
I've just verified that your patch fixes my problem.

I've never submitted a but report and fix to httpd-dev, but I'm willing to 
do it.

How do I do it?

-bill




Re: [mp2] Child process exited

2003-08-14 Thread Steve Hay
Jean-Sebastien Guay wrote:

Steve,

 

and the good news for you is that I've reproduced your problem.
   

GREAT! Thank you so much for persevering through this! So do you have a
traceback or some info that the developers might be able to use to track
this down?
Not sure how to get a stack backtrace on Windows.  I don't even get the 
Application Error popup window with a "Debug" button inviting me to have 
go :-(

However, I have massively simplified the test program that reproduces 
the problem.

I've moved the template itself in-core rather than processing an 
external file and removed everything else that I could without the 
problem going away.  I found that almost whatever I removed from the 
template -- not just the  tag -- "fixed" it, and I began to wonder 
about the *size* of the template.

So then I replaced the HTML page content with loads of dots, and sure 
enough, the problem goes away if you reduce the number of dots 
sufficiently.  It seems that the program breaks if the template size is 
> 612 bytes, and works if it is <= 612 bytes!  (Try changing $size from 
613 to 612 in getTemplate() to "fix" it!)

Template-Toolkit's Template::Manual::Config manpage says that Perl will 
segfault using the INTERPOLATE option with templates > 32 kB due to 
limitations in Perl's regex engine, and sure enough another way to "fix" 
the attached program is to change "INTERPOLATE => 1" to "INTERPOLATE => 0".

I don't know where the 612 byte limit comes from, but it's certainly not 
Perl itself that has such a small limit -- the program runs fine in CGI 
and mod_perl 1 environments with $size set way higher than 32 kB on my 
machine.

So a temporary fix would appear to be to not use the INTERPOLATE option 
if you can manage without it.

I might have to leave it to Randy for a fuller explanation of where the 
612 bytes limit is creeping in.

Steve
#!perl

use strict;
use warnings;

use Template;

MAIN: {
print qq[Content-Type: text/html\n\n];
processTemplate();
}

sub processTemplate {
my $template = Template->new({ INTERPOLATE => 1 });
my $t_text = getTemplate();
$template->process($t_text)
or die("Error processing template: " . $template->error());
}

sub getTemplate {
my $size = 612;

my $header = '';
my $footer = '';
my $centre = '.' x ($size - length($header) - length($footer));
my $t_text = $header . $centre . $footer;

return \$t_text;
}


Re: [mp2] Child process exited

2003-08-14 Thread Jean-Sebastien Guay
Stas,

Thanks for trying out my code.

> Jean-Sebastien, are you *sure* that what crashes is apache and not
your
> client? it seems that you have the client crashing if removing 
changes
> everything. What's your error_log says?

My client is IE, and it stays open and responsive after the crash
message. The crash message itself is a dialog box titled "Apache.exe -
Application Error"... That's pretty much a dead giveaway that it isn't
my client that's crashing.

My error_log says:

   [Tue Aug 05 11:10:58 2003] [notice] Parent: child process exited
with status 3221225725 -- Restarting.
   [Tue Aug 05 11:11:00 2003] [notice] Parent: Created child process
1360

so I'm pretty sure it's either Apache or the Perl instance started by
Apache that's crashing. What's more, from the command line and from
normal CGI, the same script (with identical output) runs without any
crash - client or otherwise.

> BTW, I can't reproduce you problem.

That's bad news. Of course, this may be platform-specific... Did you try
on Win32?

Where should I go from here? This is really preventing me from using
mod_perl at all. As I said, the same things run without problems in
normal CGI.

> You must run your code with warnings
> enabled, add to httpd.conf:
>
> PerlSwitches -wT
>
> and you will see:
>
> Variable "$template" will not stay shared at /tmp/CRUSH/index.cgi line
26.
> Variable "$vars" will not stay shared at /tmp/CRUSH/index.cgi line 26.
>
> which is probably unrelated to your problem, but it's very bad. Search
> perl.apache.org for hints how to resolve the latter.

Thanks for the hint. I just modified my httpd.conf to include the
PerlSwitches line, and I don't get the same warning messages you do...
(actually I don't get any warning message) Is there a reason for this?


So what do I do now? For now, I'm continuing development of my
applications under normal CGI, but I'd really like to see them work
under mod_perl...

Anyways, thanks for you help.

J-S

___
Jean-Sébastien Guay  [EMAIL PROTECTED]
Software Developer, Hybride http://www.hybride.com
Piedmont, Québec, Canada




Re: [mp2] Child process exited

2003-08-14 Thread Jean-Sebastien Guay
Stas,

> One of the following will work.
>
> PerlSwitches -Id:/htdocs
>
> or
>
> PerlSwitches -Mlib=d:/htdocs

Thanks, I'll try those.


But I still don't know

a) why Apache crashes (I know you can't repro, maybe someone else on
Win32 will, so this is stalled for now).
b) why my warnings don't show up in the error_log.

Do you have anything that could help me find the solution to b) ?


Thanks,

J-S




Re: [mp2] Child process exited

2003-08-14 Thread Stas Bekman
Jean-Sebastien Guay wrote:
Stas,

I just checked, and when the Apache crash occurs, nothing gets written
to access_log. It would seem that the crash happens before the request
is logged.
That's possible, but at least you can see that it's not IE that generates some 
followup request that causes the crash, but the original one.

Now you need to get the crash backtrace. You probably need to start the server 
under debugger and get the backtrace from there. (don't ask me how to do that 
on win32 ;)

b) why my warnings don't show up in the error_log.


I just moved my mod_perl config from httpd.conf to another file,
mod_perl.conf, and Include that in httpd.conf. (I did that so that I
don't have to comment the whole section for mod_perl when I want to
deactivate it, I just have to comment the Include line).
Now, magically, the warnings and the Apache::Reload debug messages show
up in my error_log! The only other thing I changed between now and
before is that I added the "PerlSwitches -Id:/htdocs" directive. But
that should have no influence on whether warnings are written to the
error_log or not...
What's happening? Is my whole Apache setup whacked? Maybe I should
reinstall Apache and mod_perl?
I can't tell, may be you have cleaned up some things on the way. e.g. you 
could do something that would cause the logs to be written into a different 
log file.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [mp2] Child process exited

2003-08-14 Thread Jean-Sebastien Guay
Steve,

> I found that almost whatever I removed from the
> template -- not just the  tag -- "fixed" it, and I began to
wonder
> about the *size* of the template.

That's what I was wondering too when I reported that just adding 3 line
breaks somewhere in the file "broke" it, and removing them "fixed" it. I
would never have thought that such a small template would break based on
size, though, since I have much larger templates in production using
normal CGI, which work fine. (the largest template is ~20k and the
average is ~6k).

Again, I'll have to remind myself to "never assume"... I kept on telling
myself, "Nah, it can't be the size of the template file...". Thanks a
lot for your troubleshooting, Steve.

> So a temporary fix would appear to be to not use the INTERPOLATE
option
> if you can manage without it.

Good call, that's what I'll do for now. Most of my templates don't need
it. I'll start with that.

> I might have to leave it to Randy for a fuller explanation of where
the
> 612 bytes limit is creeping in.

Looking forward to that.


J-S

___
Jean-Sébastien Guay  [EMAIL PROTECTED]
Software Developer, Hybride http://www.hybride.com
Piedmont, Québec, Canada




Re: [mp2] Child process exited

2003-08-14 Thread Jean-Sebastien Guay
I said, in my last message:
> I'll try removing modules from my startup.pl as Randy Kobes suggested,
> see if that changes anything.

It doesn't. I removed Apache::Reload from my httpd.conf, and put an
empty startup.pl instead of my real one (this one just returns 1;
nothing else) and it still crashes.

J-S

___
Jean-Sébastien Guay  [EMAIL PROTECTED]
Software Developer, Hybride http://www.hybride.com
Piedmont, Québec, Canada




Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error string not specified)

2003-08-14 Thread Stas Bekman
Bill Marrs wrote:

Please report to the list the bug id so we can document this issue for 
those who have the same problem with older httpds. Thanks.


OK, I've posted it.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22259

Thanks for the fix!
For the archives: This bug has been fixed in the current httpd-2.0 cvs, and 
will be also in the soon to be released 2.0.48.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [mp2] Child process exited

2003-08-12 Thread Jean-Sebastien Guay
So, did anyone have time to check this out? This is pretty major for me,
I can't implement mod_perl at my site until I find out what is causing
this crash and fix it. And I really have no idea what could be causing
it.

I'm using CGI.pm 2.98, Template-Toolkit 2.10, Apache/2.0.47 (Win32)
mod_perl/1.99_10-dev Perl/v5.8.0.

So please, if someone on a similar setup could download the test case at
http://pages.infinit.net/jeans13/ApacheCrash.zip and see if the crash
happens for them too... Remember to read the README file first...

Thanks,

J-S

- Original Message - 
From: "Jean-Sebastien Guay" <[EMAIL PROTECTED]>
To: "Stas Bekman" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, August 08, 2003 1:13 PM
Subject: Re: [mp2] Child process exited


> > >>Is it only mp2 that it fails under?
> > >>I've tried it under mp1.28/perl5.8.0/apache1.3.27 on WinXP and it
> runs
> > >
> > > fine.
> > >
> > > I haven't tried other mod_perl versions, since the threading issue
> would
> > > render the site unusable.
> >
> > so I assume that there is no point trying it on linux, if Steve
can't
> see it
> > on win. right?
>
> Not at all, Steve didn't see it on Windows with *another* version of
> mod_perl... I'm using 1.99_10, he was using 1.28. So if you can test
> under Linux with 1.99_10, it might have the same problem.
>
> And if someone else on Windows could test with 1.99_10 as well, I
would
> be grateful.
>
> Thanks,
>
> J-S
>
> ___
> Jean-Sébastien Guay  [EMAIL PROTECTED]
> Software Developer, Hybride http://www.hybride.com
> Piedmont, Québec, Canada
>
>
>
>




Re: [mp2] Child process exited

2003-08-10 Thread Jean-Sebastien Guay
> Is it only mp2 that it fails under?
> I've tried it under mp1.28/perl5.8.0/apache1.3.27 on WinXP and it runs
fine.

I haven't tried other mod_perl versions, since the threading issue would
render the site unusable.

> What version of Template-Toolkit do you have?  It's worth ensuring
that
> you're running the latest version (2.10, I think) if you suspect that
it
> might be involved in the problem.

Yep, I have 2.10.

Nevertheless, thanks a lot for trying it. :-)

J-S




Re: [mp2] ModPerl::Test::read_post destructive?

2003-08-10 Thread Ged Haywood
Hi there,

On Sun, 10 Aug 2003, Michael Maciag wrote:

> Is the read_post in ModPerl::Test destructive in some way? If so, could
> someone point me in the right direction I might take to modify it to be
> non-destructive?

I think you'll find that reading POST data has always been destructive.
If you want to read it more than once you have to save it somewhere.
Check the archives for more information.

73,
Ged.



Re: [mp2] segfault when connect to database

2003-08-10 Thread Stas Bekman
Danil Pismenny wrote:
httpd2 2.0.47, mod_perl 1.99_09
--
httpd does segfault when I try to connect to the database (mysql or
interbase). It faults somewhere in libnss_db.so. It works well if I
remove libnss_db* from the system.
Here is the part of programm stack from core:

#0  0x in ?? ()
#1  0x4075de1e in db_open () from /lib/libnss_db.so.2
#2  0x4075ded0 in internal_setent () from /lib/libnss_db.so.2
#3  0x4075d62e in _nss_db_endservent () from /lib/libnss_db.so.2
#4  0x4075d8c3 in _nss_db_getservbyname_r () from /lib/libnss_db.so.2
#5  0x40358733 in __getservbyname_r (name=0x405a42f7 "mysql", 
proto=0x405a42f3 "tcp", resbuf=0x4038bb7c, buffer=0x86a8a70 "", buflen=1024, 
result=0xb148) at ../nss/getXXbyYY_r.c:200
#6  0x403585e1 in getservbyname (name=0x405a42f7 "mysql", proto=0x405a42f3 "tcp")
at ../nss/getXXbyYY.c:145
#7  0x405949fb in mysql_once_init ()
   from /usr/lib/perl5/site_perl/i386-linux/auto/DBD/mysql/mysql.so
#8  0x4059711b in mysql_init ()
   from /usr/lib/perl5/site_perl/i386-linux/auto/DBD/mysql/mysql.so
#9  0x4058bf4a in mysql_dr_connect ()
Can you try reproducing the problem with an external program and then mod_cgi? 
 I don't see where mod_perl is involved here.

Thanks!

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [mp2] Child process exited

2003-08-07 Thread Jean-Sebastien Guay
So, has anyone checked out my test case? Any results (good or bad)?

As I said in my last post, I'm getting this for differing amounts of
whitespace in my template files, so it isn't just one tag to be removed
everywhere. I have something like 30 template files, most of them much
more complex than the one in the test case, so it would take a real long
time to go through each one, trying to get them to work by trial and
error. So I can't really do anything until I know what causes this and
how to work around it.

Looking forward to getting this working... Thanks

J-S

___
Jean-Sébastien Guay  [EMAIL PROTECTED]
Software Developer, Hybride http://www.hybride.com
Piedmont, Québec, Canada




Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error string not specified)

2003-08-07 Thread Stas Bekman
Bill Marrs wrote:
[...]
You would probably wish to append your script with
additional output after the empty string? Something like:
#!/usr/bin/perl
$|=1;
print "Content-Type: text/html\n\n";
print "hello world";
# This line causes the error (?)
print "";
print "hello again";
---


When I do this, the mod_perl variant of the script fails to print "hello 
again".

mod_cgi prints everything just fine and gets no errors.

I changed my test script to print a bunch of `date`'s
http://shevek.kenyonhill.com/cgi/test.pl
http://shevek.kenyonhill.com/perl/test.pl
Sorry for getting late to this thread, this is a bug in mod_deflate. You don't 
see it in mod_cgi, because mod_cgi doesn't really handle buffering and 
flushing, since it just reads the data from the pipe to the process. 
mod_deflate didn't follow the deflate() spec, saying that the caller shouldn't 
call deflate, when there is no data to deflate. Try this patch:

Index: modules/filters/mod_deflate.c
===
RCS file: /home/cvs/httpd-2.0/modules/filters/mod_deflate.c,v
retrieving revision 1.26.2.5
diff -u -r1.26.2.5 mod_deflate.c
--- modules/filters/mod_deflate.c   17 May 2003 18:27:43 -  1.26.2.5
+++ modules/filters/mod_deflate.c   5 Aug 2003 06:37:59 -
@@ -529,9 +529,11 @@
 if (APR_BUCKET_IS_FLUSH(e)) {
 apr_bucket *bkt;
-zRC = deflate(&(ctx->stream), Z_SYNC_FLUSH);
-if (zRC != Z_OK) {
-return APR_EGENERAL;
+if (ctx->stream.avail_in > 0) {
+zRC = deflate(&(ctx->stream), Z_SYNC_FLUSH);
+if (zRC != Z_OK) {
+return APR_EGENERAL;
+}
 }
 ctx->stream.next_out = ctx->buffer;

Feel free to submit this bug report and the fix to httpd-dev. Please let me 
know if you do that, so I won't duplicate it. But I'd prefer that you do it so 
you can make sure that it gets fixed in the next release, since you need it 
working.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [mp2] Child process exited

2003-08-06 Thread Jean-Sebastien Guay
> 25k zip? that's a not quite a short test case ;) Can it possibly be 25
lines
> of code instead?

You're absolutely right, I've pared it down a lot while waiting for your
answer. I was trying to get my test case to you as fast as possible, that's
why I didn't spend that much time on it before. It's still not quite 25
lines, but it's much shorter.

I've actually pinpointed the problem to one HTML tag in the output that
Template-Toolkit sends to Apache as a result of the cgi script's run. But I
still prefer giving you (or whomever will try this) the code so they can see
for themselves. It's about 3k now... :-)

> Most likely someone on win32 will have to try it. If you can put it online
> somewhere and post the URL to it, that will be the best.

OK, it's at http://whitestar02.webhop.org/Files/ApacheCrash.zip . Please go
easy on the server, it's on a residential cable line...

Inside, you'll find a simple CGI script (50 lines), one template file (26
lines) and a README (123 lines). Considering the readme file is the biggest
of the bunch, and that you can determine if the server crashes or not by
removing 4 tags in the template file, I think it's pretty stripped down.

Please read the README before trying to run it. In it, you'll find details
on my config and a short discussion of what happens in the various cases I
tried. Note that since I found the tags that cause the problem, I can
continue to work without them, but I'd still like to know why it crashes on
a script that ran perfectly in straight CGI.

Thanks a lot for trying to get this sorted.

J-S

___
Jean-Sébastien Guay  [EMAIL PROTECTED]
Software Developer, Hybride http://www.hybride.com
Piedmont, Québec, Canada




Re: [mp2] segfault when connect to database

2003-08-05 Thread Stas Bekman
Marc M. Adkins wrote:
httpd2 2.0.47, mod_perl 1.99_09
--
httpd does segfault when I try to connect to the database (mysql or
interbase). It faults somewhere in libnss_db.so. It works well if I
remove libnss_db* from the system.


I noticed a while back that when I use PostgreSQL/W2K/2.0.46/mp1.99_10 I get
a segfault _when Apache shuts down_.  I don't have it compiled such that I
can do a backtrace.
So it can't be fixed until we can see the backtrace and be able to reproduce it.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


RE: [mp2] segfault when connect to database

2003-08-03 Thread Marc M. Adkins
> httpd2 2.0.47, mod_perl 1.99_09
> --
> httpd does segfault when I try to connect to the database (mysql or
> interbase). It faults somewhere in libnss_db.so. It works well if I
> remove libnss_db* from the system.

I noticed a while back that when I use PostgreSQL/W2K/2.0.46/mp1.99_10 I get
a segfault _when Apache shuts down_.  I don't have it compiled such that I
can do a backtrace.

mma



Re: [mp2 ANNOUNCE] Apache-ParseFormData-0.06 (new module)

2003-07-30 Thread Henrique Dias

Thank's for yours comments. You are right, is not a replacement for 
Apache::Request, is a alternative implementation.

On Wed, 30 Jul 2003, Stas Bekman wrote:

> Henrique Dias wrote:
> > I'm pleased to announce the release of Apache-ParseFormData-0.06, a
> > replace for Apache::Request (libapreq). 
> 
> Cool. Though it's implemented in perl (==slower). Did you try to replicate it 
> because of being frustrated of not having Apache::Request?
> 
> Would be nice if the interested parties offer help to finish libapreq (on the 
> apreq-dev list).
> 
> And get_client_block() still has problems in the latest apache 2.0 :(
> 
> > This module only work with
> > mod_perl-2 and apache 2.
> > 
> > http://search.cpan.org/author/HDIAS/Apache-ParseFormData-0.06/ParseFormData.pm
> 
> But I think your doc needs some more work as it says:
> 
>my $apr = Apache::Request->new($r, disable_uploads => 1);
>  ^^^
> 
> or is it on purpose as a drop-in replacement?
> 
> __
> Stas BekmanJAm_pH --> Just Another mod_perl Hacker
> http://stason.org/ mod_perl Guide ---> http://perl.apache.org
> mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com
> 

-- 

Henrique Manuel Ribeiro Dias
Escola Superior de Biotecnologia - UCP
Gabinete de Desenvolvimento de Software
Rua Dr. Antonio Bernardino de Almeida
4200 Porto
Portugal
Tel: 351-225580092
CPAN: http://www.cpan.org/authors/id/H/HD/HDIAS/




Re: [mp2 ANNOUNCE] Apache-ParseFormData-0.06 (new module)

2003-07-29 Thread Stas Bekman
Henrique Dias wrote:
I'm pleased to announce the release of Apache-ParseFormData-0.06, a
replace for Apache::Request (libapreq). 
Cool. Though it's implemented in perl (==slower). Did you try to replicate it 
because of being frustrated of not having Apache::Request?

Would be nice if the interested parties offer help to finish libapreq (on the 
apreq-dev list).

And get_client_block() still has problems in the latest apache 2.0 :(

This module only work with
mod_perl-2 and apache 2.
http://search.cpan.org/author/HDIAS/Apache-ParseFormData-0.06/ParseFormData.pm
But I think your doc needs some more work as it says:

  my $apr = Apache::Request->new($r, disable_uploads => 1);
^^^
or is it on purpose as a drop-in replacement?

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: mp2: multiple include paths accross virtual servers?

2003-07-24 Thread Stas Bekman
Carl Brewer wrote:


Stas Bekman wrote:


You need to add:

  PerlOptions +Parent


PerlOption `Parent' requires an ithreads enabled Perl
That's correct. prefork mpm is the same as mod_perl 1.



__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: mp2: multiple include paths accross virtual servers?

2003-07-24 Thread Carl Brewer


Stas Bekman wrote:


You need to add:

  PerlOptions +Parent
PerlOption `Parent' requires an ithreads enabled Perl

*doh*

Carl






Re: mp2: multiple include paths accross virtual servers?

2003-07-24 Thread Stas Bekman
Carl Brewer wrote:


I'm running into something that may be a feature(!) of
my misunderstanding of how mp works.
I've got this defined in a  directive:

PerlRequire "/data/www/foo/secure/etc/startup.pl"

For a number of different virtual servers.

Is it possible for mp2 (or mp in general) to keep state seperate
between virtual servers?  Ie: if I have a different
include path set in a couple of different startup.pl scripts,
will the different virtual servers keep them seperate, or
can I only have the one across a particular httpd instance?
I'm fearing that I'll need seperate httpd's for each
seperate site?
You need to add:

  PerlOptions +Parent

See:

http://perl.apache.org/docs/2.0/user/config/config.html#C_Parent_

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [MP2] Placing Apache::RequestRec & Apache::RequestIO &APR::Table use statements in startup.pl

2003-07-24 Thread Perrin Harkins
On Thu, 2003-07-24 at 04:32, Jamie Krasnoo wrote:
> Will placing Apache::RequestRec & Apache::RequestIO & APR::Table in
> startup.pl to load them up for multiple handlers have any bad side
> effects? I noticed that when I load them via startup.pl the handlers
> that use them don't complain that they don't have the use statements
> within the module code and still work as normal.

I like to put use() statements for all required modules in each module
that needs them.  It's good documentation.  When you tune your system
for performance, you will put all of these in startup.pl to improve
shared memory, but there's no need to take them out of the other
modules: use() staments for modules that have already been loaded simply
skip the require() part and run the import().

- Perrin


Re: [MP2] Placing Apache::RequestRec & Apache::RequestIO & APR::Tableuse statements in startup.pl

2003-07-24 Thread Stas Bekman
Jamie Krasnoo wrote:
On Thu, 2003-07-24 at 02:15, Stas Bekman wrote:

Jamie Krasnoo wrote:

Will placing Apache::RequestRec & Apache::RequestIO & APR::Table in
startup.pl to load them up for multiple handlers have any bad side
effects? I noticed that when I load them via startup.pl the handlers
that use them don't complain that they don't have the use statements
within the module code and still work as normal.
While this works for you, it's a bad practice. Why? Because other people using 
your code may not have these modules loaded from startup.pl.



Won't loading them for every handler put an instance of it in
memory over and over again though? Or will Perl realize that
its already loaded and not load it again? How would this behave
in MPM threadpool?
perldoc -f require

It gets loaded only once. Why should be any difference with threadpool. 
Application-wise it's all transparent.



__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [MP2] Placing Apache::RequestRec & Apache::RequestIO & APR::Tableuse statements in startup.pl

2003-07-24 Thread Issac Goldstand
It will work.  Just be careful - if you distribute this module, the people
who use it may not include these modules in their startup.pl, and if you
discontinue usage of this module, you may end up with extra modules in
memory which aren't needed.

  Issac

- Original Message - 
From: "Jamie Krasnoo" <[EMAIL PROTECTED]>
To: "Modperl list" <[EMAIL PROTECTED]>
Sent: Thursday, July 24, 2003 11:32 AM
Subject: [MP2] Placing Apache::RequestRec & Apache::RequestIO &
APR::Tableuse statements in startup.pl


> Will placing Apache::RequestRec & Apache::RequestIO & APR::Table in
> startup.pl to load them up for multiple handlers have any bad side
> effects? I noticed that when I load them via startup.pl the handlers
> that use them don't complain that they don't have the use statements
> within the module code and still work as normal.
>
> Jamie Krasnoo
>




Re: [MP2] Placing Apache::RequestRec & Apache::RequestIO &APR::Table use statements in startup.pl

2003-07-24 Thread Jamie Krasnoo


On Thu, 2003-07-24 at 02:15, Stas Bekman wrote:
> Jamie Krasnoo wrote:
> > Will placing Apache::RequestRec & Apache::RequestIO & APR::Table in
> > startup.pl to load them up for multiple handlers have any bad side
> > effects? I noticed that when I load them via startup.pl the handlers
> > that use them don't complain that they don't have the use statements
> > within the module code and still work as normal.
> 
> While this works for you, it's a bad practice. Why? Because other people using 
> your code may not have these modules loaded from startup.pl.
> 

Won't loading them for every handler put an instance of it in
memory over and over again though? Or will Perl realize that
its already loaded and not load it again? How would this behave
in MPM threadpool?

Jamie



Re: [MP2] Placing Apache::RequestRec & Apache::RequestIO & APR::Tableuse statements in startup.pl

2003-07-24 Thread Stas Bekman
Jamie Krasnoo wrote:
Will placing Apache::RequestRec & Apache::RequestIO & APR::Table in
startup.pl to load them up for multiple handlers have any bad side
effects? I noticed that when I load them via startup.pl the handlers
that use them don't complain that they don't have the use statements
within the module code and still work as normal.
While this works for you, it's a bad practice. Why? Because other people using 
your code may not have these modules loaded from startup.pl.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [mp2] BEGIN blocks

2003-07-24 Thread Issac Goldstand
I'm not really sure what's going on...

I tried making a test module to see what was going on inside, which appeared
to function correctly.  However, the "real" module is still having troubles.
The database handle is opened ($dbh=DBI->connect...) in a BEGIN block in the
"real" module, but the connections don't seem to work when the server
originally loads, until I make a change in the file and Apache::Reload
reloads it (after which it works fine as long as the server's alive).

Here's the module and test results :

package MyTest;

use strict;
use warnings;
use Apache2;
use Apache::Const qw(-compile OK);
use carp qw(cluck);
#use vars qw($VAR);
our $VAR;
BEGIN {
warn ("Calling BEGIN block");
warn ("BEGIN: VAR is $VAR");
$VAR="HELLO";
warn ("BEGIN: CHANGED VAR to $VAR");
}

warn ("Interpreting module");
warn ("VAR is $VAR");

sub handler {
my $r=shift;
$r->content_type('text/plain');
$r->print("VAR is $VAR");
return Apache::OK;
}

END {
warn ("Calling END block");
warn ("VAR is $VAR");
}

1;

(httpd.conf)
PerlModule MyTest;

  SetHandler perl-script
  PerlResponseHandler MyTest


(error_log)
[Thu Jul 24 11:42:01 2003] [notice] Parent: Created child process 2896
calling begin at f:/you/web//YOU/Objects.pm line 17.
Calling BEGIN block at f:/you/web//MyTest.pm line 11.
Use of uninitialized value in concatenation (.) or string at
f:/you/web//MyTest.pm line 12.
BEGIN: VAR is  at f:/you/web//MyTest.pm line 12.
BEGIN: CHANGED VAR to HELLO at f:/you/web//MyTest.pm line 14.
Interpreting module at f:/you/web//MyTest.pm line 17.
VAR is HELLO at f:/you/web//MyTest.pm line 18.
[Thu Jul 24 11:42:07 2003] [notice] Child 2896: Child process is running
[Thu Jul 24 11:42:07 2003] [notice] Child 2896: Acquired the start mutex.
[Thu Jul 24 11:42:07 2003] [notice] Child 2896: Starting 250 worker threads.

(the you/objects.pm is the "real" module giving me trouble)

(output of http://localhost/TEST)
VAR is HELLOHere's the relevant parts (I hope) of my code (full code
available if needed):package YOU::ApacheApp;...use warnings;use CGI;use
DBI;...use YOU::Objects;...my $event=YOU::Event->new($i); #Should
connect to DB using $dbh..unless ($event->valid) {print "ERROR
ACCESSING DB! $DB::Objects::VERSION
${YOU::ApacheApp::VERSION}/${YOU::Objects::VERSION}"; my
$dump=Dumper($event);$dump=~s/ /\ /mg;$dump=~s/\n/\/mg;print
$dump}# $event->valid returns true if connected to DB(Objects.pm)package
YOU::Objects;use strict;use warnings;use DBI;use DB::Objects;use vars
qw($VERSION);our $dbh;BEGIN {$VERSION=0.01;my
$mysqldsn="DBI:mysql:database=...;host=...;mysql_compression=1";
$dbh=DBI->connect($mysqldsn,"...","...") or die "couldn't connect:
".DBI->errstr;}END {$dbh->disconnect();}...In this example, I get the
error message until Apache::Reload reloads the module, after which it works
fine.Any insight would be appreciated.  Issac- Original Message - 
From: "Stas Bekman" <[EMAIL PROTECTED]>
To: "Issac Goldstand" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, July 20, 2003 10:21 PM
Subject: Re: [mp2] BEGIN blocks


> Issac Goldstand wrote:
> > I seem to be having some trouble that I think may be associated with
BEGIN
> > blocks.  To make sure I'm not jumping at shadows, could someone tell me
what
> > the expected behavior of BEGIN blocks in use()d modules is?  How many
times
> > are they called (during server startup and/or restarts of any type) and
> > when?
>
> This is not documented yet for 2.0. I think it should be similar to 1.0.
BEGIN
> blocks are called when the module is loaded. What unusual behavior do you
see?
>
>
> __
> Stas BekmanJAm_pH --> Just Another mod_perl Hacker
> http://stason.org/ mod_perl Guide ---> http://perl.apache.org
> mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com
>




Re: [mp2] beta of Apache-AuthenNTLM uploaded

2003-07-23 Thread Brett Hales
On Wed, 2003-07-23 at 04:51, Shannon Eric Peevey wrote:
> The uploaded file
> 
> Apache-AuthenNTLM-2.01.tar.gz
> 
> has entered CPAN as
> 
>   file: $CPAN/authors/id/S/SP/SPEEVES/Apache-AuthenNTLM-2.01.tar.gz
>   size: 50644 bytes
>md5: f175a98ea668e81df9cc8d6db629facf
> 
> The purpose of this module is to perform a user authentication via Mircosoft's
> NTLM protocol.  (This module also implements Basic Authentication for all other 
> browsers ).
> 
> You may download this beta version of Apache-AuthenNTLM from CPAN.  It is not a 
> replacement for the existing version on CPAN, but instead will work with either 
> version of modperl.  Please, feel free to download it and send me any bug reports... 
> :)
> 

I have installed the 2.01 version, I did find a bug in
Apache-AuthenNTLM-0.23 and it still exists in this version. 

The bug was that if a person had a : (colon) in their password it did
not authenticate them.

This bug still seems to exist.

Cheers.

Brett



-- 
Brett Hales <[EMAIL PROTECTED]>



Re: MP2 Redirection

2003-07-22 Thread Stas Bekman
Jamie Krasnoo wrote:
[...]
$r->headers_out(Location => '/some/place.html');
return Apache::DECLINED;
why DECLINED? just return Apache::OK.
My mistake, its been a while and I'm just getting back into it. So its
like I'm learning everything all over again. You can use OK? The example
in the Eagle book uses REDIRECT within a handler for redirection. So I'm
assuming it goes the same for MP2.
You are right, one returns OK if using parsed headers, as in this example:

sub handler {
my $r = shift;
my $location = $r->args;

print "Location: $location\n\n";

Apache::OK;
}
I got the redirection to work. However I don't think its working as it
should. Nowhere in the docs does it say that you have to load APR::Table
with Apache::RequestRec and Apache::RequestIO to have $r->headers_out()
to work. Without APR::Table loaded I get the error:
[Tue Jul 22 03:56:35 2003] [error] [client 192.168.0.2] Can't locate
object method "STORE" via package "APR::Table" at
/www/web/perl/MyApache/Redirect.pm line 17.
$r->headers_out returns a tied hash reference, so ones needs to load 
APR::Table in order to work with this reference. Doc patches are very welcome.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: MP2 Redirection

2003-07-22 Thread Jamie Krasnoo
On Tue, 2003-07-22 at 03:10, Jamie Krasnoo wrote:
> On Tue, 2003-07-22 at 02:50, Stas Bekman wrote:
> > Jamie Krasnoo wrote:
> > > What would be the best way to redirect in MP2? How would I set the
> > > Location in the header?
> > 
> > not any different from mp1 (assuming that you have been working with mp1 
> > before, but the mp1 documentation and literature can be used as a reference 
> > for most mp2 things).
> > 
> > > something like this?
> > > 
> > > my $r = Apache->request;
> > > # docs say $r->header_out and family are now deceased.
> > 
> > that's right. And $r->headers_out() is available in mp1 for several years and 
> > should be used in mp1 as well to easy the transition.
> > 
> > > $r->headers_out(Location => '/some/place.html');
> > > return Apache::DECLINED;
> > 
> > why DECLINED? just return Apache::OK.
> 
> My mistake, its been a while and I'm just getting back into it. So its
> like I'm learning everything all over again. You can use OK? The example
> in the Eagle book uses REDIRECT within a handler for redirection. So I'm
> assuming it goes the same for MP2.
>  
> > 
> > I'm also not sure why do you use Apache->request, I assume you are inside a 
> > handler, not a registry script. Since if you are inside a registry script you 
> > don't need to return anything at all.
> 
> I was using Apache->request as an example. I guess it's a poor one. I
> should have just used 'my $r = shift;' to get the point across.

I got the redirection to work. However I don't think its working as it
should. Nowhere in the docs does it say that you have to load APR::Table
with Apache::RequestRec and Apache::RequestIO to have $r->headers_out()
to work. Without APR::Table loaded I get the error:

[Tue Jul 22 03:56:35 2003] [error] [client 192.168.0.2] Can't locate
object method "STORE" via package "APR::Table" at
/www/web/perl/MyApache/Redirect.pm line 17.

Place APR::Table in and the error goes away. Here's a sample script
below.


Jamie Krasnoo


package MyApache::Redirect;

use strict;
use warnings;

use Apache::RequestRec;
use Apache::RequestIO;
# comment out 'use APR::Table;' to get error, uncomment to make it go
# away.
# use APR::Table;

use Apache::Const -compile => qw(REDIRECT);

sub handler {
my $r = shift;

$r->content_type('text/html');
$r->headers_out->{Location} = 'http://www.yahoo.com/';

return Apache::REDIRECT;
}

1;




Re: MP2 Redirection

2003-07-22 Thread Jamie Krasnoo
On Tue, 2003-07-22 at 02:50, Stas Bekman wrote:
> Jamie Krasnoo wrote:
> > What would be the best way to redirect in MP2? How would I set the
> > Location in the header?
> 
> not any different from mp1 (assuming that you have been working with mp1 
> before, but the mp1 documentation and literature can be used as a reference 
> for most mp2 things).
> 
> > something like this?
> > 
> > my $r = Apache->request;
> > # docs say $r->header_out and family are now deceased.
> 
> that's right. And $r->headers_out() is available in mp1 for several years and 
> should be used in mp1 as well to easy the transition.
> 
> > $r->headers_out(Location => '/some/place.html');
> > return Apache::DECLINED;
> 
> why DECLINED? just return Apache::OK.

My mistake, its been a while and I'm just getting back into it. So its
like I'm learning everything all over again. You can use OK? The example
in the Eagle book uses REDIRECT within a handler for redirection. So I'm
assuming it goes the same for MP2.
 
> 
> I'm also not sure why do you use Apache->request, I assume you are inside a 
> handler, not a registry script. Since if you are inside a registry script you 
> don't need to return anything at all.

I was using Apache->request as an example. I guess it's a poor one. I
should have just used 'my $r = shift;' to get the point across.

Jamie Krasnoo
 



Re: MP2 Redirection

2003-07-22 Thread Stas Bekman
Jamie Krasnoo wrote:
What would be the best way to redirect in MP2? How would I set the
Location in the header?
not any different from mp1 (assuming that you have been working with mp1 
before, but the mp1 documentation and literature can be used as a reference 
for most mp2 things).

something like this?

my $r = Apache->request;
# docs say $r->header_out and family are now deceased.
that's right. And $r->headers_out() is available in mp1 for several years and 
should be used in mp1 as well to easy the transition.

$r->headers_out(Location => '/some/place.html');
return Apache::DECLINED;
why DECLINED? just return Apache::OK.

I'm also not sure why do you use Apache->request, I assume you are inside a 
handler, not a registry script. Since if you are inside a registry script you 
don't need to return anything at all.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error string not specified)

2003-07-21 Thread Slava Bizyayev
> Well, the problem is that I get this error in my error_log:
>
> [Mon Jul 21 14:18:55 2003] [error] 4297: ModPerl::RegistryBB: 20014:Error
> string not specified yet at /var/www/perl/test.pl line 6.
>
> Also, more important, the script seems to be terminating and/or any output
> following the 'print ""' is not sent to the client as far as I can tell.

This is another story! You have a problem with ModPerl::RegistryBB. HTTP log
can't help if ModPerl::RegistryBB aborts at that point. From my point of
view it is supposed to be a warning (or debug/warning) instead of the error
in ModPerl::RegistryBB, because it could be necessary sometimes to flush
empty string (for example, to overwrite the default chunking behavior of
core Apache).

Unfortunately, I can't look into the sources of Apache-2 now.

Can somebody help to patch this problem on Bill's machine first in order to
let us to go ahead with this research?

Thanks,
Slava



Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error string not specified)

2003-07-21 Thread Bill Marrs

We can see that mod_cgi bufferizes the output and sends it with
Content-Length HTTP header (to mod_deflate). Indeed mod_perl generates
chunked response. Finally we have the same result. I don't see any problem
at this moment.
Well, the problem is that I get this error in my error_log:

[Mon Jul 21 14:18:55 2003] [error] 4297: ModPerl::RegistryBB: 20014:Error 
string not specified yet at /var/www/perl/test.pl line 6.

Also, more important, the script seems to be terminating and/or any output 
following the 'print ""' is not sent to the client as far as I can tell.

You would probably wish to append your script with
additional output after the empty string? Something like:
#!/usr/bin/perl
$|=1;
print "Content-Type: text/html\n\n";
print "hello world";
# This line causes the error (?)
print "";
print "hello again";
---
When I do this, the mod_perl variant of the script fails to print "hello 
again".

mod_cgi prints everything just fine and gets no errors.

I changed my test script to print a bunch of `date`'s
http://shevek.kenyonhill.com/cgi/test.pl
http://shevek.kenyonhill.com/perl/test.pl
It may cause a problem for chunked output if mod_deflate does not care to
keep internal buffer and check its size when flushing...
I may not be understanding the output you sent or what you're saying, but I 
still don't follow why this would be a mod_deflate bug if mod_cgi with the 
same script has no problem.





Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error string not specified)

2003-07-21 Thread Slava Bizyayev
Well, let's see:

==> (93.530) Outgoing Request http://shevek.kenyonhill.com/cgi/test.pl
HTTP/1.1>
C05 --> S06 GET /cgi/test.pl HTTP/1.1
C05 --> S06 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/msword, */*
C05 --> S06 Accept-Language: en-us
C05 --> S06 Accept-Encoding: gzip, deflate
C05 --> S06 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)
C05 --> S06 Host: shevek.kenyonhill.com
C05 --> S06 Accept-Charset: ISO-8859-1
== Body was 0 bytes ==

C05 <-- S06 HTTP/1.1 200 OK
C05 <-- S06 Date: Mon, 21 Jul 2003 16:30:59 GMT
C05 <-- S06 Server: Apache
C05 <-- S06 Vary: Accept-Encoding,User-Agent
C05 <-- S06 Content-Encoding: gzip
C05 <-- S06 Content-Length: 34
C05 <-- S06 Connection: close
C05 <-- S06 Content-Type: text/html; charset=ISO-8859-1
C05 <-- S06 == Incoming Body was 34 bytes ==
== real URL = http://shevek.kenyonhill.com/cgi/test.pl ==
== Transmission: text gzip  ==
== (93.640) Response 200 to http://shevek.kenyonhill.com/cgi/test.pl
HTTP/1.1>
== Latency = 0.110 seconds, Extra Delay = 0.000 seconds
== Restored Body was 14 bytes ==
== Content Begin: ==
hello world
== Content End ==

==> (164.770) Outgoing Request http://shevek.kenyonhill.com/perl/test.pl HTTP/1.1>
C05 --> S06 GET /perl/test.pl HTTP/1.1
C05 --> S06 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/msword, */*
C05 --> S06 Accept-Language: en-us
C05 --> S06 Accept-Encoding: gzip, deflate
C05 --> S06 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)
C05 --> S06 Host: shevek.kenyonhill.com
C05 --> S06 Accept-Charset: ISO-8859-1
== Body was 0 bytes ==

C05 <-- S06 HTTP/1.1 200 OK
C05 <-- S06 Date: Mon, 21 Jul 2003 16:32:11 GMT
C05 <-- S06 Server: Apache
C05 <-- S06 Vary: Accept-Encoding,User-Agent
C05 <-- S06 Content-Encoding: gzip
C05 <-- S06 Connection: close
C05 <-- S06 Transfer-Encoding: chunked
C05 <-- S06 Content-Type: text/html; charset=ISO-8859-1
C05 <-- S06 == Incoming Body was 629 bytes ==
== real URL = http://shevek.kenyonhill.com/perl/test.pl ==
== Transmission: text gzip chunked ==
== Chunk Log ==
1e (hex) = 30 (dec)
245 (hex) = 581 (dec)
0 (hex) = 0 (dec)
== (164.880) Response 200 to http://shevek.kenyonhill.com/perl/test.pl
HTTP/1.1>
== Latency = 0.110 seconds, Extra Delay = 0.000 seconds
== Restored Body was 14 bytes ==
== Content Begin: ==
hello world
== Content End ==

We can see that mod_cgi bufferizes the output and sends it with
Content-Length HTTP header (to mod_deflate). Indeed mod_perl generates
chunked response. Finally we have the same result. I don't see any problem
at this moment. You would probably wish to append your script with
additional output after the empty string? Something like:

#!/usr/bin/perl
$|=1;
print "Content-Type: text/html\n\n";
print "hello world";
# This line causes the error (?)
print "";
print "hello again";
---

It may cause a problem for chunked output if mod_deflate does not care to
keep internal buffer and check its size when flushing...

Thanks,
Slava


- Original Message - 
From: "Bill Marrs" <[EMAIL PROTECTED]>
To: "Slava Bizyayev" <[EMAIL PROTECTED]>; "Stas Bekman"
<[EMAIL PROTECTED]>; "Philippe M. Chiasson" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, July 21, 2003 6:49 AM
Subject: Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error string
not specified)


>
> >I can measure it myself if you can provide me with URLs to your resources
> >and identify them in terms of which one is mod_CGI and which is mod_perl.
>
> This is the mod_cgi one that works fine, no errors:
> http://shevek.kenyonhill.com/cgi/test.pl
>
> This is the mod_perl one (same script) that generates the "20014:Error" in
> the error_log.  Also, the page doesn't display correctly (it seems to
erase
> itself):
>
> http://shevek.kenyonhill.com/perl/test.pl
>
> This is the contents of test.pl:
>
> ---
> #!/usr/bin/perl
> $|=1;
> print "Content-Type: text/html\n\n";
> print "hello world";
> # This line causes the error
> print "";
> ---
>
> Let me know if you need anything more.
>
>



Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error string not specified)

2003-07-21 Thread Bill Marrs

I can measure it myself if you can provide me with URLs to your resources
and identify them in terms of which one is mod_CGI and which is mod_perl.
This is the mod_cgi one that works fine, no errors:
http://shevek.kenyonhill.com/cgi/test.pl
This is the mod_perl one (same script) that generates the "20014:Error" in 
the error_log.  Also, the page doesn't display correctly (it seems to erase 
itself):

http://shevek.kenyonhill.com/perl/test.pl

This is the contents of test.pl:

---
#!/usr/bin/perl
$|=1;
print "Content-Type: text/html\n\n";
print "hello world";
# This line causes the error
print "";
---
Let me know if you need anything more.



Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error string not specified)

2003-07-20 Thread Slava Bizyayev
It is supposed to be something like the following:

  C05 --> S06 GET /html/wowtmovie.html HTTP/1.1
  C05 --> S06 Accept: */*
  C05 --> S06 Accept-Language: en-us
  C05 --> S06 Accept-Encoding: gzip, deflate
  C05 --> S06 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)
  C05 --> S06 Host: devl4.outlook.net
  C05 --> S06 Pragma: no-cache
  C05 --> S06 Accept-Charset: ISO-8859-1
  == Body was 0 bytes ==

  C05 <-- S06 HTTP/1.1 200 OK
  C05 <-- S06 Date: Fri, 31 May 2002 17:36:57 GMT
  C05 <-- S06 Server: Apache/1.3.22 (Unix) Debian GNU/Linux mod_perl/1.26
  C05 <-- S06 X-Module-Sender: Apache::Dynagzip
  C05 <-- S06 Transfer-Encoding: chunked
  C05 <-- S06 Expires: Friday, 31-May-2002 17:41:57 GMT
  C05 <-- S06 Vary: Accept-Encoding
  C05 <-- S06 Content-Type: text/html; charset=iso-8859-1
  C05 <-- S06 Content-Encoding: gzip
  C05 <-- S06 == Incoming Body was 9411 bytes ==
  == Transmission: text gzip chunked ==
  == Chunk Log ==
  a (hex) = 10 (dec)
  1314 (hex) = 4884 (dec)
  3ed (hex) = 1005 (dec)
  354 (hex) = 852 (dec)
  450 (hex) = 1104 (dec)
  5e6 (hex) = 1510 (dec)
  0 (hex) = 0 (dec)
  == Latency = 0.170 seconds, Extra Delay = 0.440 seconds
  == Restored Body was 149208 bytes ==

Not necessarily the same...
To measure it you might want to use a proxy, or a sniffer.

I can measure it myself if you can provide me with URLs to your resources
and identify them in terms of which one is mod_CGI and which is mod_perl.

Thanks,
Slava


- Original Message - 
From: "Bill Marrs" <[EMAIL PROTECTED]>
To: "Slava Bizyayev" <[EMAIL PROTECTED]>; "Stas Bekman"
<[EMAIL PROTECTED]>; "Philippe M. Chiasson" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, July 20, 2003 6:22 PM
Subject: Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error string
not specified)


> At 11:07 AM 7/19/2003, Slava Bizyayev wrote:
> >May I see your client side HTTP log of the request-response transaction
> >through mod_cgi vs. mod_perl?
>
> I'm not sure what you mean.  Do you mean my access_log?  I have a
> deflate_log as well (that shows the compression stats as well).  But,
maybe
> you're talking about something else?  If so, how do I get what you want?
>
>
>



Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error string not specified)

2003-07-20 Thread Bill Marrs
At 11:07 AM 7/19/2003, Slava Bizyayev wrote:
May I see your client side HTTP log of the request-response transaction
through mod_cgi vs. mod_perl?
I'm not sure what you mean.  Do you mean my access_log?  I have a 
deflate_log as well (that shows the compression stats as well).  But, maybe 
you're talking about something else?  If so, how do I get what you want?




Re: [mp2] BEGIN blocks

2003-07-20 Thread Stas Bekman
Issac Goldstand wrote:
I seem to be having some trouble that I think may be associated with BEGIN
blocks.  To make sure I'm not jumping at shadows, could someone tell me what
the expected behavior of BEGIN blocks in use()d modules is?  How many times
are they called (during server startup and/or restarts of any type) and
when?
This is not documented yet for 2.0. I think it should be similar to 1.0. BEGIN 
blocks are called when the module is loaded. What unusual behavior do you see?

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: MP2 variables

2003-07-20 Thread Stas Bekman
[redirecting to the modperl list, as others will want to know the answer as well]

Hi Jamie,

What is the MP2 equivalent of $Apache::ServerStarting? I'm trying to get
Apache::DBI working with MP2.
% grep Server::Starting todo/*
todo/deprecated_features.txt:- $Apache::Server::Starting, 
$Apache::Server::ReStarting

In Apache 2.0 the configuration file is always parsed and executed, on start 
and restart, so everything is executed as many times as this happens. Moreover 
when you stop the server, it gets executed as well, which is a bummer IMHO. 
But that's how Apache 2.0 works.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error string not specified)

2003-07-19 Thread Slava Bizyayev
May I see your client side HTTP log of the request-response transaction
through mod_cgi vs. mod_perl?

Thanks,
Slava

- Original Message - 
From: "Bill Marrs" <[EMAIL PROTECTED]>
To: "Slava Bizyayev" <[EMAIL PROTECTED]>; "Stas Bekman"
<[EMAIL PROTECTED]>; "Philippe M. Chiasson" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, July 19, 2003 7:01 AM
Subject: Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error string
not specified)


> At 07:16 PM 7/18/2003, Slava Bizyayev wrote:
> >In my understanding _it is_ a problem of mod_deflate.
>
> The error does not occur if I run the same test script under mod_cgi
> instead of mod_perl.  This suggests that the problem is in mod_perl not
> mod_deflate.
>
> right?
>
>
>



Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error string not specified)

2003-07-19 Thread Bill Marrs
At 07:16 PM 7/18/2003, Slava Bizyayev wrote:
In my understanding _it is_ a problem of mod_deflate.
The error does not occur if I run the same test script under mod_cgi 
instead of mod_perl.  This suggests that the problem is in mod_perl not 
mod_deflate.

right?




Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error string not specified)

2003-07-18 Thread Slava Bizyayev
Hi guys,

In my understanding _it is_ a problem of mod_deflate. It's a bit tricky to
flush dynamically generated content over HTTP/1.1: Core Apache marks the end
of your document with empty chunk. When you flush an empty string in the
middle of your document Apache has no way to serve your directions, but to
create an empty chunk immediately. The first empty chunk received by the
client is recognized as the end of the document. The rest of the data stream
is just ignored.

I didn't have a chance to look into the source of mod_deflate yet, but this
definitely has to be taken into account over there. In my understanding it
would be the best our bet just to bring this issue to the attention of the
author of mod_deflate. It's supposed to be easy to fix.

Thanks,
Slava

- Original Message - 
From: "Stas Bekman" <[EMAIL PROTECTED]>
To: "Philippe M. Chiasson" <[EMAIL PROTECTED]>
Cc: "Bill Marrs" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, July 15, 2003 3:24 AM
Subject: Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error string
not specified)


> Philippe M. Chiasson wrote:
> > On Thu, 2003-07-03 at 01:24, Bill Marrs wrote:
> >
> >>This fixed the bug for me.
> >
> >
> > Great! Will commit it in the near future. (Can't seem to access the cvs
> > server right now, crappy internet cafe)
>
> -1, this is a wrong solution. print ""; should flush just like it did in
> mod_perl 1.0 if $| == 1; Consider this script:
>
>  print "Content-type: text/plain\n\n";
>  local $| = 0;
>  print "start\n\n";
>  local $| = 1;
>  print "";
>  sleep 5;
>  local $| = 0;
>  print "end\n";
>
> print "", must immediately flush the buffered data, since $| has changed
from
> 0 to 1.
>
>
> > One thing that could help is if someone could take the time to write a
> > test for this bug.
>
> Unfortunately I don't seem to be able to reproduce the problem, so I can't
> debug the problem. It could be a bug on the mod_deflate's behalf as well.
> Philippe, were you able to reproduce the problem with Bill's setup? I was
> writing a test, but couldn't get it to fail... may be because i was using
> 2.0.47. Bill, do you have the problem with the latest apache version?
>
> Also Bill, why do you have this setup:
>
> 
>AddOutputFilterByType DEFLATE text/*
>SetOutputFilter DEFLATE
> 
>
> why adding it twice? You need only the latter inside , or
> alternatively only the former outside  if you want it to be set
> globally:
> http://httpd.apache.org/docs-2.0/mod/core.html#addoutputfilterbytype
>
> __
> Stas BekmanJAm_pH --> Just Another mod_perl Hacker
> http://stason.org/ mod_perl Guide ---> http://perl.apache.org
> mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com
>
>



Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error string not specified)

2003-07-15 Thread Bill Marrs

I could upgrade to 2.0.47, but it seems unlikely that it would fix 
this.  Are you sure you're running a mod_perl without Philippe's fix (in 
Apache__RequestIO.h), I assumed he eventually checked it in.
No, Philippe hasn't committed it, neither I have used it. If you can test 
with 2.9.47 that will help. Otherwise I'll later try with .46 as well.
I just upgraded to Apache 2.0.47 and the latest CVS of mp2 and I'm 
reproducing it, same as I originally reported.

I tried a few variations to see if I could find other factors, but didn't 
have much luck.  The server I'm testing on is live (runs a small site), so 
I'm somewhat limited in what I can do.  But, I tried removing mod_rewrite, 
and mod_ssl from my server config and I still got the error in my tests.

I also tried varying the mod_deflate config (as you pointed out it was 
redundant/wrong)...

Also Bill, why do you have this setup:


  AddOutputFilterByType DEFLATE text/*
  SetOutputFilter DEFLATE

why adding it twice? You need only the latter inside , or 
alternatively only the former outside  if you want it to be 
set globally:
http://httpd.apache.org/docs-2.0/mod/core.html#addoutputfilterbytype
Ah, I misunderstood the mod_deflate docs.  I think at the time, it didn't 
seem to work with just one of them in-place, so I added the 
other.  *SHRUG*  I can't say I'm a pro at Apache config files, I just 
tinker until it works.  I assume this is irrelevant to the bug, though.
I'm not sure if your config doesn't insert the filter twice. Need to check 
whether SetOutputFilter overrides AddOutputFilterByType as well.
In my config, I have a deflate log:

DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%) "%{User-agent}i"' 
deflate
CustomLog /var/log/httpd/deflate_log deflate

I was using this to verify that deflate was active or not.  What I found 
was that using "AddOutputFilterByType DEFLATE text/*" doesn't seem to 
activate deflate, no matter where I put it (in a  or at the 
top-level of the config).  My deflate log shows that no compression is 
occurring.  "SetOutputFilter DEFLATE" does activate deflate globally (for 
all locations), no matter where I put it.  I'm afraid I don't find the 
mod_deflate docs very clear on placement.

When you were trying to reproduce, I don't know if you used my (redundant) 
config before, but if you only used "AddOutputFilterByType DEFLATE text/*", 
and not "SetOutputFilter DEFLATE", that might explain why you were not able 
to reproduce this, I don't think that activates deflate (at least that's 
what my deflate_log shows for me).

Otherwise, if you're still not reproducing this, I would assume there's 
some difference in the way we are building apache or our apache config 
files or perl?

Here's my Apache Configure line:

./configure --enable-modules=all --enable-mods-shared=all --enable-deflate 
--with-mpm=prefork --enable-rewrite --enable-ssl

Here are the Modules I load:

LoadModule cgi_module modules/mod_cgi.so

LoadModule access_module modules/mod_access.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule env_module modules/mod_env.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule mime_module modules/mod_mime.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule asis_module modules/mod_asis.so
LoadModule info_module modules/mod_info.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule dir_module modules/mod_dir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule perl_module modules/mod_perl.so
LoadModule ssl_module modules/mod_ssl.so
mod_cgi, mod_ssl and mod_rewrite seem to be innocent (when I removed them, 
it still failed), but maybe you're using a module that I'm not and this is 
causing your config to work better?   I think that I'm loading less modules 
than what is typical, I removed as many as I could to reduce memory usage a 
while ago.

*SHRUG*

One thing that may be relevant is tracking down where the "20014:Error" is 
coming from.  Web searching seems to associate it with Berkeley DB code, 
which seems odd to me, is Apache using Berkeley DB code somewhere (via a 
filter?)?

This isn't a very important issue for me.  I have a decent workaround 
(print " " instead of ""), plus I'm not really able to use mod_deflate that 
much anyway because it puts too much load on my server (mod_gzip with 
Apache 1.3 worked better for me).

Thanks

-bill








  1   2   3   4   5   >