Re: Zip on the fly problem

2010-01-13 Thread André Warnier

Thanks guys for this informative thread.
I use Archive::Zip extensively, including in mod_perl context.
I have not encountered this problem yet, but will now make sure to keep 
an eye open for it when I upgrade my systems.



Thomas den Braber wrote:

Yes I am sure that second argument is false.
In the old version I only used one argument but changed the second to 0
hoping that solved the problem.

As Torsten was suggesting, I tested with:

  script | cat > file

And yes that also fails with Archive::Zip 1.30  and worked ok
with 1.26

  script > file  


Worked in both versions.

There is something wrong in the new Archive::Zip module
I send a message to the CPAN forum hope they pick it up.


...


Re: Apache Blank Pages

2010-01-13 Thread 陈建春

what is your apache's mpm? worker or prefork?

Our site sometimes also rise similar error(like glibc detected ... in 
error log ) under worker mpm.


*陈建春 | ChenJianchun*
傲游Web应用部
E-mail: chen...@maxthon.net 

*Maxthon^® * --每个人的互联网中心! 上网从傲游开始!
傲游天下科技有限公司(中国)  | www.maxthon.cn 



*诚信、创新、务实、奋斗!*



cfaust-dougot 写道:

Hello,
 
I have a bizarre problem I'm hoping someone could give me some 
suggestions with.
 
I have a couple of MP2 scripts running on a server, they are both 
similar in use of modules and structure. Without any recent changes, 
one of the scripts is producing a blank apache page on SOME requests.
 
It's not always the same function, it can happen to any of the 
function calls contained in the script.
 
When the blank page happens there is nothing in either the access log 
or the error log of that virtual host (like the request never made it 
that far).
 
In the default error log I will get something like
 
[notice] child pid 11497 exit signal Aborted (6)
 
Sometimes (but not always), I'll see
 
*** glibc detected *** malloc(): memory corruption: 0x09c120f8 ***
 
There is also no consistency to the blank page, sometimes you hit the 
URL and you get the content, sometimes you get a blank page, sometimes 
1 refresh on the blank page gives you content, other times it can take 
3 - 7 refreshes before the content comes.
 
I've been trying to pull apart my script piece by piece in the hopes 
that I could at least narrow it down to some specific section but I'm 
not having a lot of luck.
 
Any thoughts on how I could debug this better?
 
TIA!


RE: SetHandler perl-script not working

2010-01-13 Thread Kevin Thorpe
I tried stripping everything out as suggested and ended up with only the 
basic httpd.conf and perl.conf installed, still no joy. Why is it 
looking for index.php when I'm assking for a perl script? Config in 
pastebin.

thanks

==> /var/log/httpd/access_log <==
10.20.11.148 - - [13/Jan/2010:12:26:21 +] "GET /perl-status 
HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; 
rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 (.NET CLR 3.5.30729)"

==> /var/log/httpd/error_log <==
[Wed Jan 13 12:26:21 2010] [error] [client 10.20.11.148] File does not 
exist: /home/httpd/html/index.php
[Wed Jan 13 12:26:21 2010] [error] [client 10.20.11.148] File does not 
exist: /home/httpd/html/index.php

http://pastebin.com/m56f4bd2b

> -Original Message-
> From: Perrin Harkins [mailto:phark...@gmail.com]
> Sent: 12 January 2010 14:13
> To: Kevin Thorpe
> Cc: modperl@perl.apache.org
> Subject: Re: SetHandler perl-script not working
> 
> On Tue, Jan 12, 2010 at 6:43 AM, Kevin Thorpe
>  wrote:
> > 
> >    SetHandler perl-script
> >    PerlResponseHandler Apache2::Status
> >    Order deny,allow
> >    Allow from all
> > 
> >
> > ...but I'm still getting 404 for the URL.
> 
> It sounds like something else in your config is intercepting the URL.
> Try removing other things one chunk at a time until this works.
> 
> Alternatively, you might be sending your requests to the wrong server
> or virtual server.
> 
> - Perrin




RE: Apache Blank Pages

2010-01-13 Thread cfaust-dougot
It's prefork
 
