This is an automated email from the ASF dual-hosted git repository.
weichiu pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new cb0fa0c HDFS-14321. Fix -Xcheck:jni issues in libhdfs, run ctest with
-Xcheck:jni enabled. Contributed by Sahil Takiar.
cb0fa0c is described below
commit cb0fa0ce3f1d836080d68d527ce0659ce0e33e8c
Author: Sahil Takiar <[email protected]>
AuthorDate: Mon Mar 4 12:36:00 2019 -0800
HDFS-14321. Fix -Xcheck:jni issues in libhdfs, run ctest with -Xcheck:jni
enabled. Contributed by Sahil Takiar.
Signed-off-by: Wei-Chiu Chuang <[email protected]>
---
hadoop-hdfs-project/hadoop-hdfs-native-client/pom.xml | 1 +
.../hadoop-hdfs-native-client/src/main/native/libhdfs/hdfs.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/pom.xml
b/hadoop-hdfs-project/hadoop-hdfs-native-client/pom.xml
index d54341b..0482071 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-native-client/pom.xml
+++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/pom.xml
@@ -243,6 +243,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd">
<exec executable="ctest" failonerror="true"
dir="${project.build.directory}/">
<arg line="--output-on-failure"/>
<arg line="${native_ctest_args}"/>
+ <env key="LIBHDFS_OPTS" value="${env.LIBHDFS_OPTS}
-Xcheck:jni"/>
<env key="CLASSPATH"
value="${test_classpath}:${compile_classpath}"/>
<!-- Make sure libhadoop.so is on LD_LIBRARY_PATH. -->
<env key="LD_LIBRARY_PATH"
value="${env.LD_LIBRARY_PATH}:${project.build.directory}/native/target/usr/local/lib:${hadoop.common.build.dir}/native/target/usr/local/lib"/>
diff --git
a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs/hdfs.c
b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs/hdfs.c
index 9c2ee8c..0cced97 100644
---
a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs/hdfs.c
+++
b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs/hdfs.c
@@ -2508,7 +2508,7 @@ int hadoopRzOptionsSetByteBufferPool(
// Delete any previous ByteBufferPool we had.
(*env)->DeleteGlobalRef(env, opts->byteBufferPool);
}
- opts->byteBufferPool = byteBufferPool;
+ opts->byteBufferPool = (*env)->NewGlobalRef(env, byteBufferPool);
return 0;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]