-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix GCC 11 warns that writing 1 byte into a region of size 0 [-Wstringop-overflow=] #9578
Conversation
✅ Deploy Preview for meta-velox canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love that these are getting caught!
@@ -156,7 +156,7 @@ class SelectivityVector { | |||
bits::fillBits(bits_.data(), 0, size_, false); | |||
begin_ = 0; | |||
end_ = 0; | |||
allSelected_ = false; | |||
allSelected_.reset(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct. allSelected_
has 3 states, nullopt
, true
, false
, here we should set it to false
, not nullopt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I intended to keep this logic but set it to false
directly will cause the issue as mentioned, even with a check like if (allSelected_.has_value() && *allSelected_)
first. The variable is used in isAllSelected()
and countSelected()
, which can also give correct return if it doesn't have value, so using allSelected_.reset()
here is acceptable? This error is kind of code sensitive and I didn't search out a formal resolution for it, any other suggestion from you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an optimization and we don't want to lose it. The issue apparently is a bug in compiler and should be worked around by some compiler flag/hints
@@ -279,7 +279,7 @@ class SelectivityVector { | |||
if (begin_ == -1) { | |||
begin_ = 0; | |||
end_ = 0; | |||
allSelected_ = false; | |||
allSelected_.reset(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
@yma11 what is your OS version? We do build Velox on Ubuntu-22.04 which comes with GCC 11.4.0. |
The root cause was finally identified that we made some changes in compile options in gluten and it causes this error pop up. Velox default compilation doesn't have this problem. Let me close this PR. Thanks for your info. |
We found this issue when building pure meta/velox, just add |
…p-overflow=] (facebookincubator#10469) Summary: I hit this on ubuntu-22.04 arm64 with GCC11. This was reported in the past as well facebookincubator#9578 Pull Request resolved: facebookincubator#10469 Reviewed By: Yuhta Differential Revision: D59872624 Pulled By: kevinwilfong fbshipit-source-id: 0fa03176dc664121103bf1f521369f1452a990d1
…p-overflow=] (facebookincubator#10469) (#507) Summary: I hit this on ubuntu-22.04 arm64 with GCC11. This was reported in the past as well facebookincubator#9578 Pull Request resolved: facebookincubator#10469 Reviewed By: Yuhta Differential Revision: D59872624 Pulled By: kevinwilfong fbshipit-source-id: 0fa03176dc664121103bf1f521369f1452a990d1 Co-authored-by: Deepak Majeti <[email protected]>
This PR fixes following error popped during compilation using GCC 11: