JDK-8176557 : serviceability/sa/TestJmapCore.java fails with java.lang.RuntimeException: Heap segment size overflow.
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 9,11,12
  • Priority: P3
  • Status: Closed
  • Resolution: Cannot Reproduce
  • Submitted: 2017-03-13
  • Updated: 2020-03-16
  • Resolved: 2020-03-16
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.
Other
tbdResolved
Related Reports
Relates :  
Relates :  
Description
Similar issue recently fixed: JDK-8171084

[2017-03-12T15:44:23.11] Dumping core ...
[2017-03-12T15:45:11.78] /export/home/aginfra/sandbox/results/ResultDir/JMapHeapCore/run.sh: line 30: 23131 Aborted                 (core dumped) ${JAVA} ${JAVA_OPTS} heapdump.share.EatMemory -core
[2017-03-12T15:45:11.78] Found core file: core.23131
[2017-03-12T15:45:12.20] Attaching to core core.23131 from executable /export/home/aginfra/CommonData/TEST_JAVA_HOME/bin/java, please wait...
[2017-03-12T15:45:14.01] Debugger attached successfully.
[2017-03-12T15:45:14.01] Server compiler detected.
[2017-03-12T15:45:14.01] JVM version is 9-internal+0-2017-03-12-072902.jesper.dev2104-hs
[2017-03-12T15:46:21.21] WARNING: Cannot dump array of type Object with length 1073741823; truncating to length 536870909
[2017-03-12T15:47:20.58] Exception in thread "main" java.lang.RuntimeException: Heap segment size overflow.
[2017-03-12T15:47:20.58] 	at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter.fillInHeapRecordLength(HeapHprofBinWriter.java:495)
[2017-03-12T15:47:20.58] 	at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter.writeHeapRecordEpilogue(HeapHprofBinWriter.java:479)
[2017-03-12T15:47:20.58] 	at jdk.hotspot.agent/sun.jvm.hotspot.utilities.AbstractHeapGraphWriter$1.doObj(AbstractHeapGraphWriter.java:101)
[2017-03-12T15:47:20.58] 	at jdk.hotspot.agent/sun.jvm.hotspot.oops.ObjectHeap.iterateLiveRegions(ObjectHeap.java:354)
[2017-03-12T15:47:20.58] 	at jdk.hotspot.agent/sun.jvm.hotspot.oops.ObjectHeap.iterate(ObjectHeap.java:172)
[2017-03-12T15:47:20.58] 	at jdk.hotspot.agent/sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.write(AbstractHeapGraphWriter.java:51)
[2017-03-12T15:47:20.58] 	at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter.write(HeapHprofBinWriter.java:433)
[2017-03-12T15:47:20.58] 	at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.writeHeapHprofBin(JMap.java:182)
[2017-03-12T15:47:20.58] 	at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.run(JMap.java:97)
[2017-03-12T15:47:20.58] 	at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:260)
[2017-03-12T15:47:20.58] 	at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.start(Tool.java:223)
[2017-03-12T15:47:20.58] 	at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
[2017-03-12T15:47:20.58] 	at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.main(JMap.java:176)
[2017-03-12T15:47:20.58] 	at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runJMAP(SALauncher.java:326)
[2017-03-12T15:47:20.58] 	at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:455)
[2017-03-12T15:47:22.43] jmap exited with exit status 1
Comments
Closing since it not longer seems to reproduce in mach5, and not recent sightings by anyone.
16-03-2020

There are 2 different issues here. 1. TestJmapCore.java issues with ZGC (UnmappedAddressException, WrongTypeException, etc). Will open a different one for this. 2. The original TestJmapCore issue while trying to dump heap from a corefile with a very large heap containing large arrays. (java.lang.RuntimeException: Heap segment size overflow)
01-11-2018