Apache/2.2.3 (Debian) PHP/4.4.4-8+etch6 mod_apreq2-20051231/2.6.0 
mod_perl/2.0.2 Perl/v5.8.8
 
I've isolated the problem, you guys will say I'm crazy but I can reproduce the 
results over and over again.
 
If I try to connect to a DB in that 2nd virtual host I have the problem. If I 
make no connection then there is no problem. Also if I connect to the same DB 
that the 1st virtual host does, then there is no problem. It's only when I try 
to connect to another DB that the problem comes into play.
 
That makes no sense to me, but I've been able to reproduce it 8 different times 
without fail.
 
This problem started when I updated DBI and DBD:mysql to the latest version, 
although I can't see where the conflict is as I have the latest versions 
running on other machines without any issues.
 
It's really bizarre!!
 



From: ??? [mailto:chen...@maxthon.net]
Sent: Wed 1/13/2010 7:08 AM
To: cfaust-dougot
Cc: modperl@perl.apache.org
Subject: Re: Apache Blank Pages


what is your apache's mpm? worker or prefork?

Our site sometimes also rise similar error(like glibc detected ... in error log 
) under worker mpm.



??? | ChenJianchun
??Web???
E-mail: chen...@maxthon.net 

Maxthon® --?! ???!
??(??)   | www.maxthon.cn 
  

???!



cfaust-dougot ??: 

Hello,
 
I have a bizarre problem I'm hoping someone could give me some 
suggestions with.
 
I have a couple of MP2 scripts running on a server, they are both 
similar in use of modules and structure. Without any recent changes, one of the 
scripts is producing a blank apache page on SOME requests.
 
It's not always the same function, it can happen to any of the function 
calls contained in the script.
 
When the blank page happens there is nothing in either the access log 
or the error log of that virtual host (like the request never made it that far).
 
In the default error log I will get something like
 
[notice] child pid 11497 exit signal Aborted (6)
 
Sometimes (but not always), I'll see
 
*** glibc detected *** malloc(): memory corruption: 0x09c120f8 ***
 
There is also no consistency to the blank page, sometimes you hit the 
URL and you get the content, sometimes you get a blank page, sometimes 1 
refresh on the blank page gives you content, other times it can take 3 - 7 
refreshes before the content comes.
 
I've been trying to pull apart my script piece by piece in the hopes 
that I could at least narrow it down to some specific section but I'm not 
having a lot of luck.
 
Any thoughts on how I could debug this better?
 
TIA!



RE: Apache Blank Pages

2010-01-13 Thread cfaust-dougot
It's prefork
 
Apache/2.2.3 (Debian) PHP/4.4.4-8+etch6 mod_apreq2-20051231/2.6.0 
mod_perl/2.0.2 Perl/v5.8.8
 
I've isolated the problem, you guys will say I'm crazy but I can reproduce the 
results over and over again.
 
If I try to connect to a DB in that 2nd virtual host I have the problem. If I 
make no connection then there is no problem. Also if I connect to the same DB 
that the 1st virtual host does, then there is no problem. It's only when I try 
to connect to another DB that the problem comes into play.
 
That makes no sense to me, but I've been able to reproduce it 8 different times 
without fail.
 
This problem started when I updated DBI and DBD:mysql to the latest version, 
although I can't see where the conflict is as I have the latest versions 
running on other machines without any issues.
 
It's really bizarre!!



From: ??? [mailto:chen...@maxthon.net]
Sent: Wed 1/13/2010 7:08 AM
To: cfaust-dougot
Cc: modperl@perl.apache.org
Subject: Re: Apache Blank Pages


what is your apache's mpm? worker or prefork?

Our site sometimes also rise similar error(like glibc detected ... in error log 
) under worker mpm.



??? | ChenJianchun
??Web???
E-mail: chen...@maxthon.net 

Maxthon® --?! ???!
??(??)   | www.maxthon.cn 
  

???!



cfaust-dougot ??: 

Hello,
 
I have a bizarre problem I'm hoping someone could give me some 
suggestions with.
 
I have a couple of MP2 scripts running on a server, they are both 
similar in use of modules and structure. Without any recent changes, one of the 
scripts is producing a blank apache page on SOME requests.
 
It's not always the same function, it can happen to any of the function 
calls contained in the script.
 
