Skip to content

Fix string grouped aggregate crashes on empty strings and offset boundary#517

Open
liaowanyou wants to merge 4 commits intosirius-db:sirius_serverfrom
liaowanyou:sirius_server
Open

Fix string grouped aggregate crashes on empty strings and offset boundary#517
liaowanyou wants to merge 4 commits intosirius-db:sirius_serverfrom
liaowanyou:sirius_server

Conversation

@liaowanyou
Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants