java-11-openjdk in Fedora 40 is built with the `--with-zlib=bundled` flag, meaning that is uses OpenJDK's internal zlib library, and not zlibng. Trying to build java-11-openjdk with the `--with-zlib=system`n fails on some zip and pack200 tests. Also any other OpenJDK 11 binary (Amazon Corretto JDK11, for instance) which has been built with the `--with-zlib=system` flag (and that is using zlibng) will generate "jar" and "pack200" tools that behave differently, producing corrupted files. Reproducible: Always Steps to Reproduce: Option 1: 1. Build OpenJDK at https://github.com/openjdk/jdk11 following instructions at https://github.com/openjdk/jdk11/blob/master/doc/building.md 2. Run "make run-test-tier1" Option 2: 1. Install the "java-11-openjdk" bundled with Fedora (built using --with-zlib=bundled) 2. Install a Java 11 OpenJDK compiled using --with-zlib=system, such as Amazon Corretto [1] 3. Download the "golden.jar" file using in the Pack200 test from [2] to "golden-bundled.jar" and "golden-system.jar" 3.1. curl -L https://github.com/openjdk/jdk11/raw/master/test/jdk/tools/pack200/pack200-verifier/data/golden.jar -o golden-bundled.jar 3.2. curl -L https://github.com/openjdk/jdk11/raw/master/test/jdk/tools/pack200/pack200-verifier/data/golden.jar -o golden-system.jar 4. Repack "golden-bundled.jar" with /usr/lib/jvm/java-11-openjdk-11.0.23.0.9-1.fc40.x86_64/bin/pack200 --repack golden-bundled.jar 5. Repack "golden-system.jar" with third-party OpenJDK11 /path/to/amazon-corretto-11/bin/pack200 --repack golden-system.jar 6. The two files differ in size: 445677 may 16 10:31 golden-bundled.jar 448934 may 16 10:30 golden-system.jar [1] https://docs.aws.amazon.com/corretto/latest/corretto-11-ug/downloads-list.html [2] https://github.com/openjdk/jdk11/raw/master/test/jdk/tools/pack200/pack200-verifier/data/golden.jar Actual Results: - OpenJDK 11 does not build on Fedora 40 without the "--with-zlib=bundled" - Java's "jar" and "pack200" in different OpenJDK versions produce different results. Expected Results: - OpenJDK 11 should build on Fedora 40 with the "--with-zlib=system" configure option. - All Java runtimes from different vendors should work the same in Fedora 40.
Created attachment 2033505 [details] The "pack200 --repack golden.jar" when pack200 is not using zlibng
Created attachment 2033506 [details] The "pack200 --repack golden.jar" when pack200 is using zlibng
Created attachment 2033507 [details] The result of "zipdump" on the bundled generated .jar file.
Created attachment 2033508 [details] The result of "zipdump" on the system generated jar file.
Created attachment 2033509 [details] Comparing zipdump generated files with diff zipdump-bundled.txt zipdump-system.txt > zip-diffs.txt
After some research the bug is not generated by zlibng. It's just that zlibng compresses entries with different ratios than zlib. The tests in the OpenJDK should be updated to not take into account the sizes of the generated files instead. Apologies for the noise!