Discussion:
[BusyBox] busybox gzip problem: crc error
Chang, Shu-Hao
2003-07-19 13:33:25 UTC
Permalink
Hi,

When use busybox gzip to decompress this crc_err_sample.gz ,
I got following messgage.

gzip: invalid compressed data--crc error
gzip: invalid compressed data--length error

This file is OK when use gzip-1.2.4a in my RedHat box.
I trace the code in busybox. It seems busybox gzip read
the crc from wrong position(lost the first byte).

I can not fix this problem. Help please.

-- shuhao Nov 28, 2001
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crc_err_sample.gz
Type: application/x-gzip
Size: 197 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20011127/06485d3d/crc_err_sample.bin
Glenn McGrath
2003-07-19 13:33:25 UTC
Permalink
On Wed, 28 Nov 2001 11:48:58 +0800
Post by Chang, Shu-Hao
Hi,
When use busybox gzip to decompress this crc_err_sample.gz ,
I got following messgage.
gzip: invalid compressed data--crc error
gzip: invalid compressed data--length error
This file is OK when use gzip-1.2.4a in my RedHat box.
I trace the code in busybox. It seems busybox gzip read
the crc from wrong position(lost the first byte).
I can not fix this problem. Help please.
busybox gunzip does work with other gzipped files.

How did you create the file, did you use the normal gzip, any special
options ?



Glenn
Chang, Shu-Hao
2003-07-19 13:33:25 UTC
Permalink
I use normal gzip without any option.

This sample get crc error message even it is compressed by busybox gzip.
But the content is correct (ie decompress correctlly)

$ busybox-0.60.2/busybox gzip crc_err_sample
$ busybox-0.60.2/busybox gzip -d crc_err_sample.gz
gzip: invalid compressed data--crc error
gzip: invalid compressed data--length error

I use gzsample.cc to generate 8192 sample files, about 103 files has this
problem.

-- shuhao Nov 29, 2001

----- Original Message -----
From: "Glenn McGrath" <***@optushome.com.au>
To: "Chang, Shu-Hao" <***@trend.com.tw>
Cc: <***@busybox.net>
Sent: Wednesday, November 28, 2001 6:18 PM
Subject: Re: [BusyBox] busybox gzip problem: crc error
Post by Glenn McGrath
On Wed, 28 Nov 2001 11:48:58 +0800
Post by Chang, Shu-Hao
Hi,
When use busybox gzip to decompress this crc_err_sample.gz ,
I got following messgage.
gzip: invalid compressed data--crc error
gzip: invalid compressed data--length error
This file is OK when use gzip-1.2.4a in my RedHat box.
I trace the code in busybox. It seems busybox gzip read
the crc from wrong position(lost the first byte).
I can not fix this problem. Help please.
busybox gunzip does work with other gzipped files.
How did you create the file, did you use the normal gzip, any special
options ?
Glenn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gzsample.cc
Type: application/octet-stream
Size: 660 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20011128/69574e24/gzsample.obj
Chang, Shu-Hao
2001-11-29 01:52:39 UTC
Permalink
I use normal gzip without any option.

This sample get crc error message even it is compressed by busybox gzip.
But the content is correct (ie decompress correctlly)

$ busybox-0.60.2/busybox gzip crc_err_sample
$ busybox-0.60.2/busybox gzip -d crc_err_sample.gz
gzip: invalid compressed data--crc error
gzip: invalid compressed data--length error

I use gzsample.cc to generate 8192 sample files, about 103 files has this
problem.

-- shuhao Nov 29, 2001

----- Original Message -----
From: "Glenn McGrath" <bug1 at optushome.com.au>
To: "Chang, Shu-Hao" <shuhao_chang at trend.com.tw>
Cc: <busybox at busybox.net>
Sent: Wednesday, November 28, 2001 6:18 PM
Subject: Re: [BusyBox] busybox gzip problem: crc error
Post by Glenn McGrath
On Wed, 28 Nov 2001 11:48:58 +0800
Post by Chang, Shu-Hao
Hi,
When use busybox gzip to decompress this crc_err_sample.gz ,
I got following messgage.
gzip: invalid compressed data--crc error
gzip: invalid compressed data--length error
This file is OK when use gzip-1.2.4a in my RedHat box.
I trace the code in busybox. It seems busybox gzip read
the crc from wrong position(lost the first byte).
I can not fix this problem. Help please.
busybox gunzip does work with other gzipped files.
How did you create the file, did you use the normal gzip, any special
options ?
Glenn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gzsample.cc
Type: application/octet-stream
Size: 660 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20011128/69574e24/attachment.obj
Glenn McGrath
2003-07-19 13:33:25 UTC
Permalink
On Wed, 28 Nov 2001 11:48:58 +0800
Post by Chang, Shu-Hao
I trace the code in busybox. It seems busybox gzip read
the crc from wrong position(lost the first byte).
Yes i agree with this, it looks like inflate_block() is reading one
extra char somewhere which results in a short read on the crc/length
block, only 7 of 8 bytes are being read, a manual check of the values
starting 1 byte earlier agrees with what busybox reports the crc and
length should be based on data processed.

