Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8175753 | 10 | Denis Kononenko | P2 | Resolved | Fixed | b02 |
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.
% 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.
- backported by
-
JDK-8175753 jimage fails with IAE when attempts to inspect an empty file
- Resolved
- relates to
-
JDK-8170120 jimage throws IOException when the given file is not a jimage file
- Resolved