8161431: JNI pending exceptions in ProcessHandleImpl_linux.c and ProcessHandleImpl_unix.c
Reviewed-by: naoto
--- a/jdk/src/java.base/linux/native/libjava/ProcessHandleImpl_linux.c Mon Aug 08 20:16:53 2016 +0300
+++ b/jdk/src/java.base/linux/native/libjava/ProcessHandleImpl_linux.c Mon Aug 08 13:55:16 2016 -0400
@@ -146,6 +146,7 @@
snprintf(fn, sizeof fn, "/proc/%d", pid);
if (stat(fn, &stat_buf) == 0) {
unix_getUserInfo(env, jinfo, stat_buf.st_uid);
+ JNU_CHECK_EXCEPTION(env);
}
/*
--- a/jdk/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c Mon Aug 08 20:16:53 2016 +0300
+++ b/jdk/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c Mon Aug 08 13:55:16 2016 -0400
@@ -429,7 +429,9 @@
if (nargs >= 1) {
// Create a String array for nargs-1 elements
- argsArray = (*env)->NewObjectArray(env, nargs - 1, JNU_ClassString(env), NULL);
+ jclass clazzString = JNU_ClassString(env);
+ CHECK_NULL(clazzString);
+ argsArray = (*env)->NewObjectArray(env, nargs - 1, clazzString, NULL);
CHECK_NULL(argsArray);
for (i = 0; i < nargs - 1; i++) {