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

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


The following commit(s) were added to refs/heads/branch-4.1 by this push:
     new 089dfabfb07 branch-4.1: [Fix](arrow flight) Fix arrow::Status inline 
static empty msg core (#63191) (#63267)
089dfabfb07 is described below

commit 089dfabfb0761365a7158e98e16909f101599d95
Author: linrrarity <[email protected]>
AuthorDate: Wed May 20 18:21:23 2026 +0800

    branch-4.1: [Fix](arrow flight) Fix arrow::Status inline static empty msg 
core (#63191) (#63267)
    
    pick: https://github.com/apache/doris/pull/63191
---
 thirdparty/download-thirdparty.sh                  |  7 +++
 ...che-arrow-17.0.0-status-inline-static-fix.patch | 58 ++++++++++++++++++++++
 2 files changed, 65 insertions(+)

diff --git a/thirdparty/download-thirdparty.sh 
b/thirdparty/download-thirdparty.sh
index 75882d1253f..a61f520ea35 100755
--- a/thirdparty/download-thirdparty.sh
+++ b/thirdparty/download-thirdparty.sh
@@ -448,6 +448,13 @@ if [[ " ${TP_ARCHIVES[*]} " =~ " ARROW " ]]; then
             # apache-arrow-17.0.0-force-write-int96-timestamps.patch : 
             # Introducing the parameter that forces writing int96 timestampes 
for compatibility with Paimon cpp. 
             patch -p1 
<"${TP_PATCH_DIR}/apache-arrow-17.0.0-force-write-int96-timestamps.patch"
+
+            # apache-arrow-17.0.0-status-inline-static-fix.patch :
+            # Move Status::message()/detail() empty sentinels out of header
+            # inline function-local statics. Clang can place those weak inline
+            # std::string objects in RELRO, then crash while initializing them.
+            patch -p1 
<"${TP_PATCH_DIR}/apache-arrow-17.0.0-status-inline-static-fix.patch"
+
             touch "${PATCHED_MARK}"
         fi
         cd -
diff --git 
a/thirdparty/patches/apache-arrow-17.0.0-status-inline-static-fix.patch 
b/thirdparty/patches/apache-arrow-17.0.0-status-inline-static-fix.patch
new file mode 100644
index 00000000000..2a1ed534077
--- /dev/null
+++ b/thirdparty/patches/apache-arrow-17.0.0-status-inline-static-fix.patch
@@ -0,0 +1,58 @@
+diff --git a/cpp/src/arrow/status.cc b/cpp/src/arrow/status.cc
+index a9581cadc9..1b7ee7df62 100644
+--- a/cpp/src/arrow/status.cc
++++ b/cpp/src/arrow/status.cc
+@@ -17,6 +17,17 @@
+ 
+ namespace arrow {
+ 
++const std::string& Status::NoMessage() {
++  static const std::string* no_message = new std::string();
++  return *no_message;
++}
++
++const std::shared_ptr<StatusDetail>& Status::NoDetail() {
++  static const std::shared_ptr<StatusDetail>* no_detail =
++      new std::shared_ptr<StatusDetail>();
++  return *no_detail;
++}
++
+ Status::Status(StatusCode code, const std::string& msg)
+     : Status::Status(code, msg, nullptr) {}
+ 
+diff --git a/cpp/src/arrow/status.h b/cpp/src/arrow/status.h
+index 983b61629d..a49a982922 100644
+--- a/cpp/src/arrow/status.h
++++ b/cpp/src/arrow/status.h
+@@ -330,14 +330,18 @@ class ARROW_EXPORT [[nodiscard]] Status : public 
util::EqualityComparable<Status
+ 
+   /// \brief Return the specific error message attached to this status.
+   const std::string& message() const {
+-    static const std::string no_message = "";
+-    return ok() ? no_message : state_->msg;
++    if (ARROW_PREDICT_FALSE(state_ != NULLPTR)) {
++      return state_->msg;
++    }
++    return NoMessage();
+   }
+ 
+   /// \brief Return the status detail attached to this message.
+   const std::shared_ptr<StatusDetail>& detail() const {
+-    static std::shared_ptr<StatusDetail> no_detail = NULLPTR;
+-    return state_ ? state_->detail : no_detail;
++    if (ARROW_PREDICT_FALSE(state_ != NULLPTR)) {
++      return state_->detail;
++    }
++    return NoDetail();
+   }
+ 
+   const void* debug_state_addr() const { return state_; }
+@@ -396,6 +400,8 @@ class ARROW_EXPORT [[nodiscard]] Status : public 
util::EqualityComparable<Status
+     delete state_;
+     state_ = NULLPTR;
+   }
++  static const std::string& NoMessage();
++  static const std::shared_ptr<StatusDetail>& NoDetail();
+   void CopyFrom(const Status& s);
+   inline void MoveFrom(Status& s);
+ };


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

Reply via email to