Skip Menu |

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

Report information
The Basics
Id: 48711
Status: resolved
Priority: 0/
Queue: IO-Compress

People
Owner: Nobody in particular
Requestors: felix.ostmann [...] thewar.de
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 2.020
Fixed in: (no value)



Subject: rawinflate did the job, but return undef and set $!
perl -MIO::Uncompress::RawInflate=rawinflate -e '$/=undef;my $d=<>;rawinflate(\$d,\my $s) or warn($!); print $s;' < /tmp/io-uncompress-error.packed This will produce a warning but $s is the correct string?!?! Last time i investigate a problem in base will raise this. i attached the io-uncompress-error.packed
Subject: io-uncompress-error.packed
Download io-uncompress-error.packed
application/octet-stream 881b

Message body not shown because it is not plain text.

On Fri Aug 14 10:01:46 2009, Sadrak wrote: Show quoted text
> perl -MIO::Uncompress::RawInflate=rawinflate -e '$/=undef;my > $d=<>;rawinflate(\$d,\my $s) or warn($!); print $s;' < > /tmp/io-uncompress-error.packed > > This will produce a warning but $s is the correct string?!?! Last time i > investigate a problem in base will raise this. > > i attached the io-uncompress-error.packed
Hi Felix, I ran your one-liner and it didn't produce any warning. I'm not clear from your report whether you expect to get an eror or not. Can you tell me in more detail what your problem is? When I run your script like this (note the use of Transparent => 0) $ perl -MIO::Uncompress::RawInflate=:all -e 'rawinflate("-", \my $s, Transparent => 0) or die("Error is $RawInflateError\n"); print $s;' <io-uncompress-error.packed I get this error Error is unexpected end of file By default when rawinflate cannot uncompress the input it will just send the input to the output. The Transparent option controls that behaviour. Paul
From: felix.ostmann [...] thewar.de
Sorry for not answering ... i used a hack and did not see your answer. Problem still active. I am on x86_64 / perl5.10.1 and get a "unexpected end of file" from IO::Uncompress::Base.pm line ~788 ->smartRead return 0, but i cannot see why. only thing i see, he enter readBlock 2 times and the result is uncompressed (ok), but i got this error. ... i go to smartRead and checked $$buf, $$out and BufferOffset. The last run (befor throwing error), length($$bug) == *$self->{BufferOffset} ... i am confused. I dont understand what to debug :-/ I think he dont realize he is done (calling smartRead with nothing todo), but cannot find whats wrong :-/
On Fri Apr 16 09:58:20 2010, Sadrak wrote: Show quoted text
> Sorry for not answering ... i used a hack and did not see your answer. > > Problem still active. > > I am on x86_64 / perl5.10.1 and get a "unexpected end of file" from > IO::Uncompress::Base.pm line ~788 > > ->smartRead return 0, but i cannot see why. > > only thing i see, he enter readBlock 2 times and the result is > uncompressed (ok), but i got this error. > > ... > > i go to smartRead and checked $$buf, $$out and BufferOffset. > The last run (befor throwing error), length($$bug) == > *$self->{BufferOffset} ... > > i am confused. I dont understand what to debug :-/ I think he dont > realize he is done (calling smartRead with nothing todo), but cannot > find whats wrong :-/ >
Thanks for getting back to me. I had another look at the data file you provided and it is missing a single byte at the end of the file. That would account for the "unexpected end of file" error you are getting. The byte missing is used to flag the end of the compressed data stream, it doen't contain any compressed data - that accounts for you getting the correct uncompressed data output and the "unexpected end of file" error. How was the io-uncompress-error.packed created? It wasn't created by a C or C++ program by any chance? Paul
From: felix.ostmann [...] thewar.de
OK, thanks! I cant remember how i compressed that ... and: i dont get an error with that file anymore! Here i provide another file, can you check if there is something missing? Only with that file i get the error. Its from a services called DCHK from DeNIC ... perhaps they produce broken compressions :-/ Am Fr 16. Apr 2010, 11:08:31, PMQS schrieb: Show quoted text
> On Fri Apr 16 09:58:20 2010, Sadrak wrote:
> > Sorry for not answering ... i used a hack and did not see your answer. > > > > Problem still active. > > > > I am on x86_64 / perl5.10.1 and get a "unexpected end of file" from > > IO::Uncompress::Base.pm line ~788 > > > > ->smartRead return 0, but i cannot see why. > > > > only thing i see, he enter readBlock 2 times and the result is > > uncompressed (ok), but i got this error. > > > > ... > > > > i go to smartRead and checked $$buf, $$out and BufferOffset. > > The last run (befor throwing error), length($$bug) == > > *$self->{BufferOffset} ... > > > > i am confused. I dont understand what to debug :-/ I think he dont > > realize he is done (calling smartRead with nothing todo), but cannot > > find whats wrong :-/ > >
> > Thanks for getting back to me. > > I had another look at the data file you provided and it is missing a > single byte at the end of the file. That would account for > the "unexpected end of file" error you are getting. The byte missing is > used to flag the end of the compressed data stream, it doen't contain > any compressed data - that accounts for you getting the correct > uncompressed data output and the "unexpected end of file" error. > > How was the io-uncompress-error.packed created? It wasn't created by a > C or C++ program by any chance? > > Paul
Subject: io-uncompress-error2.packed
Download io-uncompress-error2.packed
application/octet-stream 453b

