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

[BUG] struct row comparator crashes on empty structs #10603

Closed
sperlingxx opened this issue Apr 6, 2022 · 0 comments · Fixed by #10604
Closed

[BUG] struct row comparator crashes on empty structs #10603

sperlingxx opened this issue Apr 6, 2022 · 0 comments · Fixed by #10604
Assignees
Labels
bug Something isn't working

Comments

@sperlingxx
Copy link
Contributor

Describe the bug
The latest struct row comparator, which was introduced by #10164, leads to CUDA_ERROR when encountering empty structs.

Steps/Code to reproduce bug

  std::vector<bool> v{0, 0, 0, 0, 0, 0};
  fixed_width_column_wrapper<int32_t> col_for_mask{{0, 0, 0, 0, 0, 0}, v.begin()};
  auto null_mask  = cudf::copy_bitmask(col_for_mask.release()->view());
  auto struct_col = cudf::make_structs_column(
    6, std::vector<std::unique_ptr<column>>{}, UNKNOWN_NULL_COUNT, std::move(null_mask));

  fixed_width_column_wrapper<int32_t> col1{{1, 2, 3, 1, 2, 3}};
  fixed_width_column_wrapper<int32_t> col2{{1, 1, 1, 2, 2, 2}};
  table_view input{{col1, col2, struct_col->view()}};

  fixed_width_column_wrapper<int32_t> expected{{0, 2, 4, 1, 3, 5}};
  std::vector<order> column_order{order::ASCENDING, order::ASCENDING, order::ASCENDING};

  auto got = sorted_order(input, column_order);
  CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected, got->view());
@sperlingxx sperlingxx added bug Something isn't working Needs Triage Need team to review and classify labels Apr 6, 2022
@sperlingxx sperlingxx self-assigned this Apr 6, 2022
rapids-bot bot pushed a commit that referenced this issue Apr 8, 2022
Fixes #10603

This PR is to fix a bug of the optimized struct row comparator. For now,  the struct row comparator assumes that structs being compared are non-empty, so it fails when comparing empty structs.

Authors:
  - Alfred Xu (https://github.com/sperlingxx)
  - Devavret Makkar (https://github.com/devavret)

Approvers:
  - Devavret Makkar (https://github.com/devavret)
  - Nghia Truong (https://github.com/ttnghia)

URL: #10604
@bdice bdice removed the Needs Triage Need team to review and classify label Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants