Skip to content
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 possible int overflow in compute_mixed_join_output_size #17633

Merged

Conversation

davidwendt
Copy link
Contributor

Description

Fixes possible integer overflow condition when the number of rows is near max int32 in compute_mixed_join_output_size kernel function.
Reference #10368

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@davidwendt davidwendt added bug Something isn't working 3 - Ready for Review Ready for review by team libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change labels Dec 19, 2024
@davidwendt davidwendt self-assigned this Dec 19, 2024
@davidwendt davidwendt requested a review from a team as a code owner December 19, 2024 18:09
@@ -928,7 +928,7 @@ __launch_bounds__(block_size) CUDF_KERNEL
get_json_object_options options)
{
auto tid = cudf::detail::grid_1d::global_thread_id();
auto const stride = cudf::thread_index_type{blockDim.x} * cudf::thread_index_type{gridDim.x};
auto const stride = cudf::detail::grid_1d::grid_stride();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a cleanup included here for convenience.

@@ -80,7 +80,7 @@ CUDF_KERNEL void __launch_bounds__(block_size)
auto count_equality = pair_expression_equality<has_nulls>{
evaluator, thread_intermediate_storage, swap_tables, equality_probe};

for (cudf::size_type outer_row_index = start_idx; outer_row_index < outer_num_rows;
for (auto outer_row_index = start_idx; outer_row_index < outer_num_rows;
outer_row_index += stride) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding stride to outer_row_index when start_index (thread-index) is within block-size of max int32 will cause it to overflow.

@davidwendt
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit f9f5f7d into rapidsai:branch-25.02 Dec 20, 2024
110 checks passed
@davidwendt davidwendt deleted the fix-mixed-join-overflow branch December 20, 2024 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team bug Something isn't working libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants