-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](ubsan) fix ubsan error in DataTypeHLL::serialize #50628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
TPC-H: Total hot run time: 33754 ms |
TPC-DS: Total hot run time: 192365 ms |
ClickBench: Total hot run time: 28.42 s |
|
run buildall |
TPC-H: Total hot run time: 33507 ms |
TPC-DS: Total hot run time: 185409 ms |
ClickBench: Total hot run time: 28.66 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
### What problem does this PR solve? In the code below, if the column size is 0, an empty vector will be created. A vector with size 0 may return nullptr from data() https://en.cppreference.com/w/cpp/container/vector/data `If size() is 0, data() may or may not return a null pointer.` This would trigger a ubsan error: `null pointer passed as argument 2, which is declared to never be null` Other data types don't have this issue because they use Doris internal pod array that guarantees data won't be nullptr.
### What problem does this PR solve? In the code below, if the column size is 0, an empty vector will be created. A vector with size 0 may return nullptr from data() https://en.cppreference.com/w/cpp/container/vector/data `If size() is 0, data() may or may not return a null pointer.` This would trigger a ubsan error: `null pointer passed as argument 2, which is declared to never be null` Other data types don't have this issue because they use Doris internal pod array that guarantees data won't be nullptr.
### What problem does this PR solve? In the code below, if the column size is 0, an empty vector will be created. A vector with size 0 may return nullptr from data() https://en.cppreference.com/w/cpp/container/vector/data `If size() is 0, data() may or may not return a null pointer.` This would trigger a ubsan error: `null pointer passed as argument 2, which is declared to never be null` Other data types don't have this issue because they use Doris internal pod array that guarantees data won't be nullptr.
What problem does this PR solve?
In the code below, if the column size is 0, an empty vector will be created. A vector with size 0 may return nullptr from data()
https://en.cppreference.com/w/cpp/container/vector/data
If size() is 0, data() may or may not return a null pointer.This would trigger a ubsan error:
null pointer passed as argument 2, which is declared to never be nullOther data types don't have this issue because they use Doris internal pod array that guarantees data won't be nullptr.
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)