Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8142508

To bring j.u.z.ZipFile's native implementation to Java to remove the expensive jni cost and mmap crash risk

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: core-libs

      Description

      The current j.u.z.ZipFile has following major issues:

      (1) Its ZIP file format support code is in native C code (shared with the VM via ZipFile.c -> zip_util.c). Any entry lookup, creation requires multiple round-trip of expensive jni invocations.

      (2) The current native C implementation code uses mmap to map in the central directory table appears to be a big risk of vm crash when the underlying jar file gets overwritten with new contents while it is still being used by other ZipFile.

      (3) The use of "filename + lastModified()" cache (at native) appears to be broken if the timestamp is in low resolution,and/or the file is being overwritten.

      The clean solution here is to bring the ZIP format support code from native to Java to remove the jni invocation cost and the mmap risk. Also to use the fileKey and lastModified from java.nio.file.attribute.BasicFileAttributes to have better cache matching key.

        Issue Links

          Activity

          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/a5d8e25767f8
          User: sherman
          Date: 2015-12-08 17:25:20 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/a5d8e25767f8 User: sherman Date: 2015-12-08 17:25:20 +0000
          Hide
          sherman Xueming Shen added a comment -
          The changeset for this rfe had been backout for 8144958. The updated change will be integrated via jdk-8145260
          Show
          sherman Xueming Shen added a comment - The changeset for this rfe had been backout for 8144958. The updated change will be integrated via jdk-8145260
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/a5d8e25767f8
          User: lana
          Date: 2015-12-16 19:10:55 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/a5d8e25767f8 User: lana Date: 2015-12-16 19:10:55 +0000

            People

            • Assignee:
              sherman Xueming Shen
              Reporter:
              sherman Xueming Shen
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 week
                1w
                Remaining:
                Remaining Estimate - 1 week
                1w
                Logged:
                Time Spent - Not Specified
                Not Specified