JDK-6426402 : JDWP: Unexpected JDWP Error in VirtualMachine.instanceCounts()
  • Type: Bug
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-05-16
  • Updated: 2011-03-08
  • 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
6u2Fixed 7 b03Fixed
Description
Failing test name:
	nsk/jdi/VirtualMachine/instanceCounts/instancecounts003
Test scenario:

Debugee VM load 2 classes with custom class loader, remove all references to this classes and try unload its forcing garbage collection.

Debugger VM call VirtualMachine.instanceCount() for classes which should be loaded in debugee VM with custom classloader until catch VMDisconnectedException.

Sometimes VirtualMachine.instanceCount() throws unexpected com.sun.jdi.InternalException. Fail reproduces intermittently(~1 of 10).

Test output:

>>>Classes was loaded
>>>Force GC
Unexpected exception:
com.sun.jdi.InternalException: Unexpected JDWP Error: 113
        at com.sun.tools.jdi.JDWPException.toJDIException(JDWPException.java:47)
        at com.sun.tools.jdi.VirtualMachineImpl.instanceCounts(VirtualMachineImpl.java:515)
        at UnloadClassTest.main(UnloadClassTest.java:229)


Test is attached

Comments
SUGGESTED FIX ------- util.c ------- 2606a2607 > error = JVMTI_ERROR_NONE;
22-05-2006

EVALUATION There are times when the test debugger passes a list of classes to InstanceCounts where all the classes in the list are not loaded. This causes the error return code to not be initialized which causes the error 113 to occur. I think the testcase has a problem too - still investigating that.
22-05-2006