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.
6u4Fixed 7 b17Fixed
Related Reports
Relates :  
The JDWP 1.6 specification at:
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.

EVALUATION For the problem mentioned in the Comments, see 6579357: JDWP: Commands that require threads to be suspended may not return correct error codes

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

EVALUATION See description. Implementation does not match the spec.