When the blank page happens there is nothing in either the access log 
or the error log of that virtual host (like the request never made it that far).
 
In the default error log I will get something like
 
[notice] child pid 11497 exit signal Aborted (6)
 
Sometimes (but not always), I'll see
 
*** glibc detected *** malloc(): memory corruption: 0x09c120f8 ***
 
There is also no consistency to the blank page, sometimes you hit the 
URL and you get the content, sometimes you get a blank page, sometimes 1 
refresh on the blank page gives you content, other times it can take 3 - 7 
refreshes before the content comes.
 
I've been trying to pull apart my script piece by piece in the hopes 
that I could at least narrow it down to some specific section but I'm not 
having a lot of luck.
 
Any thoughts on how I could debug this better?
 
TIA!



Re: SetHandler perl-script not working

2010-01-13 Thread Cosimo Streppone
On Wed, 13 Jan 2010 13:28:03 +0100, Kevin Thorpe  
 wrote:



I tried stripping everything out as suggested and ended up with only the
basic httpd.conf and perl.conf installed, still no joy. Why is it
looking for index.php when I'm assking for a perl script? Config in
pastebin.


You happen to have a redirect rule at line 101 that looks like:

  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

are you sure that is correct?

--
Cosimo


RE: SetHandler perl-script not working

2010-01-13 Thread Kevin Thorpe
Sorry, forgot to strip out. Was commented out for test and I had to put 
it back to get my site working. RewriteEngine wasn't on anyway and I was 
watching rewritelog (level 9) as well as access_log and error_log so no 
rewrite there

> -Original Message-
> From: Cosimo Streppone [mailto:cos...@streppone.it]
> Sent: 13 January 2010 12:31
> To: Kevin Thorpe
> Cc: Mod_perl users
> Subject: Re: SetHandler perl-script not working
> 
> On Wed, 13 Jan 2010 13:28:03 +0100, Kevin Thorpe
>  wrote:
> 
> > I tried stripping everything out as suggested and ended up with only
> the
> > basic httpd.conf and perl.conf installed, still no joy. Why is it
> > looking for index.php when I'm assking for a perl script? Config in
> > pastebin.
> 
> You happen to have a redirect rule at line 101 that looks like:
> 
>RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
> 
> are you sure that is correct?
> 
> --
> Cosimo




Re: SetHandler perl-script not working

2010-01-13 Thread Perrin Harkins
On Wed, Jan 13, 2010 at 7:28 AM, Kevin Thorpe
 wrote:
> I tried stripping everything out as suggested and ended up with only the
> basic httpd.conf and perl.conf installed, still no joy.

There's still a ton of stuff in there.  You need to take all of the
Files, Location, and Directory stuff out to find the culprit.

My wild guess is that if you move this block to the bottom, it will work.

- Perrin


Re: Apache Blank Pages

2010-01-13 Thread Perrin Harkins
On Wed, Jan 13, 2010 at 7:28 AM, cfaust-dougot  wrote:
> If I try to connect to a DB in that 2nd virtual host I have the problem. If
> I make no connection then there is no problem. Also if I connect to the same
> DB that the 1st virtual host does, then there is no problem. It's only when
> I try to connect to another DB that the problem comes into play.

It's possible you are opening this handle during startup and trying to
use it after the fork.  That would result in the sort of failures
you're seeing.

- Perrin


Re: SetHandler perl-script not working

2010-01-13 Thread Douglas Sims
Is that rewrite rule (~line 101) turning everything into an index.php?

Sent from my gPhone

On Jan 13, 2010 11:02 AM, "Perrin Harkins"  wrote:

On Wed, Jan 13, 2010 at 7:28 AM, Kevin Thorpe

 wrote:

> I tried stripping everything out as suggested and ended up with only the >
basic httpd.conf and pe...
There's still a ton of stuff in there.  You need to take all of the
Files, Location, and Directory stuff out to find the culprit.

My wild guess is that if you move this block to the bottom, it will work.

- Perrin


RE: SetHandler perl-script not working

2010-01-13 Thread Kevin Thorpe
Sorry, I had taken that out to test but forgot to strip from the 
pastebin. That's there for
Drupal which is just a huge clever 404 script.

