Fix string grouped aggregate crashes on empty strings and offset boundary#517
Open
liaowanyou wants to merge 4 commits intosirius-db:sirius_serverfrom
Open
Fix string grouped aggregate crashes on empty strings and offset boundary#517liaowanyou wants to merge 4 commits intosirius-db:sirius_serverfrom
liaowanyou wants to merge 4 commits intosirius-db:sirius_serverfrom
Conversation
added 4 commits
March 26, 2026 11:27
wmalpica
approved these changes
Mar 30, 2026
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.
Changes
Fix off-by-one in offset array allocation: The offset array in groupedStringAggregate was allocated with count[0] elements, but the kernel reads up to index count[0], causing out-of-bounds memory access. Changed allocation to count[0] + 1.
Remove incorrect cudaAssert in compact_string_offset kernel: The assertion cudaAssert(group_byte_offset[key][offset] != group_byte_offset[key][offset + 1]) incorrectly assumed adjacent byte offsets must differ. This fails for empty strings (zero length), where consecutive offsets are legitimately equal. Removed the assertion.
Remove incorrect cudaAssert in rows_to_columns_string kernel: Same issue as above in a different kernel — the assertion rejects valid empty string entries. Removed.
Add null column guard in GetData(): Added a null pointer check for group_by_result->columns[col] in GPUPhysicalGroupedAggregate::GetData() to prevent segfaults when a column is unexpectedly null.