-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
zlib v1.2.12 causes java.util.zip.ZipException #613
Comments
Experiencing the same issue in different Linux distribution but sadly it seems to be random or at least so far I was not able to create deterministic reproducer. |
So far I was able to trigger error in
Bisected to f8719f5:
The problem seems to be in zip creation -- Attaching broken sample (created on linux x86-64). |
Note that above issue is only reproducible on x86-64. Also tried x86 32-bit, arm 32-bit and arm 64-bit but all seem to work fine. |
|
Issue appears to be related to change in treatment of higher order bytes of
zlib 1.2.11 prints same result twice:
while zlib 1.2.12 gives two different values:
This affects |
As a workaround applied: diff --git a/crc32.c b/crc32.c
index a1bdce5..748b7ba 100644
--- a/crc32.c
+++ b/crc32.c
@@ -19,6 +19,7 @@
MAKECRCH can be #defined to write out crc32.h. A main() routine is also
produced, so that this one source file can be compiled to an executable.
*/
+#include <limits.h>
#ifdef MAKECRCH
# include <stdio.h>
@@ -1065,7 +1066,12 @@ unsigned long ZEXPORT crc32(crc, buf, len)
const unsigned char FAR *buf;
uInt len;
{
+/* if sizeof(unsigned long) > 4 */
+#if ULONG_MAX > 0xffffffffUL
+ return crc32_z(crc & 0xffffffffUL, buf, len);
+#else
return crc32_z(crc, buf, len);
+#endif
}
/* ========================================================================= */ |
is crc32() returning sign extended CRC32 values ? |
This does not appear to be a CRC output problem, but rather a CRC input problem. It looks like if |
Let me know if this commit remedies the issue: ec3df00 . |
Thank you! |
…tions on some older hardware, see madler/zlib#613 Pointed out by tj and sthen commit ec3df00224d4b396e2ac6586ab5d25f673caa4c2 Author: Mark Adler <madler@alumni.caltech.edu> Date: Wed Mar 30 11:14:53 2022 -0700 Correct incorrect inputs provided to the CRC functions. The previous releases of zlib were not sensitive to incorrect CRC inputs with bits set above the low 32. This commit restores that behavior, so that applications with such bugs will continue to operate as before.
…tions on some older hardware, see madler/zlib#613 Pointed out by tj and sthen commit ec3df00224d4b396e2ac6586ab5d25f673caa4c2 Author: Mark Adler <madler@alumni.caltech.edu> Date: Wed Mar 30 11:14:53 2022 -0700 Correct incorrect inputs provided to the CRC functions. The previous releases of zlib were not sensitive to incorrect CRC inputs with bits set above the low 32. This commit restores that behavior, so that applications with such bugs will continue to operate as before.
PATCHLEVEL++ Apply 0002-fix-crc32.patch 2.12 breaks CRC32 for programs like java See madler/zlib#613
Downgrading to `zlib=1.2.11` fixes the existing issue as reported in madler/zlib#613 until the patch is released. Authored-by: Matt Topol <zotthewizard@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
…#13885) Downgrading to `zlib=1.2.11` fixes the existing issue as reported in madler/zlib#613 until the patch is released. Authored-by: Matt Topol <zotthewizard@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
…#13885) Downgrading to `zlib=1.2.11` fixes the existing issue as reported in madler/zlib#613 until the patch is released. Authored-by: Matt Topol <zotthewizard@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
This backports the patch for madler/zlib#613, which was causing issues for the Closure compiler in particular.
This backports the patch for madler/zlib#613, which was causing issues for the Closure compiler in particular.
…#13885) Downgrading to `zlib=1.2.11` fixes the existing issue as reported in madler/zlib#613 until the patch is released. Authored-by: Matt Topol <zotthewizard@gmail.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>
Reference: madler/zlib#613 Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
The releases of zlib < 1.2.13 are not sensitive to incorrect CRC inputs with bits set above the low 32. Bump version to 1.2.13 to fix this issue. Reference: madler/zlib#613 Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Summary: Fixes a CPU-dependent issue that breaks Maven builds (Zlib issue: madler/zlib#613) Test Plan: - Rebuilt a few revdeps - Tested to see if build error was still present (I encountered the linked issue) and it wasn't Reviewers: #triage_team, Girtablulu Reviewed By: #triage_team, Girtablulu Subscribers: Girtablulu Differential Revision: https://dev.getsol.us/D13176
The one way i can reliably reproduce this is as follows:
With previous (working) version of zlib-1.2.11 it runs fine.
Upgrading to zlib-1.2.12 causes this error:
Downgrading to 1.2.11 fixes it.
This was compiled on Gentoo with GCC 11.2.1, no special CFLAGS.
Gentoo bug: https://bugs.gentoo.org/836370
The text was updated successfully, but these errors were encountered: