[jdk8u-dev] RFR: 8186464: ZipFile cannot read some InfoZip ZIP64 zip files

fitzsim duke at openjdk.org
Fri Apr 5 16:31:09 UTC 2024


On Wed, 20 Mar 2024 15:23:45 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> This is a re-do of #445 as we reached a deadlock where I could not make myself commit author, as I was not the PR author, and Thomas could not make me the author as he was not a Committer (see [SKARA-2173](https://bugs.openjdk.org/browse/SKARA-2173)). The content remains the same.
>> 
>> What follows is Thomas' introduction from the original PR:
>> 
>> This patch was applied to the Red Hat 1.8.0 RPMs in June 2020, so it has been deployed to Red Hat customers for over three years.
>> 
>> I verified that the patch applies cleanly to jdk8u-dev master. I confirmed that with the fix portion of the patch reverted, the ReadZip.java test portion of the patch produces this exception:
>> 
>> ~~~
>> java.lang.RuntimeException: zipfile: zip64 end failed
>> 	at ReadZip.main(ReadZip.java:209)
>> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> 	at java.lang.reflect.Method.invoke(Method.java:498)
>> 	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
>> 	at java.lang.Thread.run(Thread.java:750)
>> ~~~
>> 
>> With the fix applied the test passes:
>> 
>> ~~~
>> Passed: java/util/zip/ZipFile/ReadZip.java
>> ~~~
>> 
>> With the patch applied on top of jdk8u-dev master tip, 3dc011b7ff955f6c1334058f300708412b21a3ad, `make test` on Fedora 38 x86-64 passes, with:
>> ~~~
>> Test results: passed: 3,122
>> ~~~
>> I also retested the test cases in [JDK-8186464](https://bugs.openjdk.org/browse/JDK-8186464) and confirmed that without this backport, they fail, and with the backport they succeed.
>> 
>> Thank you,
>> Thomas
>
>> I verified that the patch applies cleanly to jdk8u-dev master. 
> 
> I'm confused. The original patch https://hg.openjdk.org/jdk10/master/rev/723486922bfe touches ZipFile.java, not zip_util.c. How is this a clean apply? AFAICS this patch re-implements part of the original patch.

Sorry for the delay in replying; I did not notice that @tstuefe had commented.  Thanks for reviewing @jerboaa and @tstuefe .

I did the zip_util.c change to fix this Windows build failure (from my notes, because I cannot find the run in GitHub Actions anymore):


2024-02-15T23:16:09.7594742Z zip_util.c
2024-02-15T23:16:09.7614547Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(601) : error C2143: syntax error : missing ';' before 'type'
2024-02-15T23:16:09.7630440Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(602) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7634131Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(602) : warning C4022: 'findEND64' : pointer mismatch for actual parameter 2
2024-02-15T23:16:09.7637070Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(604) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7698807Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(604) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7704889Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(604) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7710221Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(604) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7719684Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(604) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7725741Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(604) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7728339Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(604) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7744006Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(604) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7746613Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(605) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7768297Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(605) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7779205Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(605) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7818211Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(605) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7820739Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(605) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7823157Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(605) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7841271Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(605) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7843802Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(605) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7850043Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(606) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7857203Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(606) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7877689Z make[2]: *** [lib/CoreLibraries.gmk:285: /cygdrive/d/a/jdk8u-dev/jdk8u-dev/jdk/build/windows-x86/jdk/objs/libzip/zip_util.obj] Error 2
2024-02-15T23:16:09.7880764Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(606) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7901316Z make[2]: *** Waiting for unfinished jobs....
2024-02-15T23:16:09.7904955Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(606) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7908669Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(606) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7919215Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(606) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7922355Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(606) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7924744Z d:/a/jdk8u-dev/jdk8u-dev/jdk/jdk/src/share/native/java/util/zip/zip_util.c(606) : error C2065: 'end64buf' : undeclared identifier
2024-02-15T23:16:09.7926720Z zutil.c
2024-02-15T23:16:09.8678783Z make[1]: *** [BuildJdk.gmk:70: libs-only] Error 2
2024-02-15T23:16:09.8979013Z make: *** [/cygdrive/d/a/jdk8u-dev/jdk8u-dev/jdk//make/Main.gmk:117: jdk-only] Error 2
2024-02-15T23:16:09.9840583Z ##[error]Process completed with exit code 1.


The older compiler on that build machine needed the end64buf declaration to be at the start of the function.

I do see end64buf is declared in the same place in zip_util.c on jdk master, so it would make more sense to start there and backport that change separately.  But now I wonder why no one else has seen this and fixed it already.

I think my next step should be to change this pull request to remove the zip_util.c part and see if the builders pass.  If they do, then this review can proceed.  If they don't, then I will file a jdk/master bug with the relevant explanation and pointers to GHA logs.

-------------

PR Comment: https://git.openjdk.org/jdk8u-dev/pull/452#issuecomment-2040216482


More information about the jdk8u-dev mailing list