From: Douglas Sims [mailto:ratsb...@gmail.com] 
Sent: 13 January 2010 17:10
Cc: modperl@perl.apache.org; Kevin Thorpe
Subject: Re: SetHandler perl-script not working

Is that rewrite rule (~line 101) turning everything into an index.php?
Sent from my gPhone
On Jan 13, 2010 11:02 AM, "Perrin Harkins"  wrote:

On Wed, Jan 13, 2010 at 7:28 AM, Kevin Thorpe
 wrote: 
> I tried stripping everything out as suggested and ended up with only 
the > basic httpd.conf and pe...
There's still a ton of stuff in there.  You need to take all of the
Files, Location, and Directory stuff out to find the culprit.

My wild guess is that if you move this block to the bottom, it will 
work.

- Perrin



Caveats to using Perl Sections for server configuration?

2010-01-13 Thread Boysenberry Payne
I'm using  blocks in my apache conf files for early server configuration.
I remember reading someone on this list saying they wouldn't use Perl Sections 
at all.
The main reason I chose to use them to initialize some of my server 
configuration was to allow for relative addressing to the .conf file rather 
than the apache root via the __FILE__ variable.
That allows me to load my perl startup.pl files on different servers regardless 
of where they're stored by keeping them arranged relative to the .conf file 
loading them.

Up to now I've kept what I've done in the Perl Sections limited to manipulating 
@INC and @PerlConfig.
I tried using a couple of perl modules that used 'our' type scopes and they all 
bombed out saying Perl Sections couldn't add the variable, e.g. it chokes on 
File::chdir's $CWD variable.
It does seem to use packages correctly, that in turn become available afterword 
in the symbol tables.

So while the documentation for the Perl Sections was adequate enough to get 
what I needed accomplished, it's left me hungry for more info on what's going 
on behind the scenes.

Before I go and dig around in the source (which I plan on doing,) I was 
wondering if anyone mind sharing the experience and insights on Perl Sections, 
pros cons, etc.

i.e. I'm referring to  blocks in apache .conf files.

Thank you,
Boysenberry Payne



Re: Caveats to using Perl Sections for server configuration?

2010-01-13 Thread Perrin Harkins
On Wed, Jan 13, 2010 at 3:22 PM, Boysenberry Payne
 wrote:
> I'm using  blocks in my apache conf files for early server 
> configuration.
> I remember reading someone on this list saying they wouldn't use Perl 
> Sections at all.

That might have been me.  I don't like to use them.  I find it simpler
to put all the perl code in a startup.pl.  I also like to generate my
httpd.conf from templates, and this means I can also generate conf
files for non-mod_perl servers, like my proxy.

- Perrin


RE: Apache Blank Pages

2010-01-13 Thread cfaust-dougot
Do you mean on apache startup? I'm not calling DBI or DBD in startup.pl. Any 
other module would be after the fork, wouldn't?
 
Thanks!!



From: Perrin Harkins [mailto:phark...@gmail.com]
Sent: Wed 1/13/2010 12:07 PM
To: cfaust-dougot
Cc: ???; modperl@perl.apache.org
Subject: Re: Apache Blank Pages



On Wed, Jan 13, 2010 at 7:28 AM, cfaust-dougot  wrote:
> If I try to connect to a DB in that 2nd virtual host I have the problem. If
> I make no connection then there is no problem. Also if I connect to the same
> DB that the 1st virtual host does, then there is no problem. It's only when
> I try to connect to another DB that the problem comes into play.

It's possible you are opening this handle during startup and trying to
use it after the fork.  That would result in the sort of failures
you're seeing.

- Perrin




Re: Apache Blank Pages

2010-01-13 Thread Perrin Harkins
On Wed, Jan 13, 2010 at 5:31 PM, cfaust-dougot  wrote:
> Do you mean on apache startup? I'm not calling DBI or DBD in startup.pl. Any
> other module would be after the fork, wouldn't?

Some modules (e.g. Class::DBI) will open a connection when you use
them.  If you're loading any modules at all in startup, there's a
possibility that this could be the issue.

- Perrin


RE: Apache Blank Pages

2010-01-13 Thread cfaust-dougot
Ouch, that could get messy.
 
