JDK-8073605 : jmap fails to heap dump: cannot get class data for j.u.stream.Collectors$$Lambda
  • Type: Bug
  • Component: core-svc
  • Sub-Component: tools
  • Affected Version: 6,7,8u65,9
  • Priority: P1
  • Status: Resolved
  • Resolution: Duplicate
  • OS: linux_redhat_6.0
  • CPU: x86
  • Submitted: 2014-12-04
  • Updated: 2016-03-18
  • Resolved: 2016-03-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8u60Resolved
Related Reports
Duplicate :  
Duplicate :  
Description
FULL PRODUCT VERSION :
gdonovan@gdonovan:~/development/Search (jdk18025 *)$ /usr/java/jdk1.8.0_25/bin/java -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 :
CentOS release 6.2 (Final)
Linux 2.6.32-220.4.1.el6.x86_64 #1 SMP Tue Jan 24 02:13:44 GMT 2012 x86_64 x86_64 x86_64 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
Histograms work without issue:
sudo /usr/java/jdk1.8.0_25/bin/jmap -J-d64 -histo -F $pid 2>&1

But heap dumps fail:
gdonovan@gdonovan:~/development/Search (jdk18025 *)$ sudo /usr/java/jdk1.8.0_25/bin/jmap -J-d64  -dump:format=b,file=$file -F $pid 2>&1
Attaching to process ID 2750, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.25-b02
Dumping heap to /search/tmp/heap-gdonovan-1417725219.bin ...
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 java/util/stream/Collectors$$Lambda$60x00000001001ca428
	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)

REGRESSION.  Last worked in version 7u55


REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
We are unable to use jmap to generate heap dumps.


Comments
JDK-8044416 should have got this fixed.
18-03-2016

This issue is not reproducible now on JDK 8 or 9. This should have got fixed with https://bugs.openjdk.java.net/browse/JDK-8044416 (serviceability/sa/jmap-hashcode/Test8028623.java fails with AssertionFailure: can not get class data for java/lang/UNIXProcess$Platform$$Lambda) In the comment mentioned above, the version of jmap used does not match that of the JVM used (we have the following warning on that as shown above). "WARNING: Hotspot VM version 25.72-b12 does not match with SA version 9-ea+103-2016-01-27-190945.javare.4341.nc. You may see unexpected results." When jmap and JVM were both from the JDK version as shown above (both used 8u72), the heap dump file could be generated. With the -F option is specified, SA is used and there needs to be a exact match between jmap and the JVM. Closing this as a duplicate.
18-03-2016

ILW=H (Broken functionality) M (only with Lamda and anonymous classes) H = P1
26-02-2016

Test result [ Heap Dump] : #################### 8u72 #### abhijit@abhijit-VirtualBox:~$ sudo /media/sf_ora/java/jdk1.8.0_72/bin/jmap -J-d64 -dump:format=b,file=/media/sf_ora/coreDumper/core8073605 -F 4835 2>&1 Attaching to process ID 4835, please wait... Debugger attached successfully. Server compiler detected. JVM version is 25.72-b12 Dumping heap to /media/sf_ora/coreDumper/core8073605 ... Heap dump file created abhijit@abhijit-VirtualBox:~$ 6uXX, 7uXX, 8uXX [except 8u72], 9ea b103: ################################### abhijit@abhijit-VirtualBox:~$ sudo /media/sf_ora/java/jdk-9/bin/jmap -J-d64 -dump:format=b,file=/media/sf_ora/coreDumper/core8073605 -F 4835 2>&1 Attaching to process ID 4835, please wait... WARNING: Hotspot VM version 25.72-b12 does not match with SA version 9-ea+103-2016-01-27-190945.javare.4341.nc. You may see unexpected results. Debugger attached successfully. Server compiler detected. JVM version is 25.72-b12 Dumping heap to /media/sf_ora/coreDumper/core8073605 ... 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:520) at sun.tools.jmap.JMap.runTool(JMap.java:201) at sun.tools.jmap.JMap.main(JMap.java:130) Caused by: java.lang.ExceptionInInitializerError at sun.jvm.hotspot.runtime.VM.getSymbolTable(VM.java:631) at sun.jvm.hotspot.utilities.HeapHprofBinWriter.write(HeapHprofBinWriter.java:390) 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 Caused by: java.lang.RuntimeException: field "_shared_table" not found in type SymbolTable at sun.jvm.hotspot.types.basic.BasicType.getField(BasicType.java:183) at sun.jvm.hotspot.types.basic.BasicType.getField(BasicType.java:190) at sun.jvm.hotspot.types.basic.BasicType.getField(BasicType.java:194) at sun.jvm.hotspot.types.basic.BasicType.getAddressField(BasicType.java:282) at sun.jvm.hotspot.memory.SymbolTable.initialize(SymbolTable.java:47) at sun.jvm.hotspot.memory.SymbolTable.access$000(SymbolTable.java:35) at sun.jvm.hotspot.memory.SymbolTable$1.update(SymbolTable.java:39) at sun.jvm.hotspot.runtime.VM.registerVMInitializedObserver(VM.java:436) at sun.jvm.hotspot.memory.SymbolTable.<clinit>(SymbolTable.java:37) ... 13 more abhijit@abhijit-VirtualBox:~$ sudo /media/sf_ora/java/jdk-9/bin/java -version java version "9-ea" Java(TM) SE Runtime Environment (build 9-ea+103-2016-01-27-190945.javare.4341.nc) Java HotSpot(TM) 64-Bit Server VM (build 9-ea+103-2016-01-27-190945.javare.4341.nc, mixed mode) abhijit@abhijit-VirtualBox:~$
14-02-2016

Test Result [histogram]: ##################### OS: Linux Ubuntu 14.04 JDK: 6u45 b06 : Fail 7u55 b15 : Fail 7u85 b15 : Fail 8u00 b132 : Fail 8u65 b17 : Fail 8u72 b12 : Pass 9ea b103 : Pass Output: 8u72,9ea: ######## PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 2435 root 20 0 3655220 52824 11804 S 23.9 0.9 0:19.63 java >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>pid 2435 ############################################################################################################################### abhijit@abhijit-VirtualBox:~$ sudo /media/sf_ora/java/jdk-9/bin/jmap -J-d64 -histo -F 2435 2>&1 Attaching to process ID 2435, please wait... WARNING: Hotspot VM version 25.72-b12 does not match with SA version 9-ea+103-2016-01-27-190945.javare.4341.nc. You may see unexpected results. Debugger attached successfully. Server compiler detected. JVM version is 25.72-b12 Iterating over heap. This may take a while... Object Histogram: num #instances #bytes Class description -------------------------------------------------------------------------- 1: 127652 6127296 java.nio.HeapCharBuffer 2: 1006 85960 char[] 3: 454 51928 java.lang.Class 4: 8 24984 byte[] 5: 502 24936 java.lang.Object[] 6: 988 23712 java.lang.String 7: 124 13256 int[] 8: 79 5688 java.lang.reflect.Field 9: 256 4096 java.lang.Integer 10: 94 3760 java.lang.ref.SoftReference 11: 109 3488 java.util.Hashtable$Entry 12: 59 2176 java.lang.String[] 13: 40 1920 sun.util.locale.LocaleObjectCache$CacheEntry 14: 5 1880 java.lang.Thread 15: 51 1632 java.util.concurrent.ConcurrentHashMap$Node 16: 21 1344 java.net.URL 17: 2 1064 java.lang.invoke.MethodHandle[] 18: 26 1040 java.io.ObjectStreamField 19: 1 1040 java.lang.Integer[] 20: 6 992 java.util.Hashtable$Entry[] 21: 30 960 java.util.HashMap$Node 22: 11 944 java.util.HashMap$Node[] 23: 20 800 sun.util.locale.BaseLocale$Key 24: 18 720 java.util.LinkedHashMap$Entry 25: 12 672 java.lang.Class$ReflectionData 26: 14 672 java.util.HashMap 27: 20 640 java.util.Locale 28: 20 640 sun.util.locale.BaseLocale 29: 8 640 short[] 30: 5 528 java.util.concurrent.ConcurrentHashMap$Node[] 31: 10 480 sun.misc.URLClassPath$JarLoader 32: 30 480 java.lang.Object 33: 6 480 java.lang.reflect.Constructor 34: 20 480 java.util.Locale$LocaleKey 35: 8 456 java.lang.reflect.Field[] 36: 18 432 java.io.ExpiringCache$Entry 37: 6 384 java.nio.DirectByteBuffer 38: 6 384 java.util.concurrent.ConcurrentHashMap 39: 1 384 java.lang.ref.Finalizer$FinalizerThread 40: 1 376 java.lang.ref.Reference$ReferenceHandler 41: 9 360 java.security.AccessControlContext 42: 11 352 java.io.File 43: 6 336 java.nio.DirectLongBufferU 44: 10 320 java.lang.OutOfMemoryError 45: 10 288 java.io.ObjectStreamField[] 46: 3 240 java.util.WeakHashMap$Entry[] 47: 10 240 sun.misc.MetaIndex 48: 7 224 java.lang.ref.ReferenceQueue 49: 5 200 java.util.WeakHashMap$Entry 50: 4 192 java.util.Hashtable 51: 6 192 java.util.Vector 52: 3 168 sun.nio.cs.UTF_8$Encoder 53: 4 160 java.lang.ref.Finalizer 54: 3 144 java.util.WeakHashMap 55: 6 144 sun.misc.PerfCounter 56: 9 144 java.lang.ref.ReferenceQueue$Lock 57: 6 144 java.util.ArrayList 58: 2 128 java.io.ExpiringCache$1 59: 3 120 java.security.ProtectionDomain 60: 2 96 java.util.Properties 61: 3 96 java.io.FileDescriptor 62: 2 96 java.lang.ThreadGroup 63: 1 96 sun.misc.Launcher$AppClassLoader 64: 3 96 java.util.Stack 65: 2 96 java.nio.HeapByteBuffer 66: 3 96 java.security.CodeSource 67: 2 96 sun.nio.cs.StreamEncoder 68: 2 96 sun.misc.URLClassPath 69: 1 88 sun.misc.Launcher$ExtClassLoader 70: 1 88 java.lang.reflect.Method 71: 5 88 java.lang.Class[] 72: 1 80 java.lang.ThreadLocal$ThreadLocalMap$Entry[] 73: 2 80 java.io.BufferedWriter 74: 2 80 java.io.ExpiringCache 75: 3 72 java.lang.RuntimePermission 76: 3 72 java.util.concurrent.atomic.AtomicLong 77: 3 72 java.lang.reflect.Constructor[] 78: 3 72 sun.reflect.NativeConstructorAccessorImpl 79: 3 72 sun.misc.Signal 80: 3 72 java.util.Collections$SynchronizedSet 81: 2 64 java.lang.ThreadLocal$ThreadLocalMap$Entry 82: 2 64 java.lang.ref.ReferenceQueue$Null 83: 2 64 java.lang.Thread[] 84: 2 64 java.io.FileOutputStream 85: 2 64 java.lang.ClassValue$Entry 86: 2 64 java.lang.VirtualMachineError 87: 2 64 java.io.PrintStream 88: 3 48 java.security.Principal[] 89: 3 48 java.security.ProtectionDomain$Key 90: 1 48 long[] 91: 3 48 java.nio.charset.CodingErrorAction 92: 2 48 java.io.BufferedOutputStream 93: 3 48 java.lang.ThreadLocal 94: 3 48 sun.reflect.DelegatingConstructorAccessorImpl 95: 2 48 java.io.File$PathStatus 96: 2 48 sun.misc.NativeSignalHandler 97: 2 48 java.nio.charset.CoderResult 98: 2 48 java.io.OutputStreamWriter 99: 1 40 sun.nio.cs.StandardCharsets$Cache 100: 1 40 sun.nio.cs.UTF_8$Decoder 101: 1 40 sun.nio.cs.StandardCharsets$Classes 102: 1 40 java.io.BufferedInputStream 103: 1 40 sun.nio.cs.StandardCharsets$Aliases 104: 1 40 java.lang.ClassLoader$NativeLibrary 105: 1 32 sun.nio.cs.StandardCharsets 106: 1 32 java.io.FilePermission 107: 1 32 java.io.UnixFileSystem 108: 2 32 java.lang.Boolean 109: 2 32 java.nio.ByteOrder 110: 1 32 java.lang.ArithmeticException 111: 1 32 java.util.concurrent.atomic.AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl 112: 2 32 sun.net.www.protocol.jar.Handler 113: 1 32 java.lang.OutOfMemoryError[] 114: 1 32 java.security.Permissions 115: 1 32 java.io.FileInputStream 116: 1 32 java.lang.NullPointerException 117: 2 32 java.lang.StackTraceElement[] 118: 1 32 java.lang.StringCoding$StringEncoder 119: 1 32 java.security.BasicPermissionCollection 120: 1 32 java.lang.StringCoding$StringDecoder 121: 2 32 java.util.concurrent.atomic.AtomicInteger 122: 2 32 java.util.HashSet 123: 1 32 java.lang.ThreadGroup[] 124: 1 24 java.util.Collections$EmptyMap 125: 1 24 java.lang.ClassValue$Entry[] 126: 1 24 java.util.BitSet 127: 1 24 java.lang.StringBuilder 128: 1 24 java.lang.reflect.ReflectPermission 129: 1 24 sun.nio.cs.UTF_8 130: 1 24 sun.misc.URLClassPath$FileLoader 131: 1 24 java.io.FilePermissionCollection 132: 1 24 java.lang.reflect.Method[] 133: 1 24 java.util.Locale$Cache 134: 1 24 sun.util.locale.BaseLocale$Cache 135: 1 24 java.lang.invoke.MethodHandleImpl$4 136: 1 24 sun.launcher.LauncherHelper 137: 1 24 java.util.Collections$UnmodifiableRandomAccessList 138: 1 24 java.util.Collections$SetFromMap 139: 1 24 sun.launcher.LauncherHelper[] 140: 1 24 java.lang.ThreadLocal$ThreadLocalMap 141: 1 24 java.io.File$PathStatus[] 142: 1 24 java.lang.ClassValue$Version 143: 1 16 java.lang.ClassValue$Identity 144: 1 16 java.lang.invoke.MemberName$Factory 145: 1 16 java.security.ProtectionDomain$JavaSecurityAccessImpl 146: 1 16 java.nio.charset.CoderResult$1 147: 1 16 java.lang.reflect.ReflectAccess 148: 1 16 java.lang.Runtime 149: 1 16 java.security.ProtectionDomain$2 150: 1 16 java.nio.charset.CoderResult$2 151: 1 16 java.lang.invoke.MethodHandleImpl$3 152: 1 16 java.util.concurrent.atomic.AtomicBoolean 153: 1 16 sun.reflect.ReflectionFactory 154: 1 16 java.lang.ref.Reference$1 155: 1 16 java.io.FileDescriptor$1 156: 1 16 java.nio.Bits$1 157: 1 16 java.util.zip.ZipFile$1 158: 1 16 java.lang.CharacterDataLatin1 159: 1 16 sun.misc.Launcher$Factory 160: 1 16 java.net.URLClassLoader$7 161: 1 16 java.lang.String$CaseInsensitiveComparator 162: 1 16 java.lang.System$2 163: 1 16 sun.misc.Perf 164: 1 16 sun.misc.Launcher 165: 1 16 sun.misc.Unsafe 166: 1 16 java.lang.ref.Reference$Lock 167: 1 16 java.util.WeakHashMap$KeySet 168: 1 16 java.security.cert.Certificate[] 169: 1 16 java.util.Hashtable$EntrySet 170: 1 16 java.util.Collections$EmptyList 171: 1 16 java.util.Collections$EmptySet 172: 1 16 java.lang.Throwable[] 173: 1 16 java.lang.Terminator$1 174: 1 16 java.lang.invoke.MethodHandleImpl$2 175: 1 16 sun.net.www.protocol.file.Handler Total : 132037 6402448 Heap traversal took 4.82 seconds. abhijit@abhijit-VirtualBox:~$ ################################################################### 6uXX,7uXX,upto 8u66: ################## abhijit@abhijit-VirtualBox:~$ sudo /media/sf_ora/java/jdk1.8.0/bin/jmap -J-d64 -histo -F 2435 2>&1 Attaching to process ID 2435, please wait... Error attaching to process: sun.jvm.hotspot.runtime.VMVersionMismatchException: Supported versions are 25.0-b70. Target VM is 25.72-b12 sun.jvm.hotspot.debugger.DebuggerException: sun.jvm.hotspot.runtime.VMVersionMismatchException: Supported versions are 25.0-b70. Target VM is 25.72-b12 at sun.jvm.hotspot.HotSpotAgent.setupVM(HotSpotAgent.java:435) at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:305) at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:140) at sun.jvm.hotspot.tools.Tool.start(Tool.java:185) at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118) at sun.jvm.hotspot.tools.ObjectHistogram.main(ObjectHistogram.java:64) 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.runtime.VMVersionMismatchException: Supported versions are 25.0-b70. Target VM is 25.72-b12 at sun.jvm.hotspot.runtime.VM.checkVMVersion(VM.java:227) at sun.jvm.hotspot.runtime.VM.<init>(VM.java:294) at sun.jvm.hotspot.runtime.VM.initialize(VM.java:370) at sun.jvm.hotspot.HotSpotAgent.setupVM(HotSpotAgent.java:431) ... 11 more abhijit@abhijit-VirtualBox:~$
14-02-2016

Possible related issue: https://bugs.openjdk.java.net/browse/JDK-8073606
22-02-2015