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
--- 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);