United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6843580 JavaThread.getStackBase throws sun.jvm.hotspot.WrongTypeException invoked by jstack
JDK-6843580 : JavaThread.getStackBase throws sun.jvm.hotspot.WrongTypeException invoked by jstack

Details
Type:
Bug
Submit Date:
2009-05-20
Status:
Resolved
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2009-05-21
Component:
hotspot
OS:
generic
Sub-Component:
svc
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6u14
Fixed Versions:
6u14 (b08)

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Relates:

Sub Tasks

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 getStackBase() & getStackSize() method missed to call the getValue with the addr argument. The fix is trivial.
                                     
2009-05-20
EVALUATION

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

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



Hardware and Software, Engineered to Work Together