-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Random read_entry "decompression error" exception with zlib 1.2.9+ #1
Comments
einars
changed the title
Problem with zlib 1.2.9+
Random read_entry problem with zlib 1.2.9+
Jan 17, 2017
einars
changed the title
Random read_entry problem with zlib 1.2.9+
Random read_entry decompression error" exception with zlib 1.2.9+
Jan 17, 2017
einars
changed the title
Random read_entry decompression error" exception with zlib 1.2.9+
Random read_entry "decompression error" exception with zlib 1.2.9+
Jan 17, 2017
You are correct that the z_stream is allocated in the OCaml heap and can therefore be moved by the GC. I had no idea this could be a problem at all. |
I'm having a similar problem with zlib 1.2.11 while opening a fairly small PNG image (117Ko) using imagelib. The problem is solved by the code of the pull request #2 |
xavierleroy
added a commit
that referenced
this issue
Jan 23, 2017
Allocate Zstream structures outside the OCaml heap Recent versions of Zlib fail if the Zstream is moved during operation, as can happen when it is allocated in the OCaml heap. Closes: #1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since the notorious zlib update, I've been having hard-to-pin-down somewhat reproducible issues when processing large zip files (700 mb) and using a lot of memory while processing. I can reproduce them all the time with my core+camlzip processor on of my huge file that I am not able to share publicly, but been unable to extract to a smaller, reproducible case (even adding a debug output may make the issue go away).
The problem manifests itself as suddenly being unable to unpack zip file — the Zlib.Error "decompression error" on random files gets thrown, whereas the zip file is itself perfectly fine.
What I've been able to pinpoint so far is that it started occuring with a zlib commit madler/zlib@b516b4b — Mark Adler added some sanity checks,
The exception gets thrown in camlzip_inflateEnd, as zlib returns error,
the reason for exception is that inflateStateCheck checks the stream structure, and inside there's a "state" substructure that has a reverse pointer to the stream. The new check verifies if these streams are actually equal (madler/zlib@b516b4b#diff-327188edf18799ffbb5a51cc69f797e8R113) — and suddenly, they are not anymore.
Here's my zlib debug info,
I suppose that probably the garbage collector or something sometimes moves things around and the structure turns invalid, or something — — — any ideas?
(Up-to-date 64-bit archlinux, ocaml 4.04.0 and all via opam)
The text was updated successfully, but these errors were encountered: