[cl-bzip2-devel] Bug with certain file sizes

Robert Smith quadricode at gmail.com
Thu Jun 14 00:20:39 UTC 2012


Hello:

I seem to be getting an issue with compression and decompression of 
certain sized files. I am on Windows using LispWorks 5.1.

After a tedious bit of analysis, CL-BZIP2 seems to be erroring when it 
either compresses an exact multiple of 2^12 = 4096 bytes, or 
decompresses an exact multiple of 4096 bytes.

This value coincides with the *INPUT-CHUNK-SIZE* and the 
*OUTPUT-CHUNK-SIZE*, so I assume that has something to do with it.

My test case is not minimal at all and I can't easily transmit it. The 
general premise is that I serialize hash tables of varying elements and 
size repeatedly and compress+decompress them.

Upon serializing a table and compressing it, I get

Error in function BZ2_bzCompress: BZ_PARAM_ERROR (-2)

The file being compressed is 4096 bytes. This error came up with the 
following other file sizes: 12288, 24576, 28672, 40960

The GCD of these numbers is 2^12. I have looked at the code but can't 
seem to find the bug.

Any ideas?


Robert Smith
www.symbo1ics.com/blog




More information about the cl-bzip2-devel mailing list