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

jimage fails with IAE when attempts to inspect an empty file

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 9
    • 9
    • tools
    • generic
    • generic
    • Verified

        In case when an empty file is specified instead of image, jimage fails with the following error message:

        % jimage info empty_file

        java.lang.IllegalArgumentException: newLimit > capacity: (28 > 4)
                at java.base/java.nio.Buffer.createLimitException(Buffer.java:367)
                at java.base/java.nio.Buffer.limit(Buffer.java:341)
                at java.base/java.nio.ByteBuffer.limit(ByteBuffer.java:1094)
                at java.base/java.nio.MappedByteBuffer.limit(MappedByteBuffer.java:230)
                at java.base/java.nio.MappedByteBuffer.limit(MappedByteBuffer.java:66)
                at java.base/jdk.internal.jimage.BasicImageReader.slice(BasicImageReader.java:203)
                at java.base/jdk.internal.jimage.BasicImageReader.intBuffer(BasicImageReader.java:210)
                at java.base/jdk.internal.jimage.BasicImageReader.<init>(BasicImageReader.java:147)
                at java.base/jdk.internal.jimage.BasicImageReader.open(BasicImageReader.java:173)
                at jdk.jlink/jdk.tools.jimage.JImageTask.iterate(JImageTask.java:383)
                at jdk.jlink/jdk.tools.jimage.JImageTask.run(JImageTask.java:435)
                at jdk.jlink/jdk.tools.jimage.JImageTask.run(JImageTask.java:228)
                at jdk.jlink/jdk.tools.jimage.Main.main(Main.java:34)

        The issue affects all jimage commands.

        Tested on the latest jigsaw and jdk 9-ea+144.

              dkononenko Denis Kononenko
              dkononenko Denis Kononenko
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: