JDK-6525646 : (JDWP) ThreadReference.OwnedMonitorsStackDepthInfo returns invalid error when passed thread is null
  • Type: Bug
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2007-02-15
  • Updated: 2012-03-22
  • Resolved: 2011-03-08
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
6u4Fixed 7 b17Fixed
Related Reports
Relates :  
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 For the problem mentioned in the Comments, see 6579357: JDWP: Commands that require threads to be suspended may not return correct error codes
11-07-2007

SUGGESTED FIX In ThreadReferenceImpl.c, function ownedMonitorsWithStackDepth(PacketInputStream *in, PacketOutputStream *out) if 'thread' is null , return JDWP_ERROR(INVALID_THREAD).
11-07-2007

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