Skip to content

Commit 39280bd

Browse files
committed
[fix](be) Preserve Bash 3 and UBSan compatibility
### What problem does this PR solve? Issue Number: None Related PR: #66857 Problem Summary: The ARM hardening changes used Bash 4 lowercase expansion in the third-party build, which breaks the Bash 3.2 shipped by supported macOS runners. The bit-packing alignment fix also left the whole unpack function excluded from undefined-behavior sanitization, so the new alignment regression test could not detect a reintroduced misaligned dereference. Use Bash 3-compatible case patterns and restore UBSan instrumentation now that all word reads use memcpy-based unaligned_load. ### Release note None ### Check List (For Author) - Test: Unit Test / Manual test - Bash syntax and extracted boolean case matrix - BE build hygiene and diff checks - Clang 19 alignment-sanitized BitPackingUnalignedTest (1/1 passed) - Behavior changed: No (restores supported build compatibility and sanitizer coverage) - Does this need documentation: No
1 parent 80432a7 commit 39280bd

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

be/src/util/bit_packing.inline.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ std::pair<const uint8_t*, int64_t> BitPacking::UnpackAndDecodeValues(
193193
// avoid buffer overflow (if we are unpacking 32 values, we can safely assume an input
194194
// buffer of length 32 * BIT_WIDTH).
195195
template <int BIT_WIDTH, int VALUE_IDX, bool FULL_BATCH>
196-
uint64_t NO_SANITIZE_UNDEFINED UnpackValue(const uint8_t* __restrict__ in_buf) {
196+
uint64_t UnpackValue(const uint8_t* __restrict__ in_buf) {
197197
if (BIT_WIDTH == 0) return 0;
198198

199199
constexpr int FIRST_BIT_IDX = VALUE_IDX * BIT_WIDTH;

thirdparty/build-thirdparty.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,18 +1404,18 @@ build_bitshuffle() {
14041404
# croaring bitmap
14051405
build_croaringbitmap() {
14061406
avx_flag=''
1407-
# USE_AVX2 accepts the same boolean spellings as CMake, case-insensitively:
1407+
# USE_AVX2 accepts common CMake boolean spellings, case-insensitively:
14081408
# 0/OFF/FALSE/NO disable AVX2, 1/ON/TRUE/YES or empty/unset keep it enabled.
14091409
# build.sh defaults USE_AVX2=ON and forwards it verbatim to BE's CMake, so
14101410
# croaring must agree with BE on whether AVX2 is enabled. String matching is
14111411
# used instead of `-eq`: in bash arithmetic context the string "ON"
14121412
# evaluates to 0, so exporting USE_AVX2=ON would silently DISABLE AVX2.
1413-
case "${USE_AVX2,,}" in
1414-
0 | off | false | no)
1413+
case "${USE_AVX2}" in
1414+
0 | [oO][fF][fF] | [fF][aA][lL][sS][eE] | [nN][oO])
14151415
echo "set USE_AVX2=${USE_AVX2} to FORCE disable AVX2 in croaringbitmap"
14161416
avx_flag="-DROARING_DISABLE_AVX=ON"
14171417
;;
1418-
1 | on | true | yes | '') ;;
1418+
1 | [oO][nN] | [tT][rR][uU][eE] | [yY][eE][sS] | '') ;;
14191419
*)
14201420
echo "WARNING: unrecognized USE_AVX2=${USE_AVX2}, AVX2 is left enabled in croaringbitmap"
14211421
;;

0 commit comments

Comments
 (0)