Opened 11 years ago

#5898 new Bugs

bzip2_decompressor still does not handle pbzip2-compressed files correctly

Reported by: Andrew.Bromage@… Owned by: Jonathan Turkanis
Milestone: To Be Determined Component: iostreams
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc:

Description

This is an extension of ticket #3853. I believe that the bug was not resolved correctly. In particular, there appears to be a subtle problem which occurs when the boundary between two bz streams falls at precisely the wrong place in the input buffer.

The attached piece of code illustrates the problem. It may be compiled with, say:

g++ testpbzip2.cc -o testpbzip2 -lboost_iostreams -lbz2 ./testpbzip2

The input file (which is inlined in the source file) was created using the following commands:

dd if=/dev/zero of=file bs=1000 count=901 pbzip2 -9 file

The problem was initially found on a real file with the default buffer size of 4096. The smallest example that I've found which exercises the problem at this buffer size is 160kB, and hence not attached to this ticket. It is available on request.

Attachments (1)

testpbzip2.cc (1.6 KB ) - added by Andrew.Bromage@… 11 years ago.
Failing test case

Download all attachments as: .zip

Change History (1)

by Andrew.Bromage@…, 11 years ago

Attachment: testpbzip2.cc added

Failing test case

Note: See TracTickets for help on using tickets.