JDK-8213323 : sa/TestJmapCoreMetaspace.java and sa/TestJmapCore.java fail with ZGC
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 12
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86_64
  • Submitted: 2018-11-02
  • Updated: 2019-02-22
  • Resolved: 2018-12-04
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 12
12 b23Fixed
Related Reports
Cloners :  
Duplicate :  
Relates :  
Description
The following test failed in the jdk/jdk CI:

serviceability/sa/TestJmapCoreMetaspace.java

Here's a snippet from the log file:

----------System.out:(8/2064)----------
Command line: [/scratch/opt/mach5/mesos/work_dir/jib-master/install/jdk12-jdk.765/linux-x64-debug.jdk/jdk-12/fastdebug/bin/java -cp /scratch/opt/mach5/mesos/work_dir/slaves/2dd962d0-8988-479b-a804-57ab764ada59-S1286/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/fe39d8f5-fc7e-45b6-b5e2-16c89abb4f7b/runs/51fc07b3-4431-4386-8a86-963ce8a43824/testOutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_serviceability/classes/3/serviceability/sa/TestJmapCoreMetaspace.d:/scratch/opt/mach5/mesos/work_dir/jib-master/install/jdk12-jdk.765/src.full/open/test/hotspot/jtreg/serviceability/sa:/scratch/opt/mach5/mesos/work_dir/slaves/2dd962d0-8988-479b-a804-57ab764ada59-S1286/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/fe39d8f5-fc7e-45b6-b5e2-16c89abb4f7b/runs/51fc07b3-4431-4386-8a86-963ce8a43824/testOutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_serviceability/classes/3/test/lib:/scratch/opt/mach5/mesos/work_dir/jib-master/install/java/re/jtreg/4.2/promoted/all/b13/bundles/jtreg_bin-4.2.zip/jtreg/lib/javatest.jar:/scratch/opt/mach5/mesos/work_dir/jib-master/install/java/re/jtreg/4.2/promoted/all/b13/bundles/jtreg_bin-4.2.zip/jtreg/lib/jtreg.jar -XX:MaxRAMPercentage=6 -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:+IgnoreUnrecognizedVMOptions -XX:+CreateCoredumpOnCrash -Xmx512m -XX:MaxMetaspaceSize=64m -XX:+CrashOnOutOfMemoryError TestJmapCore metaspace ]
Run test with ulimit: unlimited
Found corefile: /scratch/opt/mach5/mesos/work_dir/slaves/2dd962d0-8988-479b-a804-57ab764ada59-S1286/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/fe39d8f5-fc7e-45b6-b5e2-16c89abb4f7b/runs/51fc07b3-4431-4386-8a86-963ce8a43824/testOutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_serviceability/scratch/2/./core.6246
Attaching to core ./core.6246 from executable /scratch/opt/mach5/mesos/work_dir/jib-master/install/jdk12-jdk.765/linux-x64-debug.jdk/jdk-12/fastdebug/bin/java, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 12-internal+0-jdk12-jdk.765

----------System.err:(37/2537)----------
Exception in thread "main" sun.jvm.hotspot.oops.UnknownOopException
	at jdk.hotspot.agent/sun.jvm.hotspot.oops.ObjectHeap.newOop(ObjectHeap.java:193)
	at jdk.hotspot.agent/sun.jvm.hotspot.oops.Klass.getJavaMirror(Klass.java:118)
	at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter$4.visit(HeapHprofBinWriter.java:1107)
	at jdk.hotspot.agent/sun.jvm.hotspot.classfile.ClassLoaderData.classesDo(ClassLoaderData.java:108)
	at jdk.hotspot.agent/sun.jvm.hotspot.classfile.ClassLoaderDataGraph.classesDo(ClassLoaderDataGraph.java:82)
	at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter.writeClasses(HeapHprofBinWriter.java:1104)
	at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter.write(HeapHprofBinWriter.java:434)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.writeHeapHprofBin(JMap.java:182)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.run(JMap.java:97)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:260)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.start(Tool.java:223)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
	at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.main(JMap.java:176)
	at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runJMAP(SALauncher.java:326)
	at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:455)

java.io.EOFException
	at java.base/java.io.DataInputStream.readFully(DataInputStream.java:202)
	at java.base/java.io.DataInputStream.readLong(DataInputStream.java:421)
	at jdk.test.lib.hprof.parser.HprofReader.readID(HprofReader.java:542)
	at jdk.test.lib.hprof.parser.HprofReader.read(HprofReader.java:230)
	at jdk.test.lib.hprof.parser.Reader.readFile(Reader.java:91)
	at jdk.test.lib.hprof.HprofParser.parse(HprofParser.java:85)
	at jdk.test.lib.hprof.HprofParser.parse(HprofParser.java:54)
	at TestJmapCore.test(TestJmapCore.java:140)
	at TestJmapCore.main(TestJmapCore.java:72)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:246)
	at java.base/java.lang.Thread.run(Thread.java:835)

