If you simply create two files and pack them, it's all right
$ touch 1
$ touch 2
$ 7za a 1.zip 1 27-Zip (a) [64] 9.38 beta Copyright (c) 1999-2014 Igor Pavlov 2015-01-03
p7zip Version 9.38.1 (locale=ru_RU.UTF-8,Utf16=on,HugeFiles=on,8 CPUs,ASM)
ScanningCreating archive 1.zip
Compressing 1
Compressing 2Everything is Ok
But if one file can not be read, then packing hangs
$ chmod 0000 2
$ 7za a 2.zip 1 27-Zip (a) [64] 9.38 beta Copyright (c) 1999-2014 Igor Pavlov 2015-01-03
p7zip Version 9.38.1 (locale=ru_RU.UTF-8,Utf16=on,HugeFiles=on,8 CPUs,ASM)
ScanningCreating archive 2.zip
Compressing 1
Compressing 2
<hang></hang>
Tested in ubuntu and Centos 5
The problem occurs only when run as an unprivileged user. As root - all right
Still a problem in p7zip-16.02.
Proposal:
The "WARNING: Permission denied" is good.
But afterwards 7z should continue the compression for the readable files.
And finally 7z should exit with an exit code != 0.
Tested on openSUSE-15.2:
Only with zip files though. When using 7z it's fine, program ignores inaccessible file and moves on.
Back to the problem, I tried to use gdb and strace and all I found put is this:
in gdb program hangs in libpthreads.so:
and strace somewhere here:
which again made me think it has something to do with threads, so I made an experiment:
And it looks like I was right. When one turns off multiple treads, it works fine.
It obviously doesn't solve the problem but gives the hint where to look for.
Last edit: Sam Tansy 2021-03-24