Menu

#19 Dictzip does not check fwrite() errors

runtime_error
closed-fixed
dictzip (2)
5
2012-07-22
2011-08-12
No

I do not recommend to use the dictzip binary on a full disk.
The dictzip code does not check for fwrite() errors.
Maybe it can create invalid archives.

How to reproduce:
dd if=/dev/zero bs=1M count=10 of=test.space
mkfs.ext4 test.space
mkdir point
sudo mount -o loop test.space point
ln -s /dev/urandom point/urandom
dictzip -k point/urandom

Seen error:
*** glibc detected *** dictzip: munmap_chunk(): invalid pointer: 0x0000000001e0cb60 ***
Segmentation fault

Discussion

  • Ivo Danihelka

    Ivo Danihelka - 2011-08-13

    The compressing of /dev/urandom is a bad example. It fails even when having enough of free disk space.

    Use a symlink to a big file instead.
    The dictzip quietly creates an incomplete archive. The dictzip exit status signals success: 0. The created archive has "unexpected end of file" problem when trying to unpack it.

     
  • Aleksey Cheusov

    Aleksey Cheusov - 2011-08-26
    • status: open --> open-accepted
     
  • Aleksey Cheusov

    Aleksey Cheusov - 2012-07-22

    Fixed. Thank you for your report!

     
  • Aleksey Cheusov

    Aleksey Cheusov - 2012-07-22
    • status: open-accepted --> closed-fixed
     
MongoDB Logo MongoDB