8054194: jstack crash: assert(handle != NULL) failed: JNI handle should not be null
authordsamersoff
Thu, 25 Sep 2014 02:48:25 -0700
changeset 26924 8b20f1c5af93
parent 26923 60c1555c25c5
child 26926 0e8a2ce8817a
8054194: jstack crash: assert(handle != NULL) failed: JNI handle should not be null Summary: Add better error check to sa to avoid secondary crash Reviewed-by: sla, jbachorik, sspitsyn
hotspot/agent/src/os/win32/windbg/sawindbg.cpp
--- a/hotspot/agent/src/os/win32/windbg/sawindbg.cpp	Mon Sep 22 18:34:35 2014 +0400
+++ b/hotspot/agent/src/os/win32/windbg/sawindbg.cpp	Thu Sep 25 02:48:25 2014 -0700
@@ -318,12 +318,18 @@
 
   path = (jstring) env->GetStaticObjectField(clazz, imagePath_ID);
   CHECK_EXCEPTION_(false);
+  if (path == NULL) {
+     THROW_NEW_DEBUGGER_EXCEPTION_("Windbg Error: not able to get imagePath field ID!", false);
+  }
   buf = env->GetStringUTFChars(path, &isCopy);
   CHECK_EXCEPTION_(false);
   AutoJavaString imagePath(env, path, buf);
 
   path = (jstring) env->GetStaticObjectField(clazz, symbolPath_ID);
   CHECK_EXCEPTION_(false);
+  if (path == NULL) {
+     THROW_NEW_DEBUGGER_EXCEPTION_("Windbg Error: not able to get symbolPath field ID!", false);
+  }
   buf = env->GetStringUTFChars(path, &isCopy);
   CHECK_EXCEPTION_(false);
   AutoJavaString symbolPath(env, path, buf);