[bug] cygwin-1.5.6-1: corruption on tar | bzip2 > file.tar.bz2 RESOLVED

Ilya Pobelov pobelov@mail.ru
Mon Jan 26 11:23:00 GMT 2004


Christopher Faylor wrote on 25.01.2004 18:05:

> If I were you, I would be comparing the difference between the working
> and non-working cases, like is the file size different?  

Thank you very much for a good question, it really helps to resolve my 
issue. The problem seems to be in <LF> -> <CR><LF> (0A -> 0D 0A) 
convertion in pipe after bzip2, which occurs _only if_ option "Default 
Text File Type" = Dos. I didn't test any other utilities except cat, 
when it doesn't happend (=everything fine).
Here is illustration.

Non-working (fresh install, current version, almost minimal, 
cygwin-1.5.6-1).
With option "Default Text File Type" = Dos

$ bzip2 -kv gawk.info
   gawk.info:  4.508:1,  1.774 bits/byte, 77.82% saved, 980691 in, 
217521 out.
$ bzip2 -tv gawk.info.bz2
   gawk.info.bz2: ok
$ mv gawk.info.bz2 gawk.info.bz2-correct
$ cat gawk.info | bzip2 -v > gawk.info.bz2
   (stdin):  4.508:1,  1.774 bits/byte, 77.82% saved, 980691 in, 217521 out.
$ bzip2 -tv gawk.info.bz2
   gawk.info.bz2: data integrity (CRC) error in data

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

$ mv gawk.info.bz2 gawk.info.bz2-broken
$ ls -1s --block=1 gawk.info.bz2*
219136 gawk.info.bz2-broken
218112 gawk.info.bz2-correct

After comparison of gawk.info.bz2-correct and gawk.info.bz2-broken I 
found, that all 0A entries in correct file changed to 0D 0A are corrupted.


Same installation with option "Default Text File Type" = Unix

$ bzip2 -kv gawk.info
   gawk.info:  4.508:1,  1.774 bits/byte, 77.82% saved, 980691 in, 
217521 out.
$ bzip2 -tv gawk.info.bz2
   gawk.info.bz2: ok
$ mv gawk.info.bz2 gawk.info.bz2-correct
$ cat gawk.info | bzip2 -v > gawk.info.bz2
   (stdin):  4.508:1,  1.774 bits/byte, 77.82% saved, 980691 in, 217521 out.
$ bzip2 -tv gawk.info.bz2
   gawk.info.bz2: ok
$ mv gawk.info.bz2 gawk.info.bz2-piped
$ ls -1s --block=1 gawk.info.bz2*
218112 gawk.info.bz2-correct
218112 gawk.info.bz2-piped
$ diff gawk.info.bz2-correct gawk.info.bz2-piped
$


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list