pete4abw / lrzip-next

Long Range Zip. Updated and Enhanced version of ckolivas' lrzip project. Lots of new features. Better compression. Actively maintained.

Home Page:https://github.com/pete4abw/lrzip-next

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

:lady_beetle: zstd compression fails when all blocks are incompressible

pete4abw opened this issue · comments

lrzip-next Version

0.12.4

lrzip-next command line

lrzip-next -ZL9 -T incompressible_file

What happened?

When all file blocks are incompressible, lrzip-next will fail with this message:

Thread 1: zstd compress failed
Failed to compress in compthread
Deleting broken file ZS100V12.bin.lrz
Fatal error - exiting

This only occurs if the -T option is used to bypass compressibility testing.

What was expected behavior?

lrzip-next run will complete as normal

Steps to reproduce

  1. Create an incompressible file (or nearly so)
  2. Run lrzip-next -Z -T file

Relevant log output

Thread 1: zstd compress failed
Unable to compress in parallel, waiting for previous thread to complete before trying again
Starting zstd backend compression thread 1. Using zstd compression level 22, btultra2 strategy
Thread 2: zstd compress failed
Thread 5: zstd compress failed
Thread 4: zstd compress failed
Thread 3: zstd compress failed
Thread 6: zstd compress failed
Thread 1: zstd compress failed
Failed to compress in compthread
Deleting broken file ZS100V12.bin.lrz
Fatal error - exiting

Please provide system details

OS Distro: Debian 12
Kernel Version (uname -a): 6.1.69
System ram (free -h): lots

Additional Context

The error is misuse of ZSTD_isError function and reading error codes. This results in an incorrect failure code sent to the compressthread() function. Will fix for the next version.

Fixed v0.12.5