HDFS-14321. Fix -Xcheck:jni issues in libhdfs, run ctest with -Xcheck:jni enabled. Contributed by Sahil Takiar.

Signed-off-by: Wei-Chiu Chuang <weichiu@apache.org>
This commit is contained in:
Sahil Takiar 2019-03-04 12:36:00 -08:00 committed by Wei-Chiu Chuang
parent 10b802b84b
commit cb0fa0ce3f
2 changed files with 2 additions and 1 deletions

View File

@ -243,6 +243,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd">
<exec executable="ctest" failonerror="true" dir="${project.build.directory}/"> <exec executable="ctest" failonerror="true" dir="${project.build.directory}/">
<arg line="--output-on-failure"/> <arg line="--output-on-failure"/>
<arg line="${native_ctest_args}"/> <arg line="${native_ctest_args}"/>
<env key="LIBHDFS_OPTS" value="${env.LIBHDFS_OPTS} -Xcheck:jni"/>
<env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/> <env key="CLASSPATH" value="${test_classpath}:${compile_classpath}"/>
<!-- Make sure libhadoop.so is on LD_LIBRARY_PATH. --> <!-- 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"/> <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"/>

View File

@ -2508,7 +2508,7 @@ int hadoopRzOptionsSetByteBufferPool(
// Delete any previous ByteBufferPool we had. // Delete any previous ByteBufferPool we had.
(*env)->DeleteGlobalRef(env, opts->byteBufferPool); (*env)->DeleteGlobalRef(env, opts->byteBufferPool);
} }
opts->byteBufferPool = byteBufferPool; opts->byteBufferPool = (*env)->NewGlobalRef(env, byteBufferPool);
return 0; return 0;
} }