adonis0147 opened a new issue, #14251: URL: https://github.com/apache/doris/issues/14251
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues. ### Version Doris version: master OS: macOS ### What's Wrong? ## Command ```shell ./run-be-ut.sh --run -j 8 ``` ## Result ```shell [----------] 5 tests from HashTableTest [ RUN ] HashTableTest.SetupTest [ OK ] HashTableTest.SetupTest (1 ms) [ RUN ] HashTableTest.BasicTest ================================================================= ==42822==ERROR: AddressSanitizer: container-overflow on address 0x00017ae73490 at pc 0x0001053a492c bp 0x00017845c830 sp 0x00017845c828 WRITE of size 4 at 0x00017ae73490 thread T0 #0 0x1053a4928 in doris::Expr::compute_results_layout(std::__1::vector<doris::Expr*, std::__1::allocator<doris::Expr*> > const&, std::__1::vector<int, std::__1::allocator<int> >*, int*) expr.cpp:493 #1 0x1053a5b78 in doris::Expr::compute_results_layout(std::__1::vector<doris::ExprContext*, std::__1::allocator<doris::ExprContext*> > const&, std::__1::vector<int, std::__1::allocator<int> >*, int*) expr.cpp:511 #2 0x104401584 in doris::HashTable::HashTable(std::__1::vector<doris::ExprContext*, std::__1::allocator<doris::ExprContext*> > const&, std::__1::vector<doris::ExprContext*, std::__1::allocator<doris::ExprContext*> > const&, int, bool, std::__1::vector<bool, std::__1::allocator<bool> > const&, int, long long) hash_table.cpp:57 #3 0x104402b98 in doris::HashTable::HashTable(std::__1::vector<doris::ExprContext*, std::__1::allocator<doris::ExprContext*> > const&, std::__1::vector<doris::ExprContext*, std::__1::allocator<doris::ExprContext*> > const&, int, bool, std::__1::vector<bool, std::__1::allocator<bool> > const&, int, long long) hash_table.cpp:46 #4 0x100aa62b4 in doris::HashTableTest_BasicTest_Test::TestBody() hash_table_test.cpp:214 #5 0x11b47fda8 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*)+0x78 (doris_be_test:arm64+0x11aa47da8) #6 0x11b448624 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*)+0x5c (doris_be_test:arm64+0x11aa10624) #7 0x11b448574 in testing::Test::Run()+0xbc (doris_be_test:arm64+0x11aa10574) #8 0x11b4495cc in testing::TestInfo::Run()+0xf0 (doris_be_test:arm64+0x11aa115cc) #9 0x11b44a6c8 in testing::TestSuite::Run()+0x10c (doris_be_test:arm64+0x11aa126c8) #10 0x11b458050 in testing::internal::UnitTestImpl::RunAllTests()+0x3dc (doris_be_test:arm64+0x11aa20050) #11 0x11b484f88 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*)+0x78 (doris_be_test:arm64+0x11aa4cf88) #12 0x11b457a48 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*)+0x5c (doris_be_test:arm64+0x11aa1fa48) #13 0x11b457938 in testing::UnitTest::Run()+0xd4 (doris_be_test:arm64+0x11aa1f938) #14 0x102e2ca24 in RUN_ALL_TESTS() gtest.h:2490 #15 0x102e2b678 in main run_all_tests.cpp:50 #16 0x180babe4c (<unknown module>) 0x00017ae73490 is located 0 bytes inside of 4-byte region [0x00017ae73490,0x00017ae73494) allocated by thread T0 here: #0 0x1787ddef0 in wrap__Znwm+0x74 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x4def0) #1 0x100c3e8f4 in void* std::__1::__libcpp_operator_new<unsigned long>(unsigned long) new:235 #2 0x100c3e770 in std::__1::__libcpp_allocate(unsigned long, unsigned long) new:261 #3 0x100c591e0 in std::__1::allocator<int>::allocate(unsigned long) allocator.h:108 #4 0x100c58fcc in std::__1::allocator_traits<std::__1::allocator<int> >::allocate(std::__1::allocator<int>&, unsigned long) allocator_traits.h:262 #5 0x100c58d48 in std::__1::__split_buffer<int, std::__1::allocator<int>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<int>&) __split_buffer:315 #6 0x100c5856c in std::__1::__split_buffer<int, std::__1::allocator<int>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<int>&) __split_buffer:314 #7 0x101949b90 in std::__1::vector<int, std::__1::allocator<int> >::__append(unsigned long) vector:1115 #8 0x101946088 in std::__1::vector<int, std::__1::allocator<int> >::resize(unsigned long) vector:2046 #9 0x1053a4318 in doris::Expr::compute_results_layout(std::__1::vector<doris::Expr*, std::__1::allocator<doris::Expr*> > const&, std::__1::vector<int, std::__1::allocator<int> >*, int*) expr.cpp:475 #10 0x1053a5b78 in doris::Expr::compute_results_layout(std::__1::vector<doris::ExprContext*, std::__1::allocator<doris::ExprContext*> > const&, std::__1::vector<int, std::__1::allocator<int> >*, int*) expr.cpp:511 #11 0x104401584 in doris::HashTable::HashTable(std::__1::vector<doris::ExprContext*, std::__1::allocator<doris::ExprContext*> > const&, std::__1::vector<doris::ExprContext*, std::__1::allocator<doris::ExprContext*> > const&, int, bool, std::__1::vector<bool, std::__1::allocator<bool> > const&, int, long long) hash_table.cpp:57 #12 0x104402b98 in doris::HashTable::HashTable(std::__1::vector<doris::ExprContext*, std::__1::allocator<doris::ExprContext*> > const&, std::__1::vector<doris::ExprContext*, std::__1::allocator<doris::ExprContext*> > const&, int, bool, std::__1::vector<bool, std::__1::allocator<bool> > const&, int, long long) hash_table.cpp:46 #13 0x100aa62b4 in doris::HashTableTest_BasicTest_Test::TestBody() hash_table_test.cpp:214 #14 0x11b47fda8 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*)+0x78 (doris_be_test:arm64+0x11aa47da8) #15 0x11b448624 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*)+0x5c (doris_be_test:arm64+0x11aa10624) #16 0x11b448574 in testing::Test::Run()+0xbc (doris_be_test:arm64+0x11aa10574) #17 0x11b4495cc in testing::TestInfo::Run()+0xf0 (doris_be_test:arm64+0x11aa115cc) #18 0x11b44a6c8 in testing::TestSuite::Run()+0x10c (doris_be_test:arm64+0x11aa126c8) #19 0x11b458050 in testing::internal::UnitTestImpl::RunAllTests()+0x3dc (doris_be_test:arm64+0x11aa20050) #20 0x11b484f88 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*)+0x78 (doris_be_test:arm64+0x11aa4cf88) #21 0x11b457a48 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*)+0x5c (doris_be_test:arm64+0x11aa1fa48) #22 0x11b457938 in testing::UnitTest::Run()+0xd4 (doris_be_test:arm64+0x11aa1f938) #23 0x102e2ca24 in RUN_ALL_TESTS() gtest.h:2490 #24 0x102e2b678 in main run_all_tests.cpp:50 #25 0x180babe4c (<unknown module>) HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_container_overflow=0. If you suspect a false positive see also: https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow. SUMMARY: AddressSanitizer: container-overflow expr.cpp:493 in doris::Expr::compute_results_layout(std::__1::vector<doris::Expr*, std::__1::allocator<doris::Expr*> > const&, std::__1::vector<int, std::__1::allocator<int> >*, int*) ``` ### What You Expected? Run BE UT successfully. ### How to Reproduce? ## Patch file ```patch diff --git a/be/test/CMakeLists.txt b/be/test/CMakeLists.txt index bfae619cb..9d0325459 100644 --- a/be/test/CMakeLists.txt +++ b/be/test/CMakeLists.txt @@ -241,7 +241,7 @@ set(RUNTIME_TEST_FILES runtime/small_file_mgr_test.cpp runtime/heartbeat_flags_test.cpp runtime/result_queue_mgr_test.cpp - runtime/memory_scratch_sink_test.cpp + # runtime/memory_scratch_sink_test.cpp runtime/test_env.cc runtime/external_scan_context_mgr_test.cpp runtime/memory/chunk_allocator_test.cpp @@ -291,12 +291,12 @@ set(UTIL_TEST_FILES util/block_compression_test.cpp util/arrow/arrow_row_block_test.cpp util/arrow/arrow_row_batch_test.cpp - util/arrow/arrow_work_flow_test.cpp + # util/arrow/arrow_work_flow_test.cpp util/counter_cond_variable_test.cpp util/frame_of_reference_coding_test.cpp util/bit_stream_utils_test.cpp util/radix_sort_test.cpp - util/zip_util_test.cpp + # util/zip_util_test.cpp util/utf8_check_test.cpp util/cgroup_util_test.cpp util/path_util_test.cpp @@ -324,6 +324,10 @@ set(UTIL_TEST_FILES util/interval_tree_test.cpp util/key_util_test.cpp ) +if (OS_MACOSX) + list(REMOVE_ITEM UTIL_TEST_FILES util/system_metrics_test.cpp) +endif() + set(VEC_TEST_FILES vec/aggregate_functions/agg_collect_test.cpp vec/aggregate_functions/agg_test.cpp @@ -345,28 +349,28 @@ set(VEC_TEST_FILES vec/exec/vorc_scanner_test.cpp vec/exec/vparquet_scanner_test.cpp vec/exprs/vexpr_test.cpp - vec/function/function_array_aggregation_test.cpp - vec/function/function_array_element_test.cpp - vec/function/function_array_index_test.cpp - vec/function/function_array_size_test.cpp - vec/function/function_arrays_overlap_test.cpp - vec/function/function_bitmap_test.cpp - vec/function/function_comparison_test.cpp - vec/function/function_hash_test.cpp - vec/function/function_math_test.cpp - vec/function/function_string_test.cpp - vec/function/function_time_test.cpp - vec/function/function_ifnull_test.cpp - vec/function/function_nullif_test.cpp - vec/function/function_like_test.cpp - vec/function/function_arithmetic_test.cpp - vec/function/function_json_test.cpp - vec/function/function_jsonb_test.cpp - vec/function/function_geo_test.cpp - vec/function/function_test_util.cpp - vec/function/function_url_test.cpp - vec/function/table_function_test.cpp - vec/function/function_running_difference_test.cpp + # vec/function/function_array_aggregation_test.cpp + # vec/function/function_array_element_test.cpp + # vec/function/function_array_index_test.cpp + # vec/function/function_array_size_test.cpp + # vec/function/function_arrays_overlap_test.cpp + # vec/function/function_bitmap_test.cpp + # vec/function/function_comparison_test.cpp + # vec/function/function_hash_test.cpp + # vec/function/function_math_test.cpp + # vec/function/function_string_test.cpp + # vec/function/function_time_test.cpp + # vec/function/function_ifnull_test.cpp + # vec/function/function_nullif_test.cpp + # vec/function/function_like_test.cpp + # vec/function/function_arithmetic_test.cpp + # vec/function/function_json_test.cpp + # vec/function/function_jsonb_test.cpp + # vec/function/function_geo_test.cpp + # vec/function/function_test_util.cpp + # vec/function/function_url_test.cpp + # vec/function/table_function_test.cpp + # vec/function/function_running_difference_test.cpp vec/runtime/vdata_stream_test.cpp vec/runtime/vdatetime_value_test.cpp vec/utils/arrow_column_to_doris_column_test.cpp ``` 1. git apply the patch 2. `./run-be-ut.sh --run -j 8` ### Anything Else? _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
