Duplicate :
|
FULL PRODUCT VERSION : java version "1.8.0_25" Java(TM) SE Runtime Environment (build 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) ADDITIONAL OS VERSION INFORMATION : Linux ip-10-210-182-201 3.13.0-36-generic #63-Ubuntu SMP Wed Sep 3 21:30:07 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux EXTRA RELEVANT SYSTEM CONFIGURATION : Running on an EC2 instance. $ gdb --version GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1 A DESCRIPTION OF THE PROBLEM : When taking a core dump with gdb, jmap fails some time into the processing: I haven't been able to test whether this problem occurs when running jmap directly against the pid, as we can't afford freezing the application for so long. Performing the same procedure against other processes yields the same (erroneous) result. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : $ sudo gdb --pid=29474 > gcore jvm.core > detach > quit $ $ jmap -dump:format=b,file=jvm-29474.hprof /usr/bin/java ./jvm-29474.core EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - jvm-29474.hprof is created without throwing an exception. ACTUAL - hprof file is left in an incomplete state. The generated hprof file is 71M, while the raw core jvm-29474.core is 646M. ERROR MESSAGES/STACK TRACES THAT OCCUR : $ jmap -dump:format=b,file=jvm-29474.hprof /usr/bin/java ./jvm-29474.core Attaching to core ./jvm-29474.core from executable /usr/bin/java, please wait... Debugger attached successfully. Server compiler detected. JVM version is 25.25-b02 Dumping heap to jvm-29474.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:483) at sun.tools.jmap.JMap.runTool(JMap.java:201) at sun.tools.jmap.JMap.main(JMap.java:130) Caused by: sun.jvm.hotspot.utilities.AssertionFailure: can not get class data for sun/net/ExtendedOptionsImpl$$Lambda$10x000000010011e428 at sun.jvm.hotspot.utilities.Assert.that(Assert.java:32) at sun.jvm.hotspot.utilities.HeapHprofBinWriter.writeInstance(HeapHprofBinWriter.java:803) at sun.jvm.hotspot.utilities.AbstractHeapGraphWriter$1.doObj(AbstractHeapGraphWriter.java:95) at sun.jvm.hotspot.oops.ObjectHeap.iterateLiveRegions(ObjectHeap.java:353) at sun.jvm.hotspot.oops.ObjectHeap.iterate(ObjectHeap.java:171) at sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.write(AbstractHeapGraphWriter.java:51) at sun.jvm.hotspot.utilities.HeapHprofBinWriter.write(HeapHprofBinWriter.java:433) 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) REPRODUCIBILITY : This bug can be reproduced always.