7z hangs if a file is deleted while creating a zip archive
A free file archiver for extremely high compression
Brought to you by:
ipavlov
If a file is deleted from a directory tree while 7z is creating an archive in zip format:
7z -tzip a my-archive /my-directory-tree
7z will hang:
WARNING: No such file or directory
/my-directory-tree/my-missing-file
(Makes no further progress)
This doesn't happen if using default 7z format:
7z a my-archive /my-directory-tree
WARNING: No such file or directory
/my-directory-tree/my-missing-file
(Proceeds to completion.)
I can't reproduce the problem.
Please check it again.
And try latest version 17.01
try also
-mmt1switchWow, the -mmt1 switch solves the problem! 7-Zip no longer hangs!
Unfortunately, we can't use it because the Java zip library doesn't like .zip files made with the -mmt1 switch.
Is there a 17.01 build for Fedora/RHEL/CentOS?
The call with -mmt1 and the call without -mmt1 must produce same archives.
I still want to fix the problem for case without -mmt1.
So what version of p7zip it was?
16.02
This was run on a CentOS-7 VM.
I installed 7z by running the command 'sudo yum install p7zip p7zip-plugins'.
How to repro:
On a Linux host, find or create a large directory tree. It must be large enough that it will take at least a minute to compress. Select a file deep in the tree that can be moved:
my-tree/.../my-fileOpen two shells on the host.
In the first shell, start a compression:
7z -tzip a my-tree-backup my-treeIn the second shell, immediately after starting the compression, move the selected file out of the tree:
mv my-tree/.../my-file .When 7z reaches the selected file and finds it missing, it will output a warning:
7z will then be suspended, never making further progress.
Note that this occurs only if using .zip format. 7z will complete successfully if using .7z format.
1) please check the problem with simplest multithreading case with -mmt2 switch.
2) can you check same -mmt2 with 7z.exe or 7za.exe for Windows version of 7-Zip via wine - with both versions: 16.04 and 17.01 beta?
I suppose it's bug of p7zip port of windows code for CRITICAL_SECTION object.
More details are here:
https://sourceforge.net/p/p7zip/bugs/203/
Now there some ways to fix the problem:
1) you can fix p7zip code in Threads.c
2) I'll change ZipUpdate.cpp also to eliminate bad case. So next version of 7-zip code will be able to work with old "bad" Threads.c of p7zip.
In any case you must recompile p7zip.
But I don't know when new version of p7zip will be released.
-mmt1 must work OK.
Thanks for report!
Are there news about this bug? I confirm it on Xubuntu 19.10 with this 7z version:
I also confirm that using
-mmt1is a successful workaround.