Skip to content

Commit 580f925

Browse files
morningmanclaude
andcommitted
[test](be) Drop the std::set::end() dereference in load_data_from_csv
### What problem does this PR solve? Issue Number: None Related PR: #48788 Problem Summary: `load_data_from_csv()` in `be/test/testutil/test_util.cpp` asserts `serders.size() == *idxes.end()` right after asserting `serders.size() == idxes.size()`. Dereferencing `std::set::end()` is undefined behavior. With libstdc++ (the Linux CI) the end iterator is the tree header, whose value slot overlaps the element count, so the assertion repeats the size check above it. With libc++ (macOS) it reads past the set object on the stack: under ASAN every BE unit test suite that loads a CSV fixture (`DataTypeDateTimeV2SerDeTest`, `DataTypeNumberSerDeTest`, `ColumnStringTest` and the other suites of 24 test files) reports a stack-buffer-overflow while loading the fixture, and `abort_on_error` stops the whole `doris_be_test` run. The assertion adds nothing to the size check, so this removes it. No production code changes. ### Release note None ### Check List (For Author) - Test: Unit Test - macOS arm64 (ASAN): the 24 CSV-fixture suites (364 tests) pass with this change; with the assertion back, `DataTypeDateTimeV2SerDeTest` fails in `SetUpTestSuite` with an ASAN stack-buffer-overflow at that assertion. - Behavior changed: No (test utility only) - Does this need documentation: No Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 5caaeb3 commit 580f925

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

‎be/test/testutil/test_util.cpp‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,6 @@ void load_data_from_csv(const DataTypeSerDeSPtrs serders, MutableColumns& column
189189
<< "serder size: " << serders.size() << " column size: " << columns.size();
190190
ASSERT_EQ(serders.size(), idxes.size())
191191
<< "serder size: " << serders.size() << " idxes size: " << idxes.size();
192-
ASSERT_EQ(serders.size(), *idxes.end())
193-
<< "serder size: " << serders.size() << " idxes size: " << *idxes.end();
194192
std::ifstream file(file_path);
195193
if (!file) {
196194
throw doris::Exception(ErrorCode::INVALID_ARGUMENT, "can not open the file: {} ",

0 commit comments

Comments
 (0)