United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6525646 (JDWP) ThreadReference.OwnedMonitorsStackDepthInfo returns invalid error when passed thread is null
JDK-6525646 : (JDWP) ThreadReference.OwnedMonitorsStackDepthInfo returns invalid error when passed thread is null

Details
Type:
Bug
Submit Date:
2007-02-15
Status:
Closed
Updated Date:
2012-03-22
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
core-svc
OS:
generic
Sub-Component:
debugger
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Backport:
Relates:

Sub Tasks

Description
The JDWP 1.6 specification at:
  http://java.sun.com/javase/6/docs/platform/jpda/jdwp/jdwp-protocol.html#JDWP_ThreadReference_OwnedMonitorsStackDepthInfo  
states as follows:
  ... 
  INVALID_THREAD	Passed thread is null, is not a valid thread or has exited.
  ...

However, test shows that if passed thread reference is null then the ThreadReference.OwnedMonitorsStackDepthInfo command
returns NOT_SUSPENDED error code instead of INVALID_THREAD. 

Note that this command returns correct INVALID_THREAD error code:
  - for non-thread object reference (not a valid thread)
  - for a thread which has exited but was suspended before.

                                    

Comments
EVALUATION

See description.  Implementation does not match the spec.
                                     
2007-03-14
EVALUATION

For the problem mentioned in the Comments, see
   6579357: JDWP:  Commands that require threads to be suspended may not return correct error codes
                                     
2007-07-11
SUGGESTED FIX

In ThreadReferenceImpl.c, function 
   ownedMonitorsWithStackDepth(PacketInputStream *in, PacketOutputStream *out)

if 'thread' is null , return JDWP_ERROR(INVALID_THREAD).
                                     
2007-07-11



Hardware and Software, Engineered to Work Together