JDK-6843580 : JavaThread.getStackBase throws sun.jvm.hotspot.WrongTypeException invoked by jstack
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc
  • Affected Version: 6u14
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2009-05-20
  • Updated: 2010-04-02
  • Resolved: 2009-05-21
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 6 JDK 7 Other
6u14 b08Fixed 7Fixed hs14Fixed
Related Reports
Relates :  
Description
The attached program is using jstack to detect the deadlock, but it failed with the following exception:

sun.jvm.hotspot.types.WrongTypeException
   at sun.jvm.hotspot.types.basic.BasicField.getAddress(BasicField.java:246)
   at sun.jvm.hotspot.types.basic.BasicAddressFieldWrapper.getValue(BasicAddressFieldWrapper.java:48)
   at sun.jvm.hotspot.runtime.JavaThread.getStackBase(JavaThread.java:320)
   at sun.jvm.hotspot.runtime.JavaThread.isLockOwned(JavaThread.java:368)
   at sun.jvm.hotspot.runtime.Threads.owningThreadFromMonitor(Threads.java:168)
   at sun.jvm.hotspot.runtime.Threads.owningThreadFromMonitor(Threads.java:175)
   at sun.jvm.hotspot.runtime.DeadlockDetector.print(DeadlockDetector.java:90)
   at sun.jvm.hotspot.runtime.DeadlockDetector.print(DeadlockDetector.java:39)
   at sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:52)
   at sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:45)
   at sun.jvm.hotspot.tools.JStack.run(JStack.java:60)
   at sun.jvm.hotspot.tools.Tool.start(Tool.java:221)
   at sun.jvm.hotspot.tools.JStack.main(JStack.java:86)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:623)
   at sun.tools.jstack.JStack.runJStackTool(JStack.java:136)
   at sun.tools.jstack.JStack.main(JStack.java:102)

Comments
EVALUATION The bug is verified in hs16b04.
15-06-2009

EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/f1f3a2719a55
23-05-2009

EVALUATION The getStackBase() & getStackSize() method missed to call the getValue with the addr argument. The fix is trivial.
20-05-2009