[Bug 1169677] [NEW] bzip2recover (v.1.0.6) creates wrong headers (of rec* files)

Aleks-ger aleks at physik.tu-berlin.de
Tue Apr 16 18:43:20 UTC 2013


Public bug reported:

I found a bug in bzip2recover 1.0.6.

Assume you have a huge (2 GB) perfect myfile.bz2.
Using bzip2recover myfile.bz2 gives rec00001myfile.bz2 (and more files rec*.bz2).
The fourth Header Byte is always wrong, see below!
It seems to have low effect, but confused me understandig the file-format,
while writing a tool for 'healing' bad downloaded huge bz2-files.
The 4th byte in header wrong, for sure.

WHAT I MADE:
$ head -c 8 myfile.bz2
BZh11AY&
$ file myfile.bz2
myfile.bz2: bzip2 compressed data, block size = 100k
$ file rec00001myfile.bz2
rec00001rec00001saarpart.bz2: bzip2 compressed data, block size = 900k
$ head -c 8 rec00001myfile.bz2
BZh91AY&
$ bunzip2 rec00001myfile.bz2 ; ls -l rec00001myfile
-rw------- 1 me None 99938 15. Apr 19:00 rec00001myfile

This is close to 100,000 Byte, which is idicated by block size = 100k.
It would be right to use the original Header, not constant "BZh9".
Please comment on that.

MY SYSTEM:
$ bzip2recover --version
bzip2recover 1.0.6: extracts blocks from damaged .bz2 files.
$ bzip2 -V
bzip2, a block-sorting file compressor.  Version 1.0.6, 6-Sept-2010.
$ cat /proc/version
Linux version 3.2.0-39-generic (buildd at lamiak) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #62-Ubuntu SMP Thu Feb 28 00:28:53 UTC 2013

also checked on Cygwin, same result
$ cat /proc/version
CYGWIN_NT-6.1-WOW64 version 1.7.17(0.262/5/3)
(corinna at calimero.vinschen.de) (gcc version 4.5.3 20110428 (Fedora Cygwin
4.5.3-4) (GCC) ) 2012-10-19 14:39

** Affects: bzip2 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to bzip2 in Ubuntu.
https://bugs.launchpad.net/bugs/1169677

Title:
  bzip2recover (v.1.0.6) creates wrong headers (of rec* files)

Status in “bzip2” package in Ubuntu:
  New

Bug description:
  I found a bug in bzip2recover 1.0.6.

  Assume you have a huge (2 GB) perfect myfile.bz2.
  Using bzip2recover myfile.bz2 gives rec00001myfile.bz2 (and more files rec*.bz2).
  The fourth Header Byte is always wrong, see below!
  It seems to have low effect, but confused me understandig the file-format,
  while writing a tool for 'healing' bad downloaded huge bz2-files.
  The 4th byte in header wrong, for sure.

  WHAT I MADE:
  $ head -c 8 myfile.bz2
  BZh11AY&
  $ file myfile.bz2
  myfile.bz2: bzip2 compressed data, block size = 100k
  $ file rec00001myfile.bz2
  rec00001rec00001saarpart.bz2: bzip2 compressed data, block size = 900k
  $ head -c 8 rec00001myfile.bz2
  BZh91AY&
  $ bunzip2 rec00001myfile.bz2 ; ls -l rec00001myfile
  -rw------- 1 me None 99938 15. Apr 19:00 rec00001myfile

  This is close to 100,000 Byte, which is idicated by block size = 100k.
  It would be right to use the original Header, not constant "BZh9".
  Please comment on that.

  MY SYSTEM:
  $ bzip2recover --version
  bzip2recover 1.0.6: extracts blocks from damaged .bz2 files.
  $ bzip2 -V
  bzip2, a block-sorting file compressor.  Version 1.0.6, 6-Sept-2010.
  $ cat /proc/version
  Linux version 3.2.0-39-generic (buildd at lamiak) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #62-Ubuntu SMP Thu Feb 28 00:28:53 UTC 2013

  also checked on Cygwin, same result
  $ cat /proc/version
  CYGWIN_NT-6.1-WOW64 version 1.7.17(0.262/5/3)
  (corinna at calimero.vinschen.de) (gcc version 4.5.3 20110428 (Fedora Cygwin
  4.5.3-4) (GCC) ) 2012-10-19 14:39

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bzip2/+bug/1169677/+subscriptions




More information about the foundations-bugs mailing list