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 ce53a3e5fa0 branch-4.1: [fix](be ut) Skip custom memcpy on ARM+ASAN to 
fix segfault at process startup #63656 (#63942)
ce53a3e5fa0 is described below

commit ce53a3e5fa06fffa9404954e448e71bfe58d8ffd
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Jun 1 19:07:19 2026 +0800

    branch-4.1: [fix](be ut) Skip custom memcpy on ARM+ASAN to fix segfault at 
process startup #63656 (#63942)
    
    Cherry-picked from #63656
    
    Co-authored-by: heguanhui <[email protected]>
    Co-authored-by: root <root@DESKTOP-3AF37B>
---
 be/src/glibc-compatibility/CMakeLists.txt | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/be/src/glibc-compatibility/CMakeLists.txt 
b/be/src/glibc-compatibility/CMakeLists.txt
index 99c428ba132..370d7346691 100644
--- a/be/src/glibc-compatibility/CMakeLists.txt
+++ b/be/src/glibc-compatibility/CMakeLists.txt
@@ -59,7 +59,16 @@ if (GLIBC_COMPATIBILITY)
     list(REMOVE_ITEM glibc_compatibility_sources musl/getrandom.c)
     # NOTE(amos): sanitizers might generate memcpy references that are too 
late to
     # refer. Let's also extract memcpy definitions explicitly to avoid UNDEF 
GLIBC 2.14.
-    add_library(glibc-compatibility-explicit OBJECT musl/getrandom.c 
${MEMCPY_SOURCE})
+    #
+    # NOTE: On ARM (aarch64) with ASAN, the custom memcpy (memcpy_aarch64.cpp) 
overrides
+    # the global memcpy symbol. libpthread's __pthread_initialize_minimal() 
calls memcpy
+    # before ASAN shadow memory is initialized, causing SIGSEGV. Skip custom 
memcpy in
+    # this case and fall back to glibc's memcpy.
+    if (ARCH_ARM AND (CMAKE_BUILD_TYPE STREQUAL "ASAN_UT" OR CMAKE_BUILD_TYPE 
STREQUAL "ASAN"))
+        add_library(glibc-compatibility-explicit OBJECT musl/getrandom.c)
+    else()
+        add_library(glibc-compatibility-explicit OBJECT musl/getrandom.c 
${MEMCPY_SOURCE})
+    endif()
     target_compile_options(glibc-compatibility-explicit PRIVATE -fPIC)
     add_library(glibc-compatibility STATIC ${glibc_compatibility_sources})
     target_compile_options(


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

Reply via email to