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

joemcdonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git


The following commit(s) were added to refs/heads/master by this push:
     new 84fa6d210 IMPALA-11738: Hide symbols from compression libraries for 
libfesupport.so
84fa6d210 is described below

commit 84fa6d210d3966e5ece8b4ac84ff8bd8780dec4e
Author: Joe McDonnell <[email protected]>
AuthorDate: Mon Nov 21 21:06:54 2022 -0800

    IMPALA-11738: Hide symbols from compression libraries for libfesupport.so
    
    Recently, dataload has been failing on some configurations
    with an error from Hive when initializing zlib native code
    in ZlibDecompressor.init(). This error goes away when
    libfesupport.so is removed from JAVA_LIBRARY_PATH in
    testdata/bin/run-hive-server.sh, so something about
    libfesupport.so is interfering with the functioning of
    zlib.
    
    libfesupport.so includes several compression libraries
    (libbz2, liblz4, libsnappy, libz, libzstd). To avoid these
    types of conflicts, this hides the symbols for the
    compression libraries in libfesupport.so. That prevents
    libhadoop from using the symbols in libfesupport.so.
    
    Testing:
     - Ran an ASAN dataload on Centos 7 (which previously had
       been consistenly failing)
     - Ran precommit job
    
    Change-Id: I55bda6899044ff2ad98134f5954df83f3e10a5cc
    Reviewed-on: http://gerrit.cloudera.org:8080/19264
    Reviewed-by: Michael Smith <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 be/src/service/CMakeLists.txt | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/be/src/service/CMakeLists.txt b/be/src/service/CMakeLists.txt
index 747e83ee8..538772bf3 100644
--- a/be/src/service/CMakeLists.txt
+++ b/be/src/service/CMakeLists.txt
@@ -56,6 +56,18 @@ add_dependencies(ServiceTests gen-deps)
 add_library(fesupport SHARED
   fe-support.cc
 )
+
+# Hide all symbols from compression libraries so that users of this 
libfesupport.so
+# don't have conflicts with libhadoop or other libraries.
+# TODO: This should also hide most other symbols as a precaution.
+set(LINK_FLAGS "-Wl,--exclude-libs=libbz2")
+set(LINK_FLAGS "${LINK_FLAGS} -Wl,--exclude-libs=liblz4")
+set(LINK_FLAGS "${LINK_FLAGS} -Wl,--exclude-libs=libsnappy")
+set(LINK_FLAGS "${LINK_FLAGS} -Wl,--exclude-libs=libz")
+set(LINK_FLAGS "${LINK_FLAGS} -Wl,--exclude-libs=libzstd")
+set_target_properties(fesupport
+  PROPERTIES
+  LINK_FLAGS "${LINK_FLAGS}")
 add_dependencies(fesupport gen-deps)
 
 if ("${CMAKE_BUILD_TYPE}" STREQUAL "UBSAN"

Reply via email to