This is an automated email from the ASF dual-hosted git repository.
lihaopeng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new b73a5f17a97 [env](test) add ubsan content to the compilation options
in asan (#36195)
b73a5f17a97 is described below
commit b73a5f17a9747c51bbd00bb731a5afe7d5c6bb05
Author: Mryange <[email protected]>
AuthorDate: Fri Jun 14 14:14:19 2024 +0800
[env](test) add ubsan content to the compilation options in asan (#36195)
---
be/CMakeLists.txt | 8 ++-
.../query_p0/aggregate/group_array_intersect.out | 18 +++----
.../aggregate/group_array_intersect.groovy | 58 +++++++++++-----------
run-be-ut.sh | 8 ++-
4 files changed, 51 insertions(+), 41 deletions(-)
diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index 929483d08b2..ade1fd4fc52 100644
--- a/be/CMakeLists.txt
+++ b/be/CMakeLists.txt
@@ -382,8 +382,10 @@ endif()
# -O3: Enable all compiler optimizations
# -DNDEBUG: Turn off dchecks/asserts/debug only code.
set(CXX_FLAGS_RELEASE "${CXX_GCC_FLAGS} -O3 -DNDEBUG")
-set(CXX_FLAGS_ASAN "${CXX_GCC_FLAGS} -O0 -fsanitize=address
-DADDRESS_SANITIZER")
+set(CXX_FLAGS_ASAN "${CXX_GCC_FLAGS} -O0 -fsanitize=address
-fsanitize=undefined -fno-strict-aliasing
-fno-sanitize=alignment,signed-integer-overflow,float-cast-overflow
-DUNDEFINED_BEHAVIOR_SANITIZER -DADDRESS_SANITIZER")
set(CXX_FLAGS_LSAN "${CXX_GCC_FLAGS} -O0 -fsanitize=leak -DLEAK_SANITIZER")
+## Use for BE-UT
+set(CXX_FLAGS_ASAN_UT "${CXX_GCC_FLAGS} -O0 -fsanitize=address
-DADDRESS_SANITIZER")
# Set the flags to the undefined behavior sanitizer, also known as "ubsan"
# Turn on sanitizer and debug symbols to get stack traces:
@@ -408,6 +410,8 @@ elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "UBSAN")
set(CMAKE_CXX_FLAGS "${CXX_FLAGS_UBSAN}")
elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "TSAN")
set(CMAKE_CXX_FLAGS "${CXX_FLAGS_TSAN}")
+elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "ASAN_UT")
+ set(CMAKE_CXX_FLAGS "${CXX_FLAGS_ASAN_UT}")
else()
message(FATAL_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE}")
endif()
@@ -629,7 +633,7 @@ endif ()
# Add sanitize static link flags
if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG" OR "${CMAKE_BUILD_TYPE}" STREQUAL
"RELEASE")
set(DORIS_LINK_LIBS ${DORIS_LINK_LIBS} ${MALLOCLIB})
-elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "ASAN")
+elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "ASAN" OR "${CMAKE_BUILD_TYPE}"
STREQUAL "ASAN_UT")
set(DORIS_LINK_LIBS ${DORIS_LINK_LIBS} ${ASAN_LIBS})
elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "LSAN")
set(DORIS_LINK_LIBS ${DORIS_LINK_LIBS} ${LSAN_LIBS})
diff --git a/regression-test/data/query_p0/aggregate/group_array_intersect.out
b/regression-test/data/query_p0/aggregate/group_array_intersect.out
index e9e0efec5dc..c58ede1043e 100644
--- a/regression-test/data/query_p0/aggregate/group_array_intersect.out
+++ b/regression-test/data/query_p0/aggregate/group_array_intersect.out
@@ -3,7 +3,7 @@
[null]
-- !int_2 --
-[13, 12]
+[12, 13]
-- !int_3 --
[]
@@ -12,13 +12,13 @@
[null]
-- !int_5 --
-[7, 6]
+[6, 7]
-- !int_6 --
[null]
-- !int_7 --
-[null, 13, 12]
+[null, 12, 13]
-- !int_8 --
[]
@@ -61,17 +61,17 @@
-- !groupby_1 --
0 [0]
-1 [4, 1, 5, 2, 3]
+1 [1, 2, 3, 4, 5]
-- !groupby_2 --
-18 ["c", "e", "b", "d", "a", "f"]
-19 ["c", "ff", "cc", "bb", "f", "aa", "dd", "b", "d", "a"]
+18 ["a", "b", "c", "d", "e", "f"]
+19 ["a", "aa", "b", "bb", "c", "cc", "d", "dd", "f", "ff"]
20 [null, "a"]
21 [null]
22 ["x", "y"]
-- !groupby_3 --
-18 ["c", "e", "b", "d", "a", "f"]
+18 ["a", "b", "c", "d", "e", "f"]
-- !notnull_1 --
[]
@@ -80,10 +80,10 @@
[] []
-- !notnull_3 --
-[7.7, 6.6]
+[6.6, 7.7]
-- !notnull_4 --
-["c", "b", "d", "a", "f"]
+["a", "b", "c", "d", "f"]
-- !notnull_5 --
[] [] []
diff --git
a/regression-test/suites/query_p0/aggregate/group_array_intersect.groovy
b/regression-test/suites/query_p0/aggregate/group_array_intersect.groovy
index a802d42a66a..8e0ecbe3c21 100644
--- a/regression-test/suites/query_p0/aggregate/group_array_intersect.groovy
+++ b/regression-test/suites/query_p0/aggregate/group_array_intersect.groovy
@@ -48,29 +48,29 @@ suite("group_array_intersect") {
sql """INSERT INTO `group_array_intersect_test`(id, c_array_bigint) VALUES
(23, [1234567890123456]), (24, [1234567890123456, 2333333333333333]);"""
sql """INSERT INTO `group_array_intersect_test`(id, c_array_decimal)
VALUES (25, [1.34,2.00188888888888888]), (26, [1.34,2.00123344444455555]);"""
- qt_int_1 """select group_array_intersect(c_array_int) from
group_array_intersect_test where id in (6, 12);"""
- qt_int_2 """select group_array_intersect(c_array_int) from
group_array_intersect_test where id in (14, 12);"""
- qt_int_3 """select group_array_intersect(c_array_int) from
group_array_intersect_test where id in (0, 6);"""
- qt_int_4 """select group_array_intersect(c_array_int) from
group_array_intersect_test where id in (13);"""
- qt_int_5 """select group_array_intersect(c_array_int) from
group_array_intersect_test where id in (2, 5);"""
- qt_int_6 """select group_array_intersect(c_array_int) from
group_array_intersect_test where id in (6, 13);"""
- qt_int_7 """select group_array_intersect(c_array_int) from
group_array_intersect_test where id in (12);"""
- qt_int_8 """select group_array_intersect(c_array_int) from
group_array_intersect_test where id in (6, 7);"""
- qt_int_9 """select group_array_intersect(c_array_int) from
group_array_intersect_test where id in (9, 12);"""
- qt_float_1 """select group_array_intersect(c_array_float) from
group_array_intersect_test where id = 7;"""
- qt_float_2 """select group_array_intersect(c_array_float) from
group_array_intersect_test where id between 7 and 8;"""
- qt_float_3 """select group_array_intersect(c_array_float) from
group_array_intersect_test where id in (7, 9);"""
- qt_datetimev2_1 """select group_array_intersect(c_array_datetimev2) from
group_array_intersect_test;"""
- qt_datetimev2_2 """select group_array_intersect(c_array_datetimev2) from
group_array_intersect_test where id in (10, 11);"""
- qt_datev2_1 """select group_array_intersect(c_array_datev2) from
group_array_intersect_test where id in (15, 16);"""
- qt_datev2_2 """select group_array_intersect(c_array_datev2) from
group_array_intersect_test where id in (15, 17);"""
- qt_string_1 """select group_array_intersect(c_array_string) from
group_array_intersect_test where id in (17, 20);"""
- qt_string_2 """select group_array_intersect(c_array_string) from
group_array_intersect_test where id in (18, 20);"""
- qt_bigint """select group_array_intersect(c_array_bigint) from
group_array_intersect_test where id in (23, 24);"""
- qt_decimal """select group_array_intersect(c_array_decimal) from
group_array_intersect_test where id in (25, 26);"""
- qt_groupby_1 """select id, group_array_intersect(c_array_int) from
group_array_intersect_test where id <= 1 group by id order by id;"""
- qt_groupby_2 """select id, group_array_intersect(c_array_string) from
group_array_intersect_test where c_array_string is not null group by id order
by id;"""
- qt_groupby_3 """select id, group_array_intersect(c_array_string) from
group_array_intersect_test where id = 18 group by id order by id;"""
+ qt_int_1 """select array_sort(group_array_intersect(c_array_int)) from
group_array_intersect_test where id in (6, 12);"""
+ qt_int_2 """select array_sort(group_array_intersect(c_array_int)) from
group_array_intersect_test where id in (14, 12);"""
+ qt_int_3 """select array_sort(group_array_intersect(c_array_int)) from
group_array_intersect_test where id in (0, 6);"""
+ qt_int_4 """select array_sort(group_array_intersect(c_array_int)) from
group_array_intersect_test where id in (13);"""
+ qt_int_5 """select array_sort(group_array_intersect(c_array_int)) from
group_array_intersect_test where id in (2, 5);"""
+ qt_int_6 """select array_sort(group_array_intersect(c_array_int)) from
group_array_intersect_test where id in (6, 13);"""
+ qt_int_7 """select array_sort(group_array_intersect(c_array_int)) from
group_array_intersect_test where id in (12);"""
+ qt_int_8 """select array_sort(group_array_intersect(c_array_int)) from
group_array_intersect_test where id in (6, 7);"""
+ qt_int_9 """select array_sort(group_array_intersect(c_array_int)) from
group_array_intersect_test where id in (9, 12);"""
+ qt_float_1 """select array_sort(group_array_intersect(c_array_float)) from
group_array_intersect_test where id = 7;"""
+ qt_float_2 """select array_sort(group_array_intersect(c_array_float)) from
group_array_intersect_test where id between 7 and 8;"""
+ qt_float_3 """select array_sort(group_array_intersect(c_array_float)) from
group_array_intersect_test where id in (7, 9);"""
+ qt_datetimev2_1 """select
array_sort(group_array_intersect(c_array_datetimev2)) from
group_array_intersect_test;"""
+ qt_datetimev2_2 """select
array_sort(group_array_intersect(c_array_datetimev2)) from
group_array_intersect_test where id in (10, 11);"""
+ qt_datev2_1 """select array_sort(group_array_intersect(c_array_datev2))
from group_array_intersect_test where id in (15, 16);"""
+ qt_datev2_2 """select array_sort(group_array_intersect(c_array_datev2))
from group_array_intersect_test where id in (15, 17);"""
+ qt_string_1 """select array_sort(group_array_intersect(c_array_string))
from group_array_intersect_test where id in (17, 20);"""
+ qt_string_2 """select array_sort(group_array_intersect(c_array_string))
from group_array_intersect_test where id in (18, 20);"""
+ qt_bigint """select array_sort(group_array_intersect(c_array_bigint)) from
group_array_intersect_test where id in (23, 24);"""
+ qt_decimal """select array_sort(group_array_intersect(c_array_decimal))
from group_array_intersect_test where id in (25, 26);"""
+ qt_groupby_1 """select id, array_sort(group_array_intersect(c_array_int))
from group_array_intersect_test where id <= 1 group by id order by id;"""
+ qt_groupby_2 """select id,
array_sort(group_array_intersect(c_array_string)) from
group_array_intersect_test where c_array_string is not null group by id order
by id;"""
+ qt_groupby_3 """select id,
array_sort(group_array_intersect(c_array_string)) from
group_array_intersect_test where id = 18 group by id order by id;"""
sql "DROP TABLE IF EXISTS `group_array_intersect_test_not_null`;"
@@ -97,10 +97,10 @@ suite("group_array_intersect") {
sql """INSERT INTO `group_array_intersect_test_not_null`(id, c_array_int,
c_array_float, c_array_string) VALUES (4, [6, 7], [6.6, 7.7], ['a']);"""
sql """INSERT INTO `group_array_intersect_test_not_null`(id, c_array_int,
c_array_float, c_array_string) VALUES (5, [null], [null], ['x', 'y']);"""
- qt_notnull_1 """select group_array_intersect(c_array_float) from
group_array_intersect_test_not_null where array_size(c_array_float) between 1
and 2;"""
- qt_notnull_2 """select group_array_intersect(c_array_int),
group_array_intersect(c_array_float) from group_array_intersect_test_not_null
where id between 2 and 3;"""
- qt_notnull_3 """select group_array_intersect(c_array_float) from
group_array_intersect_test_not_null where array_size(c_array_float) between 2
and 3;"""
- qt_notnull_4 """select group_array_intersect(c_array_string) from
group_array_intersect_test_not_null where id between 1 and 2;"""
- qt_notnull_5 """select group_array_intersect(c_array_int),
group_array_intersect(c_array_float), group_array_intersect(c_array_string)
from group_array_intersect_test_not_null where id between 3 and 4;"""
- qt_notnull_6 """select group_array_intersect(c_array_string) from
group_array_intersect_test_not_null where id between 1 and 5;"""
+ qt_notnull_1 """select array_sort(group_array_intersect(c_array_float))
from group_array_intersect_test_not_null where array_size(c_array_float)
between 1 and 2;"""
+ qt_notnull_2 """select array_sort(group_array_intersect(c_array_int)),
array_sort(group_array_intersect(c_array_float)) from
group_array_intersect_test_not_null where id between 2 and 3;"""
+ qt_notnull_3 """select array_sort(group_array_intersect(c_array_float))
from group_array_intersect_test_not_null where array_size(c_array_float)
between 2 and 3;"""
+ qt_notnull_4 """select array_sort(group_array_intersect(c_array_string))
from group_array_intersect_test_not_null where id between 1 and 2;"""
+ qt_notnull_5 """select array_sort(group_array_intersect(c_array_int)),
array_sort(group_array_intersect(c_array_float)),
array_sort(group_array_intersect(c_array_string)) from
group_array_intersect_test_not_null where id between 3 and 4;"""
+ qt_notnull_6 """select array_sort(group_array_intersect(c_array_string))
from group_array_intersect_test_not_null where id between 1 and 5;"""
}
diff --git a/run-be-ut.sh b/run-be-ut.sh
index 0ab436973bc..fe3e9dbd4a5 100755
--- a/run-be-ut.sh
+++ b/run-be-ut.sh
@@ -220,10 +220,16 @@ echo "-- Make program: ${MAKE_PROGRAM}"
echo "-- Use ccache: ${CMAKE_USE_CCACHE}"
echo "-- Extra cxx flags: ${EXTRA_CXX_FLAGS:-}"
+if [[ "${CMAKE_BUILD_TYPE}" = "ASAN" ]]; then
+ BUILD_TYPE="ASAN_UT"
+else
+ BUILD_TYPE="${CMAKE_BUILD_TYPE}"
+fi
+
cd "${CMAKE_BUILD_DIR}"
"${CMAKE_CMD}" -G "${GENERATOR}" \
-DCMAKE_MAKE_PROGRAM="${MAKE_PROGRAM}" \
- -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
+ -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DMAKE_TEST=ON \
-DGLIBC_COMPATIBILITY="${GLIBC_COMPATIBILITY}" \
-DUSE_LIBCPP="${USE_LIBCPP}" \
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]