JavaTest Message: Test threw exception: java.io.EOFException
JavaTest Message: shutting down test

result: Failed. Execution failed: `main' threw exception: java.io.EOFException


test result: Failed. Execution failed: `main' threw exception: java.io.EOFException
Comments
making changes to: 1. Bail out in HeapHprofBinWriter if the CollectedHeap type is ZCollectedHeap (corresponding to ZGC). 2. Have the test fail if no valid heap dump file is created and only if it is not ZGC.
29-11-2018

sa/TestJmapCoreMetaspace.java and sa/TestJmapCore.java fail with ZGC with various exceptions like: UnmappedAddressException, WrongTypeException, UnknownOopException, ClassCastException, etc Some stack trace snippets: Exception in thread "main" java.lang.ClassCastException: class sun.jvm.hotspot.oops.TypeArray cannot be cast to class sun.jvm.hotspot.oops.Instance (sun.jvm.hotspot.oops.TypeArray and sun.jvm.hotspot.oops.Instance are in module jdk.hotspot.agent of loader 'app') at jdk.hotspot.agent/sun.jvm.hotspot.oops.Klass.getJavaMirror(Klass.java:118) at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter$4.visit(HeapHprofBinWriter.java:1107) at jdk.hotspot.agent/sun.jvm.hotspot.classfile.ClassLoaderData.classesDo(ClassLoaderData.java:108) at jdk.hotspot.agent/sun.jvm.hotspot.classfile.ClassLoaderDataGraph.classesDo(ClassLoaderDataGraph.java:82) at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter.writeClasses(HeapHprofBinWriter.java:1104) at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter.write(HeapHprofBinWriter.java:434) at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.writeHeapHprofBin(JMap.java:182) at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.run(JMap.java:97) at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:260) at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.start(Tool.java:223) at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.execute(Tool.java:118) at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.main(JMap.java:176) at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runJMAP(SALauncher.java:326) at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:455) =========================================================================================================== Exception in thread "main" sun.jvm.hotspot.debugger.UnmappedAddressException: 223bc8bc at jdk.hotspot.agent/sun.jvm.hotspot.debugger.PageCache.checkPage(PageCache.java:208) at jdk.hotspot.agent/sun.jvm.hotspot.debugger.PageCache.getData(PageCache.java:63) at jdk.hotspot.agent/sun.jvm.hotspot.debugger.DebuggerBase.readBytes(DebuggerBase.java:225) at jdk.hotspot.agent/sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.readCInteger(LinuxDebuggerLocal.java:556) at jdk.hotspot.agent/sun.jvm.hotspot.debugger.DebuggerBase.readAddressValue(DebuggerBase.java:462) at jdk.hotspot.agent/sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.readAddress(LinuxDebuggerLocal.java:491) at jdk.hotspot.agent/sun.jvm.hotspot.debugger.linux.LinuxAddress.getAddressAt(LinuxAddress.java:74) at jdk.hotspot.agent/sun.jvm.hotspot.types.basic.BasicTypeDataBase.findDynamicTypeForAddress(BasicTypeDataBase.java:297) at jdk.hotspot.agent/sun.jvm.hotspot.runtime.VirtualBaseConstructor.instantiateWrapperFor(VirtualBaseConstructor.java:102) at jdk.hotspot.agent/sun.jvm.hotspot.oops.Metadata.instantiateWrapperFor(Metadata.java:73) at jdk.hotspot.agent/sun.jvm.hotspot.oops.Oop.getKlassForOopHandle(Oop.java:212) at jdk.hotspot.agent/sun.jvm.hotspot.oops.ObjectHeap.newOop(ObjectHeap.java:181) at jdk.hotspot.agent/sun.jvm.hotspot.oops.Klass.getJavaMirror(Klass.java:118) at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter$4.visit(HeapHprofBinWriter.java:1107) at jdk.hotspot.agent/sun.jvm.hotspot.classfile.ClassLoaderData.classesDo(ClassLoaderData.java:108) at jdk.hotspot.agent/sun.jvm.hotspot.classfile.ClassLoaderDataGraph.classesDo(ClassLoaderDataGraph.java:82) at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter.writeClasses(HeapHprofBinWriter.java:1104) at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter.write(HeapHprofBinWriter.java:434) at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.writeHeapHprofBin(JMap.java:182) at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.run(JMap.java:97) at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:260) at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.start(Tool.java:223) at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.execute(Tool.java:118) at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.main(JMap.java:176) at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runJMAP(SALauncher.java:326) at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:455)
03-11-2018