pbzip2 1.1.5 fails to decompress files with trailing garbage

Bug #886625 reported by Jeff Gilchrist on 2011-11-05
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pbzip2
Medium
Yavor Nikolov

Bug Description

Reported in Debian bug system: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=647702

Some files with trailing garbage aren't decompressed correctly (but some are). See original bug link above which includes sample files and steps to reproduce problem.

Changed in pbzip2:
milestone: none → 1.1.7
Changed in pbzip2:
assignee: nobody → Yavor Nikolov (yavor-nikolov)
importance: Undecided → Medium
status: New → In Progress
Changed in pbzip2:
status: In Progress → Fix Committed
Mikolaj Izdebski (zurgunt) wrote :

With the fix applied (revision 31) pbzip2 still fails to decompress some files with trailing garbage, for example:

$ ./pbzip2 -dc <0096509d7693ab0ee2ac54baa1d32fe9.bz2 >/dev/null
pbzip2: *ERROR during BZ2_bzDecompress - trailing garbage: ret=4; block=0; seq=0; isLastInSeq=1; avail_in=252
Terminator thread: premature exit requested - quitting...
$ echo $?
1

The same file is correctly decompressed by bzip2 1.0.5:

$ bzip2 -dcq <0096509d7693ab0ee2ac54baa1d32fe9.bz2 >/dev/null
$ echo $?
0

The file 0096509d7693ab0ee2ac54baa1d32fe9.bz2 is a part of "PROTOS Genome Test Suite c10-archive", which is a test suite for bzip2 (and other archivers). It's available at: http://www.ee.oulu.fi/research/ouspg/protos/testing/c10/archive

(This may be a similar, but different bug though. I didn't analyze the fix from commit 31.)

Yavor Nikolov (yavor-nikolov) wrote :

That sounds like a different bug. I can't find the sample file to reproduce the issue.

I downloaded the c10-archive iso image (c10-archive-r1.iso md5=ff45f18ecf36d8484d5dc1cfb6338c45) a week ago. But I can't
see 0096509d7693ab0ee2ac54baa1d32fe9.bz2 inside.

Yavor Nikolov (yavor-nikolov) wrote :

OK I found that 0096509d7693ab0ee2ac54baa1d32fe9.bz2.
If you want to ignore the trailing garbage with pbzip2 you need --ignore-trailing-garbage option (Or you if you want that behaviour by default - you may compile it with IGNORE_TRAILING_GARBAGE=1)

Mikolaj Izdebski (zurgunt) wrote :

I am perfectly aware of --ignore-trailing-garbage, the IGNORE_TRAILING_GARBAGE macro and that default behavior depends on whether the program is called as "bzip2" or "pbzip2". (My opinion is that --ignore-trailing-garbage should always default to 1.)

I will try to reproduce this later. Probably I forgot to uncomment IGNORE_TRAILING_GARBAGE in Makefile or maybe I gave you the wrong sample. Anyways sorry for the (most likely) false-positive.

BTW, have you tried stressing pbzip2 on "PROTOS Genome"? If so I'd be Interested in the results. If not I will run some tests by myself and give you the results (if you are interested).

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers