Menu

#18 dictunzip fails on multiples of chunkLength

runtime_error
closed-fixed
dictzip (2)
5
2011-01-08
2010-10-30
No

I noticed a bug in dictzip uncompressing.
It fails when the size of the original non-compressed file is a multiple of chunkLength (58315 bytes).

Examples of produced errors:
{{{
$ dictunzip one_chunk.txt.dz
dictunzip (dict_data_read_): Internal error
h->chunks[1] = 2520048 >= 65535 (OUT_BUFFER_SIZE)
Aborting dictunzip...
Aborted
$ dictunzip two_chunks.txt.dz
dictunzip (dict_data_read_): inflate: (null)
}}}

The suspicious code is in dict_data_read_().
The lastChunk should be computed as: (start + size - 1) / chunkLength
See the attached patch.

A workaround is to use gzip to extract the files.

Discussion

  • Ivo Danihelka

    Ivo Danihelka - 2010-10-30

    Patch to fix lastChunk computation.

     
  • Aleksey Cheusov

    Aleksey Cheusov - 2011-01-08

    I've applied your patch and created regression tests for dictzip.
    Thank you for your report!

     
  • Aleksey Cheusov

    Aleksey Cheusov - 2011-01-08
    • status: open --> closed-fixed
     
MongoDB Logo MongoDB