JDK-8164319 : CLHSDB dumpcodecache throws StackOverflowError
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-08-18
  • Updated: 2018-01-17
  • Resolved: 2016-08-19
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 9
9 b135Fixed
Related Reports
Relates :  
Description
I encountered StackOverflowError when I run dumpcodecache command in CLHSDB:

------------
hsdb> dumpcodecache
Exception in thread "main" java.lang.StackOverflowError
        at sun.jvm.hotspot.code.CodeBlob.getName(jdk.hotspot.agent@9-ea/CodeBlob.java:118)
        at sun.jvm.hotspot.code.CodeBlob.getName(jdk.hotspot.agent@9-ea/CodeBlob.java:118)
        at sun.jvm.hotspot.code.CodeBlob.getName(jdk.hotspot.agent@9-ea/CodeBlob.java:118)
        at sun.jvm.hotspot.code.CodeBlob.getName(jdk.hotspot.agent@9-ea/CodeBlob.java:118)
        at sun.jvm.hotspot.code.CodeBlob.getName(jdk.hotspot.agent@9-ea/CodeBlob.java:118)
            :
------------

CodeBlob#getName() calls itself recursively.
Thus it occurs StackOverflowError.
http://hg.openjdk.java.net/jdk9/hs/hotspot/file/e99e410e78e1/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeBlob.java#l117

Comments
Bug was introduced by the changeset pushed under JDK-8151956 - unfortunately that was the wrong bug number! Changeset info: 8151956: Support non-continuous CodeBlobs in HotSpot Reviewed-by: iveresov, thartmann, simonis
19-08-2016