Below is what I currently call in startup, by any chance does anything pop out 
at you? Other wise I'll start going though them one at a time.
 
Thanks Perrin
 
use ModPerl::MethodLookup;
ModPerl::MethodLookup::preload_all_modules( );
use ModPerl::Util ( ); #for CORE::GLOBAL::exit
use APR::Request ();
use APR::Request::Apache2 ();
use APR::Request::CGI ();
use APR::Request::Cookie ();
use APR::Request::Error ();
use APR::Request::Hook ();
use APR::Request::Param ();
use APR::Request::Parser ();
use APR::Table ();
use Apache2::RequestRec;
use Apache2::RequestIO;
use Apache2::RequestUtil;
use Apache2::Upload ();
use Apache2::Request ();
use Apache2::Cookie ();
use Apache2::ServerUtil();
use Apache2::Connection();
use Apache2::Log();
use ModPerl::Registry();
use Apache2::Const -compile => ':common';
use Apache2::Const -compile => qw(OK);
use Apache2::Const -compile => qw(REDIRECT);
use MIME::Lite ();
use MIME::Lite::HTML ();
use HTML::Template ();
use HTML::TagFilter ();
use Data::Page ();
use Data::Pageset ();
use Image::Magick ();
use Image::Magick::Thumbnail ();
use Image::Magick::Thumbnail::Fixed ();
 



From: Perrin Harkins [mailto:phark...@gmail.com]
Sent: Wed 1/13/2010 5:36 PM
To: cfaust-dougot
Cc: modperl@perl.apache.org
Subject: Re: Apache Blank Pages



On Wed, Jan 13, 2010 at 5:31 PM, cfaust-dougot  wrote:
> Do you mean on apache startup? I'm not calling DBI or DBD in startup.pl. Any
> other module would be after the fork, wouldn't?

Some modules (e.g. Class::DBI) will open a connection when you use
them.  If you're loading any modules at all in startup, there's a
possibility that this could be the issue.

- Perrin




Re: Caveats to using Perl Sections for server configuration?

2010-01-13 Thread Boysenberry Payne
Do you know if the scope of Perl Sections are the same as when using a 
startup.pl?

-bop

On Jan 13, 2010, at 2:15 PM, Perrin Harkins wrote:

> On Wed, Jan 13, 2010 at 3:22 PM, Boysenberry Payne
>  wrote:
>> I'm using  blocks in my apache conf files for early server 
>> configuration.
>> I remember reading someone on this list saying they wouldn't use Perl 
>> Sections at all.
> 
> That might have been me.  I don't like to use them.  I find it simpler
> to put all the perl code in a startup.pl.  I also like to generate my
> httpd.conf from templates, and this means I can also generate conf
> files for non-mod_perl servers, like my proxy.
> 
> - Perrin



Re: intermittent segfaults, ssl?

2010-01-13 Thread Mark Copper
Despite what I said, this seems to be CPAN bug 37027 or, in my case, 
Debian bug #520406 involving module DBD-mysql.

Mark

On Tue, Jan 12, 2010 at 12:24:17PM -0600, Mark Copper wrote:
> Hi,
> 
> I have a server like this:
>   Server Version: Apache/2.2.9 (Debian) mod_ssl/2.2.9 OpenSSL/0.9.8g
>   mod_apreq2-20051231/2.6.0 mod_perl/2.0.4 Perl/v5.10.0
> I'm also using HTML::Mason
> 
> I've been getting intermittent segfaults like this:
>   child pid 10142 exit signal Segmentation fault (11)
> ever since in installed Apache2 in March.
> 
> I am going to try to debug this, but I thought I would ask if anyone
> might have a suggestion based on this behavior:
>   - no segfaults occur with 8 hours of an apache restart; the first fault
> can be 8 to 48 hours after restart, the 2nd may occur within seconds;
> there have never been more than 5 in a day.
> 
>   - I have observed these faults *only* for port 443 (ssl) requests.
> 
>   - The simplest case has been when a plain HTML page was served through
> mod_perl and mason; e.g. no database call.
> 
> I know probably shouldn't be imposing on list-readers time without doing
> more work, but I just wonder is it isn't something really elementary 
> that I'm missing.
> 
> Mark