Skip Menu |

This queue is for tickets about the Compress-Zlib CPAN distribution.

Report information
The Basics
Id: 39629
Status: stalled
Priority: 0/
Queue: Compress-Zlib

People
Owner: Nobody in particular
Requestors: ~yaph/cpan/pause/{nospam}/08-02-26 [...] rainbow.in-berlin.de
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.003
Fixed in: (no value)



Subject: gzopen fails on Apache::Upload
my $r = Apache->request; my $apr = Apache::Request->new ($r); my $upload = $apr->upload ('logfile'); my $fh = $upload->fh; my $fhz = gzopen ($fh, 'rb'); dies in the gzopen with "[Fri Sep 26 12:13:04 2008] [error] Can't locate object method "read" via package "Apache::Upload" at /usr/lib/perl5/vendor_perl/5.8.5/IO/Uncompress/Base.pm line 68.\n at [...]" this is within mod_perl. Apache::Request, of which Apache::Upload is a part, is version 1.33. downgrading to Compress::Zlib 1.42 fixed it for me...
On Fri Sep 26 09:25:21 2008, RJOOP wrote: Show quoted text
> my $r = Apache->request; > my $apr = Apache::Request->new ($r); > my $upload = $apr->upload ('logfile'); > my $fh = $upload->fh; > my $fhz = gzopen ($fh, 'rb'); > > dies in the gzopen with "[Fri Sep 26 12:13:04 2008] [error] Can't locate > object method "read" via package "Apache::Upload" at > /usr/lib/perl5/vendor_perl/5.8.5/IO/Uncompress/Base.pm line 68.\n at
[...]" Show quoted text
> > this is within mod_perl. > Apache::Request, of which Apache::Upload is a part, is version 1.33. > > downgrading to Compress::Zlib 1.42 fixed it for me...
Hi Robert, thanks for the bug report. I'll install mod_perl and have a dig. What version of mod_perl are you running? Paul
On Mon Sep 29 06:35:15 2008, PMQS wrote: Show quoted text
> What version of mod_perl are you running?
hi paul, thanks for investigating! it's an apache 1.3.37 with mod_perl compiled in which does not provide this information, but a strings(1) on the binary reveals "mod_perl/1.29".
On Mon Sep 29 09:47:52 2008, RJOOP wrote: Show quoted text
> On Mon Sep 29 06:35:15 2008, PMQS wrote:
> > What version of mod_perl are you running?
> > hi paul, thanks for investigating! > > it's an apache 1.3.37 with mod_perl compiled in which does not provide > this information, but a strings(1) on the binary reveals "mod_perl/1.29".
OK, thanks. I'll see if I can reproduce the error with that version. Paul
On Mon Sep 29 11:13:39 2008, PMQS wrote: Show quoted text
> On Mon Sep 29 09:47:52 2008, RJOOP wrote:
> > On Mon Sep 29 06:35:15 2008, PMQS wrote:
> > > What version of mod_perl are you running?
> > > > hi paul, thanks for investigating! > > > > it's an apache 1.3.37 with mod_perl compiled in which does not provide > > this information, but a strings(1) on the binary reveals
"mod_perl/1.29". Show quoted text
> > OK, thanks. I'll see if I can reproduce the error with that version.
I found some time to check into the problem. Turns out it can be reproduced without using gzopen. For example, this handler is enough to highlight the issue sub handler { my $r = shift; $r->send_http_header('text/plain'); my $apr = Apache::Request->new ($r); my $upload = $apr->upload; my $fh = $upload->fh; my $status = $fh->read($buffer, 20); } It will fail on the $fh->read line. This is because the filehandle that Apache::Request::upload returns does not inherit from IO::Handle. If you add this to the handler @Apache::Upload::ISA = qw(IO::Handle); It sorts out the problem. I'll report this to the Apache::Reader author. cheers Paul
On Sat Oct 04 12:07:09 2008, PMQS wrote: Show quoted text
> On Mon Sep 29 11:13:39 2008, PMQS wrote:
> > On Mon Sep 29 09:47:52 2008, RJOOP wrote:
> > > On Mon Sep 29 06:35:15 2008, PMQS wrote:
> > > > What version of mod_perl are you running?
> > > > > > hi paul, thanks for investigating! > > > > > > it's an apache 1.3.37 with mod_perl compiled in which does not provide > > > this information, but a strings(1) on the binary reveals
> "mod_perl/1.29".
> > > > OK, thanks. I'll see if I can reproduce the error with that version.
> > I found some time to check into the problem. Turns out it can be > reproduced without using gzopen. For example, this handler is enough to > highlight the issue > > sub handler { > my $r = shift; > > $r->send_http_header('text/plain'); > > my $apr = Apache::Request->new ($r); > > my $upload = $apr->upload; > my $fh = $upload->fh; > my $status = $fh->read($buffer, 20); > } > > It will fail on the $fh->read line. > This is because the filehandle that Apache::Request::upload returns does > not inherit from IO::Handle. > > If you add this to the handler > > @Apache::Upload::ISA = qw(IO::Handle); > > It sorts out the problem. > > I'll report this to the Apache::Reader author. > > cheers > Paul >
Alternatively, forcing the $fh into a IO::Handle could also help. Something like this: $fh = IO::Handle->new_from_fd(fileno($fh), "r") unless UNIVERSAL::isa($fh, "IO::Handle"); # or UNIVERSAL::can($fh, "read") Regards, Slaven
On Mon Oct 06 11:37:13 2008, SREZIC wrote: Show quoted text
> On Sat Oct 04 12:07:09 2008, PMQS wrote:
> > On Mon Sep 29 11:13:39 2008, PMQS wrote:
> > > On Mon Sep 29 09:47:52 2008, RJOOP wrote:
> > > > On Mon Sep 29 06:35:15 2008, PMQS wrote:
> > > > > What version of mod_perl are you running?
> > > > > > > > hi paul, thanks for investigating! > > > > > > > > it's an apache 1.3.37 with mod_perl compiled in which does not
provide Show quoted text
> > > > this information, but a strings(1) on the binary reveals
> > "mod_perl/1.29".
> > > > > > OK, thanks. I'll see if I can reproduce the error with that
version. Show quoted text
> > > > I found some time to check into the problem. Turns out it can be > > reproduced without using gzopen. For example, this handler is
enough to Show quoted text
> > highlight the issue > > > > sub handler { > > my $r = shift; > > > > $r->send_http_header('text/plain'); > > > > my $apr = Apache::Request->new ($r); > > > > my $upload = $apr->upload; > > my $fh = $upload->fh; > > my $status = $fh->read($buffer, 20); > > } > > > > It will fail on the $fh->read line. > > This is because the filehandle that Apache::Request::upload returns
does Show quoted text
> > not inherit from IO::Handle. > > > > If you add this to the handler > > > > @Apache::Upload::ISA = qw(IO::Handle); > > > > It sorts out the problem. > > > > I'll report this to the Apache::Reader author. > > > > cheers > > Paul > >
> > Alternatively, forcing the $fh into a IO::Handle could also help. > Something like this: > > $fh = IO::Handle->new_from_fd(fileno($fh), "r") unless > UNIVERSAL::isa($fh, "IO::Handle"); # or UNIVERSAL::can($fh, "read")
Indeed so, and that is the way I would recommend working around the problem until it is fixed. Paul
thank you both for shedding light on this! shall we keep this ticket open till it is resolved one way or another and to let other people easily find the workaround you suggest?
On Tue Oct 07 12:39:33 2008, RJOOP wrote: Show quoted text
> thank you both for shedding light on this! > > shall we keep this ticket open till it is resolved one way or another > and to let other people easily find the workaround you suggest?
I'll let it stay open for a while. Paul