fix: Aggregate destroyAccumulator memset call with dynamic class input#14568
Closed
nmahadevuni wants to merge 1 commit intofacebookincubator:mainfrom
Closed
fix: Aggregate destroyAccumulator memset call with dynamic class input#14568nmahadevuni wants to merge 1 commit intofacebookincubator:mainfrom
nmahadevuni wants to merge 1 commit intofacebookincubator:mainfrom
Conversation
✅ Deploy Preview for meta-velox canceled.
|
Yuhta
reviewed
Aug 22, 2025
velox/exec/Aggregate.h
Outdated
| auto accumulator = value<T>(group); | ||
| std::destroy_at(accumulator); | ||
| ::memset(accumulator, 0, sizeof(T)); | ||
| ::memset((void*)accumulator, 0, sizeof(T)); |
Contributor
There was a problem hiding this comment.
The style guidance is to use static_cast
Collaborator
Author
There was a problem hiding this comment.
Thanks @Yuhta, @aditi-pandit for the review. I have addressed the comment. Please review.
c128b05 to
97804af
Compare
Collaborator
Author
|
@Yuhta Can you please review this? |
Yuhta
approved these changes
Sep 4, 2025
Contributor
Contributor
nimesh1601
pushed a commit
to nimesh1601/velox
that referenced
this pull request
Sep 10, 2025
facebookincubator#14568) Summary: If we use a dynamic class in the Accumulator, then the `memset` call in `destroyAccumulator` fails during build with ``` velox/velox/exec/Aggregate.h:437:16: error: destination for this 'memset' call is a pointer to class containing a dynamic class 'update_theta_sketch_alloc<std::allocator<unsigned long long>>'; vtable pointer will be overwritten [-Werror,-Wdynamic-class-memaccess] 437 | ::memset(accumulator, 0, sizeof(T)); ``` Encountered this when working on prestodb/presto#25685 Pull Request resolved: facebookincubator#14568 Reviewed By: xiaoxmeng Differential Revision: D81692109 Pulled By: Yuhta fbshipit-source-id: 55fc80cfde5a339d8c39b211c062a374013037cd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If we use a dynamic class in the Accumulator, then the
memsetcall indestroyAccumulatorfails during build withEncountered this when working on prestodb/presto#25685