Here's a log snippet from the jdk12-jdk-708-tier3 CI job set failure: ----------System.out:(8/2055)---------- Command line: [/scratch/opt/mach5/mesos/work_dir/jib-master/install/jdk12-jdk.708/linux-x64-debug.jdk/jdk-12/fastdebug/bin/java -cp /scratch/opt/mach5/mesos/work_dir/slaves/83bb4d84-382c-4ead-b585-d8ef0018fefe-S11810/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/1d100d7a-3c6d-4432-a781-8c641af6ae51/runs/1ea53094-f640-495f-9d67-84f85bd9a273/testOutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_serviceability/classes/1/serviceability/sa/TestJmapCore.d:/scratch/opt/mach5/mesos/work_dir/jib-master/install/jdk12-jdk.708/src.full/open/test/hotspot/jtreg/serviceability/sa:/scratch/opt/mach5/mesos/work_dir/slaves/83bb4d84-382c-4ead-b585-d8ef0018fefe-S11810/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/1d100d7a-3c6d-4432-a781-8c641af6ae51/runs/1ea53094-f640-495f-9d67-84f85bd9a273/testOutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_serviceability/classes/1/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=8 -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:+IgnoreUnrecognizedVMOptions -XX:+CreateCoredumpOnCrash -Xmx512m -XX:MaxMetaspaceSize=64m -XX:+CrashOnOutOfMemoryError TestJmapCore heap ] Run test with ulimit: unlimited Found corefile: /scratch/opt/mach5/mesos/work_dir/slaves/83bb4d84-382c-4ead-b585-d8ef0018fefe-S11810/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/1d100d7a-3c6d-4432-a781-8c641af6ae51/runs/1ea53094-f640-495f-9d67-84f85bd9a273/testOutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_serviceability/scratch/0/./core.11857 Attaching to core ./core.11857 from executable /scratch/opt/mach5/mesos/work_dir/jib-master/install/jdk12-jdk.708/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.708 ----------System.err:(46/3522)---------- 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) java.io.EOFException at java.base/java.io.DataInputStream.readInt(DataInputStream.java:397) at jdk.test.lib.hprof.parser.HprofReader.read(HprofReader.java:203) 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:566) 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
24-10-2018

bug is not intermittent. It always fails on specific host configuration.
29-06-2018

This failure reproduced always with large heaps. We have 2 cores, 60G in mach5 where test fails. Might be it would be useful to make specific test with large heap as a regression test for this bug. It is unclear only how to don't run concurrently on the host with a large number cores.
20-06-2018

New test serviceability/sa/TestJmapCore.java failed with same assertion WARNING: Cannot dump array of type Object with length 1073741823; truncating to length 536870908 WARNING: Cannot dump array of type Object with length 1073741823; truncating to length 536870909 Exception in thread "main" java.lang.RuntimeException: Heap segment size overflow. at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter.fillInHeapRecordLength(HeapHprofBinWriter.java:502) at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter.writeHeapRecordEpilogue(HeapHprofBinWriter.java:486) at jdk.hotspot.agent/sun.jvm.hotspot.utilities.AbstractHeapGraphWriter$1.doObj(AbstractHeapGraphWriter.java:102) at jdk.hotspot.agent/sun.jvm.hotspot.oops.ObjectHeap.iterateLiveRegions(ObjectHeap.java:355) at jdk.hotspot.agent/sun.jvm.hotspot.oops.ObjectHeap.iterate(ObjectHeap.java:173) at jdk.hotspot.agent/sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.write(AbstractHeapGraphWriter.java:52) at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter.write(HeapHprofBinWriter.java:440) 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.readInt(DataInputStream.java:397) at jdk.test.lib.hprof.parser.HprofReader.read(HprofReader.java:206) 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:139) at TestJmapCore.main(TestJmapCore.java:70) 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:566) at com.sun.javatest.regtest.agent.MainActionHelper$SameVMRunnable.run(MainActionHelper.java:229) at java.base/java.lang.Thread.run(Thread.java:832) 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: Error. failed to clean up files after test
15-06-2018