Added bounds check in ColumnVector::insert_indices_from()#56696
Added bounds check in ColumnVector::insert_indices_from()#56696msridhar78 wants to merge 6 commits intoapache:masterfrom
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
TPC-DS: Total hot run time: 190842 ms |
ClickBench: Total hot run time: 30.48 s |
be/src/vec/columns/column_vector.cpp
Outdated
| const uint32_t* __restrict begin, const uint32_t* __restrict end, size_t src_size) { | ||
| for (const auto* it = begin; it != end; ++it) { | ||
| if (*it >= src_size) { | ||
| throw Exception(ErrorCode::INTERNAL_ERROR, |
There was a problem hiding this comment.
Is this row level check really useful? Because I think if we check the bound every line the performance may not be very well.
I think we could add the bound check at line 282, it is enough?
There was a problem hiding this comment.
This check is made to ensure that each index *it is less than src_size before accessing src[*it] - the UT attached simulates this error condition and hence this check..please let me know your thoughts
a88c159 to
0149e48
Compare
|
run buildall |
ClickBench: Total hot run time: 30.03 s |
|
run buildall |
|
run buildall |
TPC-DS: Total hot run time: 189629 ms |
ClickBench: Total hot run time: 30.23 s |
|
run buildall |
TPC-DS: Total hot run time: 190363 ms |
ClickBench: Total hot run time: 29.82 s |
|
run buildall |
TPC-DS: Total hot run time: 189978 ms |
ClickBench: Total hot run time: 30.8 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
|
run buildall |
TPC-DS: Total hot run time: 190130 ms |
ClickBench: Total hot run time: 30.03 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
1 similar comment
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Crash similar to Co
(gdb) bt
#0 0x0000555575a42b26 in doris::vectorized::ColumnVector<(doris::PrimitiveType)6>::insert_indices_from(doris::vectorized::IColumn const&, unsigned int const*, unsigned int const*)::{lambda(long const*, long*, unsigned int const*, unsigned int const*)#1}::operator()(long const*, long*, unsigned int const*, unsigned int const*) const (this=0x7fffffffc9df, src=0x7ffff2f73010, dest=0x7ffff2f74048,
begin=0x7fffffffcb50, end=0x7fffffffcb60) at /root/doris/be/src/vec/columns/column_vector.cpp:289
#1 0x00005555759d1ae9 in doris::vectorized::ColumnVector<(doris::PrimitiveType)6>::insert_indices_from (this=0x7ffff2fe0bc0, src=...,
indices_begin=0x7fffffffcb50, indices_end=0x7fffffffcb60) at /root/doris/be/src/vec/columns/column_vector.cpp:293
#2 0x0000555569dfaff6 in doris::vectorized::VColumnVectorTest_insert_indices_from_uInt64_crash_Test::TestBody (this=0x7ffff31350a0)
at /root/doris/be/test/vec/core/column_vector_test.cpp:66
#3 0x000055557af8b4d4 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::)(), char const) ()
#4 0x000055557af7aad6 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::)(), char const) ()
#5 0x000055557af55647 in testing::Test::Run() ()
#6 0x000055557af5632d in testing::TestInfo::Run() ()
#7 0x000055557af56ac0 in testing::TestSuite::Run() ()
#8 0x000055557af6827c in testing::internal::UnitTestImpl::RunAllTests() ()
#9 0x000055557af8d304 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::)(), char const) ()
#10 0x000055557af7ccf6 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::)(), char const) ()
#11 0x000055557af67e0b in testing::UnitTest::Run() ()
#12 0x000055556903dae3 in RUN_ALL_TESTS () at /var/local/thirdparty/installed/include/gtest/gtest.h:2490
#13 0x00005555690338c0 in main (argc=1, argv=0x7fffffffdc18) at /root/doris/be/test/testutil/run_all_tests.cpp:111
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)