Strangely, the file still extracts with the correct size and md5sum, i
guess somewhere in the compressed data there is must be some filler to
round the data to a nice size.


Glenn
Glenn McGrath
2003-07-19 13:33:26 UTC
Permalink
On Wed, 28 Nov 2001 11:48:58 +0800
Post by Chang, Shu-Hao
Hi,
When use busybox gzip to decompress this crc_err_sample.gz ,
I got following messgage.
gzip: invalid compressed data--crc error
gzip: invalid compressed data--length error
looks like i introduced this bug in busybox v0.51 gunzip v1.40 during a
big cleanup i did in unwinding a heap of macros :(


Glenn
Glenn McGrath
2003-07-19 13:33:26 UTC
Permalink
On Wed, 28 Nov 2001 11:48:58 +0800
Post by Chang, Shu-Hao
Hi,
When use busybox gzip to decompress this crc_err_sample.gz ,
I got following messgage.
gzip: invalid compressed data--crc error
gzip: invalid compressed data--length error
Ive commited a fix to CVS, it works with the file you sent me.

If ive done the code correctly that extracts bytes from the bitbuffer if
should fix it for all cases.

Good job finding this bug, spelt your name wrong in the comment for the
entry, sorry.



Glenn
Chang, Shu-Hao
2001-11-28 03:17:56 UTC
Permalink
Hi,

When use busybox gzip to decompress this crc_err_sample.gz ,
I got following messgage.

gzip: invalid compressed data--crc error
gzip: invalid compressed data--length error

This file is OK when use gzip-1.2.4a in my RedHat box.
I trace the code in busybox. It seems busybox gzip read
the crc from wrong position(lost the first byte).

I can not fix this problem. Help please.

-- shuhao Nov 28, 2001
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crc_err_sample.gz
Type: application/x-gzip
Size: 197 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20011127/06485d3d/attachment.bin
Glenn McGrath
2001-11-28 09:21:09 UTC
Permalink
On Wed, 28 Nov 2001 11:48:58 +0800
Post by Chang, Shu-Hao
Hi,
When use busybox gzip to decompress this crc_err_sample.gz ,
I got following messgage.
gzip: invalid compressed data--crc error
gzip: invalid compressed data--length error
This file is OK when use gzip-1.2.4a in my RedHat box.
I trace the code in busybox. It seems busybox gzip read
the crc from wrong position(lost the first byte).
I can not fix this problem. Help please.
busybox gunzip does work with other gzipped files.

How did you create the file, did you use the normal gzip, any special
options ?



Glenn
Glenn McGrath
2001-11-29 03:12:02 UTC
Permalink
On Wed, 28 Nov 2001 11:48:58 +0800
Post by Chang, Shu-Hao
I trace the code in busybox. It seems busybox gzip read
the crc from wrong position(lost the first byte).
Yes i agree with this, it looks like inflate_block() is reading one
extra char somewhere which results in a short read on the crc/length
block, only 7 of 8 bytes are being read, a manual check of the values
starting 1 byte earlier agrees with what busybox reports the crc and
length should be based on data processed.

Strangely, the file still extracts with the correct size and md5sum, i
guess somewhere in the compressed data there is must be some filler to
round the data to a nice size.


Glenn
Glenn McGrath
2001-11-29 04:09:46 UTC
Permalink
On Wed, 28 Nov 2001 11:48:58 +0800
Post by Chang, Shu-Hao
Hi,
When use busybox gzip to decompress this crc_err_sample.gz ,
I got following messgage.
gzip: invalid compressed data--crc error
gzip: invalid compressed data--length error
looks like i introduced this bug in busybox v0.51 gunzip v1.40 during a
big cleanup i did in unwinding a heap of macros :(


Glenn
Glenn McGrath
2001-11-29 05:42:56 UTC
Permalink
On Wed, 28 Nov 2001 11:48:58 +0800
Post by Chang, Shu-Hao
Hi,
When use busybox gzip to decompress this crc_err_sample.gz ,
I got following messgage.
gzip: invalid compressed data--crc error
gzip: invalid compressed data--length error
Ive commited a fix to CVS, it works with the file you sent me.

If ive done the code correctly that extracts bytes from the bitbuffer if
should fix it for all cases.

Good job finding this bug, spelt your name wrong in the comment for the
entry, sorry.



Glenn

Loading...