8143921: nsk/jdi/ObjectReference/waitingThreads/waitingthreads003 fails with JVMTI_ERROR_INVALID_CLASS
authordsamersoff
Thu, 21 Apr 2016 13:18:46 +0300
changeset 38334 ccb5cb0c8132
parent 38333 79082eaec3eb
child 38338 f3909e996a6a
8143921: nsk/jdi/ObjectReference/waitingThreads/waitingthreads003 fails with JVMTI_ERROR_INVALID_CLASS Summary: Skip invalid classes Reviewed-by: sspitsyn
jdk/src/jdk.jdwp.agent/share/native/libjdwp/VirtualMachineImpl.c
--- a/jdk/src/jdk.jdwp.agent/share/native/libjdwp/VirtualMachineImpl.c	Wed Apr 20 15:09:39 2016 +0000
+++ b/jdk/src/jdk.jdwp.agent/share/native/libjdwp/VirtualMachineImpl.c	Thu Apr 21 13:18:46 2016 +0300
@@ -126,7 +126,7 @@
             int writtenCount = 0;
             int i;
 
-            for (i=0; i<classCount; i++) {
+            for (i = 0; i < classCount; i++) {
                 jclass clazz = theClasses[i];
                 jint status = classStatus(clazz);
                 char *candidate_signature = NULL;
@@ -141,7 +141,13 @@
 
                 error = classSignature(clazz, &candidate_signature, NULL);
                 if (error != JVMTI_ERROR_NONE) {
-                    break;
+                  // Clazz become invalid since the time we get the class list
+                  // Skip this entry
+                  if (error == JVMTI_ERROR_INVALID_CLASS) {
+                    continue;
+                  }
+
+                  break;
                 }
 
                 if (strcmp(candidate_signature, signature) == 0) {