pbzip2 1.1.x hangs when decompressing certain truncated archives

Bug #590225 reported by Yavor Nikolov on 2010-06-05
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Status tracked in Trunk
Yavor Nikolov
Yavor Nikolov

Bug Description

On attempt to decompress some truncated bz2 archives (sample one to be attached) pbzip2 1.1.x hangs. E.g. - following hangs at 67%:

pbzip2 -d -v -k -f trunctest1.bz2
Parallel BZIP2 v1.1.2b3 - by: Jeff Gilchrist [http://compression.ca]
[May. 20, 2010] (uses libbzip2 by Julian Seward)
Major contributions: Yavor Nikolov <email address hidden>

         # CPUs: 2
 Maximum Memory: 100 MB
         File #: 1 of 1
     Input Name: trunctest1.bz2
    Output Name: trunctest1

 BWT Block Size: 400k
     Input Size: 2355200 bytes
Decompressing data...
^Cmpleted: 67%
 *Control-C or similar caught [sig=2], quitting...
Terminator thread: premature exit requested - quitting...
Cleanup unfinished work [Outfile: trunctest1]...
Deleting output file: trunctest1, if it exists...
pbzip2: *INFO: Deletion of output file succeeded.

pbzip2-2 port doesn't hang but finishes without any error messages silently ignoring the fact archive is invalid since has been truncated.

Yavor Nikolov (yavor-nikolov) wrote :
Yavor Nikolov (yavor-nikolov) wrote :

Issue has been identified following condition after decompress should trigger an error:
( (bzret != BZ_STREAM_END) && fileData->isLastInSequence )
since it indicates premature input truncation.

Changed in pbzip2:
status: New → In Progress
assignee: nobody → Yavor Nikolov (javor-nikolov)
Yavor Nikolov (yavor-nikolov) wrote :

I manage to fix the bug - attaching patch for it.

Changed in pbzip2:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers