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

kerwinzhang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git


The following commit(s) were added to refs/heads/main by this push:
     new 4b741cf61a [GLUTEN-8685][VL] Add null check to avoid core dump when 
rss push partition data size is large (#8686)
4b741cf61a is described below

commit 4b741cf61a74ec71e0ed3a986bf659ed9469cfad
Author: Terry Wang <[email protected]>
AuthorDate: Mon Feb 10 17:22:45 2025 +0800

    [GLUTEN-8685][VL] Add null check to avoid core dump when rss push partition 
data size is large (#8686)
---
 cpp/core/jni/JniCommon.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/cpp/core/jni/JniCommon.h b/cpp/core/jni/JniCommon.h
index 8f40398a41..246658834d 100644
--- a/cpp/core/jni/JniCommon.h
+++ b/cpp/core/jni/JniCommon.h
@@ -498,6 +498,10 @@ class JavaRssClient : public RssClient {
       env->ReleaseByteArrayElements(array_, byteArray, JNI_ABORT);
       env->DeleteGlobalRef(array_);
       array_ = env->NewByteArray(size);
+      if (array_ == nullptr) {
+        LOG(WARNING) << "Failed to allocate new byte array size: " << size;
+        throw gluten::GlutenException("Failed to allocate new byte array");
+      }
       array_ = static_cast<jbyteArray>(env->NewGlobalRef(array_));
     }
     env->SetByteArrayRegion(array_, 0, size, (jbyte*)bytes);


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

Reply via email to