-
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: GCC13 build failures #12517
base: main
Are you sure you want to change the base?
fix: GCC13 build failures #12517
Conversation
✅ Deploy Preview for meta-velox canceled.
|
cbc2221
to
15aaf7b
Compare
velox/dwio/dwrf/common/Compression.h
Outdated
@@ -87,7 +87,7 @@ inline std::unique_ptr<dwio::common::BufferedOutputStream> createCompressor( | |||
|
|||
inline CompressionOptions getDwrfOrcDecompressionOptions( | |||
common::CompressionKind kind) { | |||
CompressionOptions options; | |||
CompressionOptions options{}; |
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.
Why add {} here?
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.
Initialize options
explicitly to avoid using it uninitialized.
/root/velox/./velox/dwio/dwrf/common/Compression.h:99:10: error: ‘options’ is used uninitialized [-Werror=uninitialized]
99 | return options;
| ^~~~~~~
/root/velox/./velox/dwio/dwrf/common/Compression.h: In member function ‘virtual void TestSeek_uncompressed_Test::TestBody()’:
/root/velox/./velox/dwio/dwrf/common/Compression.h:90:22: note: ‘options’ declared here
90 | CompressionOptions options;
| ^~~~~~~
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.
Let's initialize the fields in the struct CompressionOptions
example: uint32_t compressionThreshold;
must be uint32_t compressionThreshold{0};
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.
Initialized the fields.
There is no default value for CompressionOptions.format
, so I left it empty initialized, which results in format.zlib.windowBits
and format.zlib.compressionLevel
being initialized to 0.
As for CompressionOptions.compressionThreshold
, it is currently used only by DwrfOrcCompression
, where its value is configured via orc.compression.threshold
, with a default of 256. However, since CompressionOptions
is part of the common package, I believe it would be more appropriate to initialize compressionThreshold
to 0.
Does the approach seem reasonable?
inputVector, | ||
"Input vector is not a RowVector: {}", | ||
inputVector->toString()); | ||
VELOX_CHECK_NOT_NULL(inputVector, "Input vector can't be null."); |
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.
Why change this error message?
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.
When inputVector is nullptr, inputVector->toString()
in the previous message will cause a null pointer dereference.
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.
auto vector = restoreVectorFromFile(inputPathsList[i].c_str(), deserializerPool.get());
auto inputVector = std::dynamic_pointer_cast<RowVector>(vector);
use vector->toString() in the null check argument.
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.
Updated.
@xin-zhang2 The experimental CI job that uses GCC 13 needs to be triggered to test this. Can you add a comment somewhere in .github/workflows/experimental.yml to trigger the CI? |
@majetideepak I've added a comment to trigger the CI, but it looks the Experimental Fuzzer Job didn't pick my code.
while I have already made the following change in my PR. Any idea on this? |
@xin-zhang2 CI is checking out the main branch. Are you able to test this locally? If yes, we an undo the comment. |
This reverts commit 3c052e2.
@majetideepak Yes, the build runs successfully on my local ubuntu 24.04 enviroment. |
@xin-zhang2 thanks for this fix. Meta will import and merge this. |
Fix #12497 .