Message body not shown because it is not plain text.

On Fri Apr 16 11:52:42 2010, Sadrak wrote: Show quoted text
> OK, thanks! > > I cant remember how i compressed that ... > > and: i dont get an error with that file anymore! > > Here i provide another file, can you check if there is something > missing? Only with that file i get the error.
I checked the new file you posted, and it is missing a single trailing null byte, just like the first one you posted. I also recompressed both your files myself using rawdeflate and the compressed output is byte for byte identical, apart from the the trailing null byte that mine have. Show quoted text
> Its from a services called DCHK from DeNIC ... perhaps they produce > broken compressions :-/
I'd be surprised if they missed that last byte, but you never know. Can you explain what is involved in you getting the files you posted. Have you written any code yourself to fetch the content, or is it all handled by another application? Paul
From: felix.ostmann [...] thewar.de
Am Sa 17. Apr 2010, 07:27:01, PMQS schrieb: Show quoted text
> On Fri Apr 16 11:52:42 2010, Sadrak wrote:
> > OK, thanks! > > > > I cant remember how i compressed that ... > > > > and: i dont get an error with that file anymore! > > > > Here i provide another file, can you check if there is something > > missing? Only with that file i get the error.
> > I checked the new file you posted, and it is missing a single trailing > null byte, just like the first one you posted. > > I also recompressed both your files myself using rawdeflate and the > compressed output is byte for byte identical, apart from the the > trailing null byte that mine have. >
> > Its from a services called DCHK from DeNIC ... perhaps they produce > > broken compressions :-/
> > I'd be surprised if they missed that last byte, but you never know. Can > you explain what is involved in you getting the files you posted. Have > you written any code yourself to fetch the content, or is it all handled > by another application? > > Paul
The service used UDP and i use IO::AIO to fetch the data ... perhaps there is a bug with a trailing zero byte ... i will ask the author in irc, perhaps he can explain the missing byte. Also i will write to DeNIC. But i think this bug is not your problem :) Thanks for your help!
On Sat Apr 17 15:51:17 2010, Sadrak wrote: Show quoted text
> Am Sa 17. Apr 2010, 07:27:01, PMQS schrieb:
> > On Fri Apr 16 11:52:42 2010, Sadrak wrote:
> > > OK, thanks! > > > > > > I cant remember how i compressed that ... > > > > > > and: i dont get an error with that file anymore! > > > > > > Here i provide another file, can you check if there is something > > > missing? Only with that file i get the error.
> > > > I checked the new file you posted, and it is missing a single trailing > > null byte, just like the first one you posted. > > > > I also recompressed both your files myself using rawdeflate and the > > compressed output is byte for byte identical, apart from the the > > trailing null byte that mine have. > >
> > > Its from a services called DCHK from DeNIC ... perhaps they produce > > > broken compressions :-/
> > > > I'd be surprised if they missed that last byte, but you never know. Can > > you explain what is involved in you getting the files you posted. Have > > you written any code yourself to fetch the content, or is it all handled > > by another application? > > > > Paul
> > The service used UDP and i use IO::AIO to fetch the data ... perhaps > there is a bug with a trailing zero byte ... i will ask the author in > irc, perhaps he can explain the missing byte. Also i will write to > DeNIC. But i think this bug is not your problem :) Thanks for your help!
No problem. Please get back to me if you need any more help with this. Paul