From ac956f2bead62334ad8d1ea2fcf5e0976c47d813 Mon Sep 17 00:00:00 2001 From: Tomas Kolda Date: Fri, 15 Jan 2021 16:30:36 -0800 Subject: [PATCH] S390 Linux is failing tests ColumnFamilyOptionsTest.cfPaths (#7853) Summary: Fix ColumnFamilyOptionsTest.cfPaths and OptionsTest.cfPaths in 6.15 branch (and probably other branches including master) has_exception variable was not initialized which was causing test failures and incorrect behavior on s390 platform (and maybe others as variable content is undefined). adamretter please take a look. Pull Request resolved: https://github.com/facebook/rocksdb/pull/7853 Reviewed By: akankshamahajan15 Differential Revision: D25901639 Pulled By: jay-zhuang fbshipit-source-id: 151b5db27b495fc6d8ed54c0eccbde2508215ac5 --- java/rocksjni/concurrent_task_limiter.cc | 2 +- java/rocksjni/options.cc | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/java/rocksjni/concurrent_task_limiter.cc b/java/rocksjni/concurrent_task_limiter.cc index ddcdda478e..591f721a2f 100644 --- a/java/rocksjni/concurrent_task_limiter.cc +++ b/java/rocksjni/concurrent_task_limiter.cc @@ -15,7 +15,7 @@ */ jlong Java_org_rocksdb_ConcurrentTaskLimiterImpl_newConcurrentTaskLimiterImpl0( JNIEnv* env, jclass, jstring jname, jint limit) { - jboolean has_exception; + jboolean has_exception = JNI_FALSE; std::string name = ROCKSDB_NAMESPACE::JniUtil::copyStdString(env, jname, &has_exception); if (JNI_TRUE == has_exception) { diff --git a/java/rocksjni/options.cc b/java/rocksjni/options.cc index b11edf7fcf..fbf3241792 100644 --- a/java/rocksjni/options.cc +++ b/java/rocksjni/options.cc @@ -945,6 +945,7 @@ rocksdb_convert_cf_paths_from_java_helper(JNIEnv* env, jobjectArray path_array, jlong* size_array_ptr = env->GetLongArrayElements(size_array, nullptr); if (nullptr == size_array_ptr) { // exception thrown: OutOfMemoryError + *has_exception = JNI_TRUE; return {}; } std::vector cf_paths; @@ -977,7 +978,7 @@ void Java_org_rocksdb_Options_setCfPaths(JNIEnv* env, jclass, jlong jhandle, jobjectArray path_array, jlongArray size_array) { auto* options = reinterpret_cast(jhandle); - jboolean has_exception; + jboolean has_exception = JNI_FALSE; std::vector cf_paths = rocksdb_convert_cf_paths_from_java_helper(env, path_array, size_array, &has_exception); @@ -4142,7 +4143,7 @@ void Java_org_rocksdb_ColumnFamilyOptions_setCfPaths(JNIEnv* env, jclass, jlongArray size_array) { auto* options = reinterpret_cast(jhandle); - jboolean has_exception; + jboolean has_exception = JNI_FALSE; std::vector cf_paths = rocksdb_convert_cf_paths_from_java_helper(env, path_array, size_array, &has_exception);