JDK-8192897 : SA: NPE occurs on clhsdb jstack
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 10
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-12-01
  • Updated: 2018-02-07
  • Resolved: 2017-12-05
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 10 JDK 11
10 b36Fixed 11Fixed
Related Reports
Relates :  
Description
NPE occurs clhsdb jstack as below:

----------------
hsdb> jstack
Deadlock Detection:

No deadlocks found.

"NonBlockingInputStreamThread" #27 daemon prio=5 tid=0x00007f0924674000 nid=0xf429 in Object.wait() [0x00007f08cf6fd000]
   java.lang.Thread.State: WAITING (on object monitor)
   JavaThread state: _thread_blocked
 - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be imprecise)
        - waiting on <no object reference available>
Error occurred during stack walking:
java.lang.NullPointerException
        at jdk.hotspot.agent/sun.jvm.hotspot.runtime.CompiledVFrame.getMonitors(CompiledVFrame.java:131)
        at jdk.hotspot.agent/sun.jvm.hotspot.runtime.JavaVFrame.printLockInfo(JavaVFrame.java:125)
        at jdk.hotspot.agent/sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:114)
        at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor$26.doit(CommandProcessor.java:1073)
        at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.executeCommand(CommandProcessor.java:1964)
        at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.executeCommand(CommandProcessor.java:1934)
        at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.run(CommandProcessor.java:1814)
        at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.run(CLHSDB.java:99)
        at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.main(CLHSDB.java:40)
        at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runCLHSDB(SALauncher.java:191)
        at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:439)
----------------

It is caused by CompiledVFrame#getScope() returns null.
We should consider it at CompiledVFrame#getMonitors().
Comments
Review request: http://mail.openjdk.java.net/pipermail/serviceability-dev/2017-December/022487.html
01-12-2017