akashche 02bc7e2
# HG changeset patch
akashche 02bc7e2
# User dsamersoff
akashche 02bc7e2
# Date 1403087398 25200
akashche 02bc7e2
#      Wed Jun 18 03:29:58 2014 -0700
akashche 02bc7e2
# Node ID 13411144d46b50d0087f35eca2b8e827aae558f1
akashche 02bc7e2
# Parent  10c9f8461c297a200ef57970c1f4c32d4081d790
akashche 02bc7e2
8044762, PR2960: com/sun/jdi/OptionTest.java test time out
akashche 02bc7e2
Summary: gdata could be NULL in debugInit_exit
akashche 02bc7e2
Reviewed-by: dcubed
akashche 02bc7e2
akashche 02bc7e2
diff -r 10c9f8461c29 -r 13411144d46b src/share/back/debugInit.c
akashche 02bc7e2
--- openjdk/jdk/src/share/back/debugInit.c	Fri May 20 19:42:05 2016 +0100
akashche 02bc7e2
+++ openjdk/jdk/src/share/back/debugInit.c	Wed Jun 18 03:29:58 2014 -0700
akashche 02bc7e2
@@ -1307,22 +1307,26 @@
akashche 02bc7e2
     if ( error != JVMTI_ERROR_NONE ) {
akashche 02bc7e2
         exit_code = 1;
akashche 02bc7e2
         if ( docoredump ) {
akashche 02bc7e2
+            LOG_MISC(("Dumping core as requested by command line"));
akashche 02bc7e2
             finish_logging(exit_code);
akashche 02bc7e2
             abort();
akashche 02bc7e2
         }
akashche 02bc7e2
     }
akashche 02bc7e2
+
akashche 02bc7e2
     if ( msg==NULL ) {
akashche 02bc7e2
         msg = "";
akashche 02bc7e2
     }
akashche 02bc7e2
 
akashche 02bc7e2
     LOG_MISC(("Exiting with error %s(%d): %s", jvmtiErrorText(error), error, msg));
akashche 02bc7e2
 
akashche 02bc7e2
-    gdata->vmDead = JNI_TRUE;
akashche 02bc7e2
+    if (gdata != NULL) {
akashche 02bc7e2
+        gdata->vmDead = JNI_TRUE;
akashche 02bc7e2
 
akashche 02bc7e2
-    /* Let's try and cleanup the JVMTI, if we even have one */
akashche 02bc7e2
-    if ( gdata->jvmti != NULL ) {
akashche 02bc7e2
-        /* Dispose of jvmti (gdata->jvmti becomes NULL) */
akashche 02bc7e2
-        disposeEnvironment(gdata->jvmti);
akashche 02bc7e2
+        /* Let's try and cleanup the JVMTI, if we even have one */
akashche 02bc7e2
+        if ( gdata->jvmti != NULL ) {
akashche 02bc7e2
+            /* Dispose of jvmti (gdata->jvmti becomes NULL) */
akashche 02bc7e2
+            disposeEnvironment(gdata->jvmti);
akashche 02bc7e2
+        }
akashche 02bc7e2
     }
akashche 02bc7e2
 
akashche 02bc7e2
     /* Finish up logging. We reach here if JDWP is doing the exiting. */