JDK-8186501 : jmap fails with IndexOutOfBoundsException 20 18
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc
  • Affected Version: 8u111
  • Priority: P3
  • Status: Closed
  • Resolution: Incomplete
  • OS: linux
  • CPU: x86
  • Submitted: 2017-08-17
  • Updated: 2017-09-12
  • Resolved: 2017-09-12
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-b15)
OpenJDK Server VM (build 25.111-b15, mixed mode)

FULL OS VERSION :
Linux localhost.localdomain 2.6.32-431.29.2.rss65.53.i686 #1 SMP Wed Dec 14 17:48:51 EST 2016 i686 i686 i386 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
When we try to create a hprof file from a java .core using the jmap tool the exception "IndexOutOfBoundsException 20 18" is thrown when processing xerces classes belonging to the package org.apache.xerces.dom package.

THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Yes

THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

REGRESSION.  Last worked in version 6u45

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
After taking a core for a running Java process execute the jmap command to create a heap file.

jmap -dump:format=b,file=out.hprof /usr/bin/java java.15282.uid-500.gid-500.sig-31.2017.07.27-10.27.36.core

EXPECTED VERSUS ACTUAL BEHAVIOR :
The heap file is created successfully.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Attaching to core java.15282.uid-500.gid-500.sig-31.2017.07.27-10.27.36.core from executable /usr/bin/java, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.111-b15
Dumping heap to out.hprof ...
Exception in thread "main" java.lang.reflect.InvocationTargetException
        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 sun.tools.jmap.JMap.runTool(JMap.java:201)
        at sun.tools.jmap.JMap.main(JMap.java:130)
Caused by: java.lang.NullPointerException
        at sun.jvm.hotspot.utilities.HeapHprofBinWriter.write(HeapHprofBinWriter.java:419)
        at sun.jvm.hotspot.tools.HeapDumper.run(HeapDumper.java:62)
        at sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:260)
        at sun.jvm.hotspot.tools.Tool.start(Tool.java:223)
        at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
        at sun.jvm.hotspot.tools.HeapDumper.main(HeapDumper.java:83)
        ... 6 more


REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
I have identified that the failing classes all from the org.apache.xerces.dom package.

Some of the names are:
org/apache/xerces/dom/CDATASectionImpl
org/apache/xerces/dom/CharacterDataImpl
org/apache/xerces/dom/DeferredCDATASectionImpl
org/apache/xerces/dom/DeferredProcessingInstructionImpl
org/apache/xerces/dom/DeferredTextImpl
org/apache/xerces/dom/TextImpl



Comments
The bug could not be reproduced. The bug can be reopened if there is a reproducible testcase or clear reproducible steps
12-09-2017

Requested submitter to provide either test case of heap dump file.
21-08-2017

There are 2 issue reported here. 1. IndexOutOfBoundsException 20 18 From above report there is no evidence of IndexOutOfBoundsException 2. java.lang.NullPointerException at sun.jvm.hotspot.utilities.HeapHprofBinWriter.write(HeapHprofBinWriter.java:419 NPE observed on org.apache.xerces.dom while running jmap on heap dump. We need atleast test case to reproduce this issue or heap dump file to isolate the problem.
21-08-2017