From d96b52103aeae1505bbcbe0f84e7bde97045c131 Mon Sep 17 00:00:00 2001 From: Rohit Satardekar Date: Sun, 22 Jun 2025 05:18:33 +0530 Subject: [PATCH] [Enhancement] bump up breakpad to 2024.02.16 to fix crash in dump_syms (#60005) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit we are using and older version of dump_syms that doesn’t understand the .relr.dyn section Fixes #60004 update breakpad to version breakpad-2024.02.16 $ bash thirdparty/minidump/gen_minidump_symbols.sh starrocks_be'size (2153mb) reduced to (556mb) symbol file is at /home/ubuntu/starrocks/output/be/symbols/starrocks_be/AC7FAB7F8B5BF82100000000000000000 Signed-off-by: Rohit Satardekar --- thirdparty/build-thirdparty.sh | 1 + thirdparty/download-thirdparty.sh | 4 ++++ thirdparty/minidump/gen_minidump_symbols.sh | 4 ++-- thirdparty/patches/breakpad-2024.02.16.patch | 17 +++++++++++++++++ thirdparty/vars.sh | 8 ++++---- 5 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 thirdparty/patches/breakpad-2024.02.16.patch diff --git a/thirdparty/build-thirdparty.sh b/thirdparty/build-thirdparty.sh index ca99e042ee0..26cb78cf4f2 100755 --- a/thirdparty/build-thirdparty.sh +++ b/thirdparty/build-thirdparty.sh @@ -915,6 +915,7 @@ build_breakpad() { cd $TP_SOURCE_DIR/$BREAK_PAD_SOURCE mkdir -p src/third_party/lss cp $TP_PATCH_DIR/linux_syscall_support.h src/third_party/lss + LDFLAGS="-L${TP_LIB_DIR}" \ CFLAGS= ./configure --prefix=$TP_INSTALL_DIR --enable-shared=no --disable-samples --disable-libevent-regress make -j$PARALLEL make install diff --git a/thirdparty/download-thirdparty.sh b/thirdparty/download-thirdparty.sh index f23c7ac0be3..1de44b75f76 100755 --- a/thirdparty/download-thirdparty.sh +++ b/thirdparty/download-thirdparty.sh @@ -596,6 +596,10 @@ if [[ -d $TP_SOURCE_DIR/$BREAK_PAD_SOURCE ]] ; then patch -p1 < "$TP_PATCH_DIR/breakpad-2022.07.12.patch" touch "$PATCHED_MARK" fi + if [ ! -f "$PATCHED_MARK" ] && [[ $BREAK_PAD_SOURCE == "breakpad-2024.02.16" ]] ; then + patch -p1 < "$TP_PATCH_DIR/breakpad-2024.02.16.patch" + touch "$PATCHED_MARK" + fi cd - echo "Finished patching $BREAK_PAD_SOURCE" fi diff --git a/thirdparty/minidump/gen_minidump_symbols.sh b/thirdparty/minidump/gen_minidump_symbols.sh index 81a1e61e7be..ef491a8e58c 100755 --- a/thirdparty/minidump/gen_minidump_symbols.sh +++ b/thirdparty/minidump/gen_minidump_symbols.sh @@ -12,10 +12,10 @@ starrocks_home=$(dirname $(dirname $curdir)) # generate symbol's file in Breakpad's own format. $(dirname $curdir)/installed/bin/dump_syms $starrocks_home/output/be/lib/starrocks_be > $starrocks_home/output/be/starrocks_be.sym -((starrocks_be_size_original=`ls -l output/be/lib/starrocks_be | awk '{print $5}'` / (1024*1024))) +((starrocks_be_size_original=`ls -l $starrocks_home/output/be/lib/starrocks_be | awk '{print $5}'` / (1024*1024))) # remove debugging infos strip $starrocks_home/output/be/lib/starrocks_be -((starrocks_be_size_simplify=`ls -l output/be/lib/starrocks_be | awk '{print $5}'` / (1024*1024))) +((starrocks_be_size_simplify=`ls -l $starrocks_home/output/be/lib/starrocks_be | awk '{print $5}'` / (1024*1024))) # echo size reduction echo "starrocks_be'size ("$starrocks_be_size_original"mb) reduced to ("$starrocks_be_size_simplify"mb)" diff --git a/thirdparty/patches/breakpad-2024.02.16.patch b/thirdparty/patches/breakpad-2024.02.16.patch new file mode 100644 index 00000000000..f7b9032b8dc --- /dev/null +++ b/thirdparty/patches/breakpad-2024.02.16.patch @@ -0,0 +1,17 @@ +diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc +index b693fc9e..8686ee38 100644 +--- a/src/common/linux/dump_symbols.cc ++++ b/src/common/linux/dump_symbols.cc +@@ -82,6 +82,12 @@ + #endif + #include "common/using_std_string.h" + ++#ifndef SHF_COMPRESSED ++#define SHF_COMPRESSED (1 << 11) /* Section with compressed data. */ ++#define ELFCOMPRESS_ZLIB 1 /* ZLIB/DEFLATE algorithm. */ ++#define EM_RISCV 243 /* RISC-V */ ++#endif ++ + // This namespace contains helper functions. + namespace { + diff --git a/thirdparty/vars.sh b/thirdparty/vars.sh index e27e7912728..43c34988e54 100644 --- a/thirdparty/vars.sh +++ b/thirdparty/vars.sh @@ -295,10 +295,10 @@ RYU_SOURCE="ryu-aa31ca9361d21b1a00ee054aac49c87d07e74abc" RYU_MD5SUM="cb82b6da904d919470fe3f5a01ca30ff" # breakpad -BREAK_PAD_DOWNLOAD="https://github.com/google/breakpad/archive/refs/tags/v2022.07.12.tar.gz" -BREAK_PAD_NAME="breakpad-2022.07.12.tar.gz" -BREAK_PAD_SOURCE="breakpad-2022.07.12" -BREAK_PAD_MD5SUM="d5bcfd3f7b361ef5bda96123c3abdd0a" +BREAK_PAD_DOWNLOAD="https://github.com/google/breakpad/archive/refs/tags/v2024.02.16.tar.gz" +BREAK_PAD_NAME="breakpad-2024.02.16.tar.gz" +BREAK_PAD_SOURCE="breakpad-2024.02.16" +BREAK_PAD_MD5SUM="ae8c55b23c157771922b5ddca3803055" # RAGEL # ragel-6.9+ is used by hyperscan, so we build it first