hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jzh...@apache.org
Subject hadoop git commit: HDFS-12494. libhdfs SIGSEGV in setTLSExceptionStrings. Contributed by John Zhuge.
Date Sat, 07 Oct 2017 07:04:26 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 5d63a388d -> 2856eb207


HDFS-12494. libhdfs SIGSEGV in setTLSExceptionStrings. Contributed by John Zhuge.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/2856eb20
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/2856eb20
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/2856eb20

Branch: refs/heads/trunk
Commit: 2856eb207bfb206f22a6266f42cad0257083ab94
Parents: 5d63a38
Author: John Zhuge <jzhuge@cloudera.com>
Authored: Wed Oct 4 22:55:01 2017 -0700
Committer: John Zhuge <jzhuge@apache.org>
Committed: Fri Oct 6 23:29:28 2017 -0700

----------------------------------------------------------------------
 .../src/main/native/libhdfs/jni_helper.c                | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/2856eb20/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs/jni_helper.c
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs/jni_helper.c
b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs/jni_helper.c
index e7c08aa..c45d598 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs/jni_helper.c
+++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs/jni_helper.c
@@ -522,19 +522,21 @@ JNIEnv* getJNIEnv(void)
     /* Create a ThreadLocalState for this thread */
     state = threadLocalStorageCreate();
     if (!state) {
+      mutexUnlock(&jvmMutex);
       fprintf(stderr, "getJNIEnv: Unable to create ThreadLocalState\n");
       return NULL;
     }
-    state->env = getGlobalJNIEnv();
-    mutexUnlock(&jvmMutex);
-    if (!state->env) {
-      goto fail;
-    }
     if (threadLocalStorageSet(state)) {
+      mutexUnlock(&jvmMutex);
       goto fail;
     }
     THREAD_LOCAL_STORAGE_SET_QUICK(state);
 
+    state->env = getGlobalJNIEnv();
+    mutexUnlock(&jvmMutex);
+    if (!state->env) {
+      goto fail;
+    }
     return state->env;
 
 fail:


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message