This is an automated email from the ASF dual-hosted git repository.

morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new 317e591b129 branch-3.1: [fix](be-jni-env) Fix 
java.lang.StackOverflowError thrown from the UncaughtExceptionHandler in thread 
"process reaper". #52821 (#52854)
317e591b129 is described below

commit 317e591b129de7d4d9603735eca587223cdef8d2
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Jul 8 14:44:43 2025 +0800

    branch-3.1: [fix](be-jni-env) Fix java.lang.StackOverflowError thrown from 
the UncaughtExceptionHandler in thread "process reaper". #52821 (#52854)
    
    Cherry-picked from #52821
    
    Co-authored-by: Qi Chen <[email protected]>
---
 be/src/common/config.cpp | 3 +++
 be/src/common/config.h   | 3 +++
 be/src/util/jni-util.cpp | 4 ++++
 3 files changed, 10 insertions(+)

diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp
index e521597bc27..52a7b420c55 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -1224,6 +1224,9 @@ DEFINE_mString(kerberos_krb5_conf_path, "/etc/krb5.conf");
 // Deprecated
 DEFINE_mInt32(kerberos_refresh_interval_second, "43200");
 
+// JDK-8153057: avoid StackOverflowError thrown from the 
UncaughtExceptionHandler in thread "process reaper"
+DEFINE_mBool(jdk_process_reaper_use_default_stack_size, "true");
+
 DEFINE_mString(get_stack_trace_tool, "libunwind");
 DEFINE_mString(dwarf_location_info_mode, "FAST");
 DEFINE_mBool(enable_address_sanitizers_with_stack_trace, "true");
diff --git a/be/src/common/config.h b/be/src/common/config.h
index 9844a832500..f575d74df15 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -1273,6 +1273,9 @@ DECLARE_mString(kerberos_krb5_conf_path);
 // the interval for renew kerberos ticket cache
 DECLARE_mInt32(kerberos_refresh_interval_second);
 
+// JDK-8153057: avoid StackOverflowError thrown from the 
UncaughtExceptionHandler in thread "process reaper"
+DECLARE_mBool(jdk_process_reaper_use_default_stack_size);
+
 // Values include `none`, `glog`, `boost`, `glibc`, `libunwind`
 DECLARE_mString(get_stack_trace_tool);
 DECLARE_mBool(enable_address_sanitizers_with_stack_trace);
diff --git a/be/src/util/jni-util.cpp b/be/src/util/jni-util.cpp
index c1b91d10d53..deeef44581c 100644
--- a/be/src/util/jni-util.cpp
+++ b/be/src/util/jni-util.cpp
@@ -101,6 +101,8 @@ const std::string GetKerb5ConfPath() {
     std::string libhdfs_opts = getenv("LIBHDFS_OPTS") ? getenv("LIBHDFS_OPTS") 
: "";
     CHECK(libhdfs_opts != "") << "LIBHDFS_OPTS is not set";
     libhdfs_opts += fmt::format(" {} ", GetKerb5ConfPath());
+    libhdfs_opts += fmt::format(" 
-Djdk.lang.processReaperUseDefaultStackSize{}",
+                                
config::jdk_process_reaper_use_default_stack_size);
     setenv("LIBHDFS_OPTS", libhdfs_opts.c_str(), 1);
     LOG(INFO) << "set final LIBHDFS_OPTS: " << libhdfs_opts;
 }
@@ -118,6 +120,8 @@ const std::string GetKerb5ConfPath() {
                     GetDorisJNIClasspathOption(), fmt::format("-Xmx{}", "1g"),
                     fmt::format("-DlogPath={}/log/jni.log", 
getenv("DORIS_HOME")),
                     fmt::format("-Dsun.java.command={}", "DorisBE"), 
"-XX:-CriticalJNINatives",
+                    
fmt::format("-Djdk.lang.processReaperUseDefaultStackSize{}",
+                                
config::jdk_process_reaper_use_default_stack_size),
 #ifdef __APPLE__
                     // On macOS, we should disable MaxFDLimit, otherwise the 
RLIMIT_NOFILE
                     // will be assigned the minimum of OPEN_MAX (10240) and 
rlim_cur (See src/hotspot/os/bsd/os_bsd.cpp)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to