-
Notifications
You must be signed in to change notification settings - Fork 88
Description
I have several large lzr files that I am unable to decompress. Every time I get the same error message:
Failed to decompress buffer - lzmaerr=6
I have been able to reproduce with a simple script that uses zero byte files and large duplications. Please note that my failing lzr archives do not have zero filled files but they do have very large files that are duplicated (for various reasons not in my control). I was of course using lrzip since this gives wildly good compression for my use case.
Script to reproduce:
#!/bin/bash
fallocate -l $((1*1024*1024)) test1a.dat
# WORKS if slightly less than 3gb:
#fallocate -l $((3*1024*1024*1024 - 1024)) test2a.dat
# Fails if 3gb or more:
fallocate -l $((3*1024*1024*1024)) test2a.dat
# Duplicate 2nd file exactly
cp --reflink=always test2a.dat test2b.dat
# Create zip sorted so duplicates are close:
tar cvf test.tar --sort=name test*.dat
# Compress never fails, however decompress below fails if we include '-p 1'
lrzip -p 1 test.tar
# Fails with "Failed to decompress buffer - lzmaerr=6"
lrzip -t test.tar.lrz
The same failure can be achieved if the file is filled with /dev/urandom too, but takes considerably more time. Also, unsure if the -p 1 is always required or just in this reproducable case, since I have seen my real lrz files fail with cases where there were no 3gb duplications and compression was done without that flag.
Output when I run the scripts above:
+ fallocate -l 1048576 test1a.dat
+ fallocate -l 3221225472 test2a.dat
+ cp --reflink=always test2a.dat test2b.dat
+ tar cvf test.tar --sort=name test1a.dat test2a.dat test2b.dat
test1a.dat
test2a.dat
test2b.dat
+ lrzip -p 1 test.tar
Output filename is: test.tar.lrz
test.tar - Compression Ratio: 10668.734. Average Compression Speed: 46.553MB/s.
Total time: 00:02:11.92
+ lrzip -t test.tar.lrz
Decompressing...
Failed to decompress buffer - lzmaerr=6
Failed to decompress buffer - lzmaerr=6
Failed to decompress in ucompthread
Fatal error - exiting
Machine used:
- Up to date Arch Linux
- 64gb RAM, AMD Ryzen 7 5825U
- Kernel: 6.13.7-arch1-1
- lrzip 0.651-3 (from Arch Extra repo)