# ZipArchive problems. Possible bug (Livelock)

- Thread: https://externals.io/message/45063
- Original archive: https://news-web.php.net/php.internals/45063
- Started by torokalpar@gmail.com on 2009-07-23T13:20:54+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #45063 — torokalpar@gmail.com — 2009-07-23T13:20:54+00:00

URL: https://externals.io/message/45063#45063

Hi all,

The short version is : on a corrupted zip, getStream never returns,
and eats up the whole processor. CHECKCONS doesn't help.

The long version:
  I have scripts that process data. Data arrives as zip archives. The
data import process halts, eating up all server CPU. I have analyzed
the incoming zips  using the test option of 7zip [1] , i found that
the the problem occurs with zips that contain one or more files for
witch 7zip reports that CRC has failed. These zips open without an
error, and once i try to get stream, for the faulty file, the call
never returns, and eats up the cpu. I tried to use the   CHECKCON flag
at opening, in the hope that the zip won't open, and thus i can just
throw it away, but it doesn't seem to help. Looking in the source i
wound on line 1174 of php_zip.c [2] , that no flag parameter is passed
to zip_open. I don't have a developement environment, so i can
recompile / and or debug this problem.

I have tested with 5.2.10



[1] http://www.7-zip.org/ - The 7zip homepage
[2] the line reads : rsrc_int->za = zip_open(resolved_path, 0, &err);
-- 
Alpar Torok

---

## #45064 — Pierre Joye — 2009-07-23T13:29:31+00:00

URL: https://externals.io/message/45063#45064 · In reply to: #45063

hi,

Please open a bug report here:

http://bugs.php.net

with a script and an archive (if necessary) to reproduce your problem.

Cheers,


> Hi all,
>
> The short version is : on a corrupted zip, getStream never returns,
> and eats up the whole processor. CHECKCONS doesn't help.
>
> The long version:
>  I have scripts that process data. Data arrives as zip archives. The
> data import process halts, eating up all server CPU. I have analyzed
> the incoming zips  using the test option of 7zip [1] , i found that
> the the problem occurs with zips that contain one or more files for
> witch 7zip reports that CRC has failed. These zips open without an
> error, and once i try to get stream, for the faulty file, the call
> never returns, and eats up the cpu. I tried to use the   CHECKCON flag
> at opening, in the hope that the zip won't open, and thus i can just
> throw it away, but it doesn't seem to help. Looking in the source i
> wound on line 1174 of php_zip.c [2] , that no flag parameter is passed
> to zip_open. I don't have a developement environment, so i can
> recompile / and or debug this problem.
>
> I have tested with 5.2.10
>
>
>
> [1] http://www.7-zip.org/ - The 7zip homepage
> [2] the line reads : rsrc_int->za = zip_open(resolved_path, 0, &err);
> --
> Alpar Torok
>
> --
> 
> 
>
>



-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org
