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
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Type: text/plain
Charset: utf8
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 505
Download (untitled) / with headers
text/plain 505b
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...
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Disposition: inline
Charset: utf8
Message-Id: <rt-3.6.HEAD-4420-1222684514-1513.39629-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 702
Download (untitled) / with headers
text/plain 702b
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
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-4420-1222684514-1513.39629-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Disposition: inline
Charset: utf8
References: <rt-3.6.HEAD-4420-1222684514-1513.39629-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.6.HEAD-4413-1222696072-1252.39629-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 267
Download (untitled) / with headers
text/plain 267b
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".
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-4413-1222696072-1252.39629-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Disposition: inline
Charset: utf8
References: <rt-3.6.HEAD-4420-1222684514-1513.39629-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-4413-1222696072-1252.39629-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.6.HEAD-4420-1222701219-460.39629-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 398
Download (untitled) / with headers
text/plain 398b
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
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-4420-1222701219-460.39629-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Disposition: inline
Charset: utf8
References: <rt-3.6.HEAD-4420-1222684514-1513.39629-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-4413-1222696072-1252.39629-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-4420-1222701219-460.39629-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.6.HEAD-4226-1223136429-1980.39629-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1123
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
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-4226-1223136429-1980.39629-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Disposition: inline
Charset: utf8
References: <rt-3.6.HEAD-4420-1222684514-1513.39629-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-4413-1222696072-1252.39629-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-4420-1222701219-460.39629-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-4226-1223136429-1980.39629-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.6.HEAD-4226-1223307433-1042.39629-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1489
Download (untitled) / with headers
text/plain 1.4k
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
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-4226-1223307433-1042.39629-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Disposition: inline
Charset: utf8
References: <rt-3.6.HEAD-4420-1222684514-1513.39629-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-4413-1222696072-1252.39629-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-4420-1222701219-460.39629-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-4226-1223136429-1980.39629-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-4226-1223307433-1042.39629-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.6.HEAD-27688-1223364055-453.39629-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1719
Download (untitled) / with headers
text/plain 1.6k
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
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-27688-1223364055-453.39629-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Disposition: inline
Charset: utf8
References: <rt-3.6.HEAD-4420-1222684514-1513.39629-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-4413-1222696072-1252.39629-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-4420-1222701219-460.39629-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-4226-1223136429-1980.39629-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-4226-1223307433-1042.39629-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-27688-1223364055-453.39629-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.6.HEAD-27688-1223397573-352.39629-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 177
Download (untitled) / with headers
text/plain 177b
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?
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-27688-1223397573-352.39629-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Disposition: inline
Charset: utf8
References: <rt-3.6.HEAD-4420-1222684514-1513.39629-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-4413-1222696072-1252.39629-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-4420-1222701219-460.39629-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-4226-1223136429-1980.39629-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-4226-1223307433-1042.39629-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-27688-1223364055-453.39629-0-0 [...] rt.cpan.org> <rt-3.6.HEAD-27688-1223397573-352.39629-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.6.HEAD-27678-1223455323-1296.39629-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 270
Download (untitled) / with headers
text/plain 270b
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


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.