JDK-8223597 : (zipfs) jdk/nio/zipfs/ZipFSTester.java RuntimeException: CHECK_FAILED! (getAttribute.crc failed 6af4413c vs 0 ...)
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 11.0.4,12.0.2,13
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-05-09
  • Updated: 2021-11-19
  • Resolved: 2019-05-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 12 JDK 13
11.0.4Fixed 12.0.2Fixed 13 b21Fixed
Related Reports
Relates :  
Description
open/test/jdk/jdk/nio/zipfs/ZipFSTester.java

----------System.out:(95/2624)----------
[/]
  foo.jar
  [/META-INF]
    MANIFEST.MF
  [/dir1]
    foo
    [/dir1/dir3]
      fooo
  [/dir2]
    bar
checking </tmp/testzipfs_16184370724208013164zip> vs </tmp/testzipfs_16184370724208013164zip>...
checking </tmp/testzipfs_16184370724208013164zip> vs </xyz73/efg8/foo.class>...
checking </tmp/testzipfs_16184370724208013164zip> vs </tmp/testzipfs_16184370724208013164zip_Tmp>...
checking </tmp/testzipfs_16184370724208013164zip> vs </tmp/testzipfs_16184370724208013164zip_Tmp0>...
[/]
  [/xyz73]
    [/xyz73/efg8]
  [/tmp]
  foo.jar
  [/META-INF]
    MANIFEST.MF_TMP
  [/dir1]
    foo
    [/dir1/dir3]
      fooo
  [/dir2]
    bar
checking </tmp/testzipfs_16184370724208013164zip> vs </tmp/testzipfs_16184370724208013164zip>...
checking </tmp/testzipfs_16184370724208013164zip> vs </tmp/testzipfs_16184370724208013164zip_Tmp>...
test ByteChannel...
   sbc[0]: pos=0, size=12345
   sbc[1]: read=12345, pos=12345, size=12345
   sbc[2]: pos=120, size=12345
   sbc[3]: read=100, pos=220, size=12345
   sbc[4]: bb[120]=199, bb1[0]=199
walking: /foo.jar
[/]
  srcInjarjar
  [/dir2]
    bar
  [/dir1]
    [/dir1/dir3]
      fooo
    foo
  [/META-INF]
    MANIFEST.MF
checking </tmp/testzipfs_16184370724208013164zip> vs </srcInjarjar>...
checking </tmp/testzipfs_16184370724208013164zip> vs </tmp/testzipfs_16184370724208013164zip>...
checking </tmp/testzipfs_16184370724208013164zip> vs </tmp/testzipfs_16184370724208013164zip_Tmp>...
test ByteChannel...
   sbc[0]: pos=0, size=12345
   sbc[1]: read=12345, pos=12345, size=12345
   sbc[2]: pos=120, size=12345
   sbc[3]: read=100, pos=220, size=12345
   sbc[4]: bb[120]=199, bb1[0]=199
copy src: fs -> fs0...
open fs0 as fs1
listing...
copying/removing...
closing: fs1, fs2
checkEqual: fs vs fs3
checking </META-INF/MANIFEST.MF> vs </META-INF/MANIFEST.MF>...
checking </dir1/foo> vs </dir1/foo>...
checking </dir1/dir3/fooo> vs </dir1/dir3/fooo>...
checking </dir2/bar> vs </dir2/bar>...
closing: fs3
opening: fs3 as fs4
checkEqual: fs vs fs4
checking </dir2/bar> vs </dir2/bar>...
checking </META-INF/MANIFEST.MF> vs </META-INF/MANIFEST.MF>...
checking </dir1/foo> vs </dir1/foo>...
checking </dir1/dir3/fooo> vs </dir1/dir3/fooo>...
walking: fs4
[/]
  [/dir2]
    bar
  [/META-INF]
    MANIFEST.MF
  [/dir1]
    foo
    [/dir1/dir3]
      fooo
closing: fs4
failed=0
read()/position() failed
read()/position() failed
read()/position() failed
read()/position() failed
read()/position() failed
read()/position() failed
read()/position() failed
read()/position() failed
read()/position() failed
read()/position() failed
 getAttribute.crc <entries20> failed 6af4413c vs 0 ...
----------System.err:(27/1771)----------
java.nio.file.FileSystemException: /xyz73/efg8 -> is a directory
	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.newInputStream(ZipFileSystem.java:583)
	at jdk.zipfs/jdk.nio.zipfs.ZipPath.newInputStream(ZipPath.java:721)
	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.newInputStream(ZipFileSystemProvider.java:278)
	at java.base/java.nio.file.Files.newInputStream(Files.java:158)
	at ZipFSTester.test1(ZipFSTester.java:228)
	at ZipFSTester.main(ZipFSTester.java:94)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
	at java.base/java.lang.Thread.run(Thread.java:830)
java.lang.RuntimeException: CHECK FAILED!
	at ZipFSTester.checkRead(ZipFSTester.java:446)
	at ZipFSTester.testStreamChannel(ZipFSTester.java:553)
	at ZipFSTester.main(ZipFSTester.java:97)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
	at java.base/java.lang.Thread.run(Thread.java:830)

Comments
Fix Request: This fixes a regression that came in with JDK-8222532. Since the latter had been downported to jdk11/12 updates, we need to bring this down as well. Patch applies cleanly, risk is low.
14-05-2019

URL: http://hg.openjdk.java.net/jdk/jdk/rev/43764a3a986d User: clanger Date: 2019-05-14 08:27:53 +0000
14-05-2019

There is an issue when writing an empty buffer via Files.newByteChannel to a zipfs entry. Obviously this pops up only sporadically because the file contents for the test are generated with a random number generator. The issue can reliably be reproduced with the following modification to the test: diff -r 8a6a47c053b5 test/jdk/jdk/nio/zipfs/ZipFSTester.java --- a/test/jdk/jdk/nio/zipfs/ZipFSTester.java Tue May 07 06:09:37 2019 -0700 +++ b/test/jdk/jdk/nio/zipfs/ZipFSTester.java Fri May 10 15:11:47 2019 +0200 @@ -420,7 +420,13 @@ static Object[][] getEntries() { Object[][] entries = new Object[10 + rdm.nextInt(20)][3]; - for (int i = 0; i < entries.length; i++) { + entries[0][0] = "entries" + 0; + entries[0][1] = METHOD_STORED; + entries[0][2] = new byte[0]; + entries[1][0] = "entries" + 1; + entries[1][1] = METHOD_DEFLATED; + entries[1][2] = new byte[0]; + for (int i = 2; i < entries.length; i++) { entries[i][0] = "entries" + i; entries[i][1] = rdm.nextInt(10) % 2 == 0 ? METHOD_STORED : METHOD_DEFLATED; It's proably a regression of JDK-8222532 which changed the way how entries are written to the zip file. I would take over the bug and work on a fix. (@bpb: is that ok for you?)
10-05-2019

This failed in CI jdk-13-980 and now in jdk-13-1001 - once on Linux and once on Windows. Marking as intermittent.
10-05-2019