Repository navigation
Commit 580f925
[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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
193 | | - | |
194 | 192 | | |
195 | 193 | | |
196 | 194 | | |
| |||
0 commit comments