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: lrzip-next fails when using -t option in write-protected dir

pete4abw opened this issue · comments

lrzip-next Version

0.9.1

lrzip-next command line

lrzip-next -t file.lrz

What happened?

This is a low-probability bug. When running lrzip-next -t on a file and the user is in a write-protected directory, lrzip-next will fail: This happens whether or not file.lrz is in the write-protected dir, or a non-write-protected dir. If TMP variable is NOT set, the temporary file lrzip-next tries to create will fail in the current dir.

WARNING: Failed to create out tmpfile: ./lrzipout.4GQLS0, will fail if cannot perform compression entirely in ram
Detected lrzip version 0.9.1 file.
MD5 being used for integrity testing.
Decompressing...
Failed to write literal buffer of size 339
Bad file descriptor
Fatal error - exiting

Even though the warning indicates a temp file may not be necessary.

What was expected behavior?

Testing of lrz file can continue if it can be decompressed entirely in ram OR
lrzip-next should fail outright

Steps to reproduce

In a write-protected directory, run command
lrzip-next -t file.lrz

Relevant log output

$ /share/software/Kernel/linux-5.x$ lrzip-next -vvt /tmp/v*lrz
Using configuration file /home/peter/.lrzip/lrzip.conf
The following options are in effect for this INTEGRITY TEST.
Threading is ENABLED. Number of CPUs detected: 8
Detected 16,558,260,224 bytes ram
Nice Value: 19
Show Progress
Max Verbose
Test file integrity
Temporary Directory set as: ./
WARNING: Failed to create out tmpfile: ./lrzipout.4dl460, will fail if cannot perform compression entirely in ram

Malloced 5,519,417,344 for tmp_outbuf
Failed to fstatvfs in decompress_file
Fatal error - exiting

Please provide system details

OS Distro: Slackware64-current
Kernel Version (uname -a): 5.19.1
System ram (free -h):

               total        used        free      shared  buff/cache   available
Mem:            15Gi       1.3Gi        11Gi       483Mi       2.2Gi        13Gi
Swap:           15Gi          0B        15Gi

Additional Context

When TMP environment variable is set, this error does not occur. Temp file will be created in TMP directory. However, when TMP is not set, temp file will be created in current directory. Also, the warning message that says the test can be run entirely in RAM is not occurring. This warning should either fail completely or some coding needs changing to allow running in RAM. This error also occurs in the main branch of lrzip version 0.651.

Not sure the best way to address this.

Fixed in whats-next branch. Please test.

Merged to lzma-22.01 branch (main)