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] concat empty struct causes seg fault #8929

Closed
revans2 opened this issue Aug 2, 2021 · 0 comments · Fixed by #8947
Closed

[BUG] concat empty struct causes seg fault #8929

revans2 opened this issue Aug 2, 2021 · 0 comments · Fixed by #8947
Labels
bug Something isn't working Spark Functionality that helps Spark RAPIDS

Comments

@revans2
Copy link
Contributor

revans2 commented Aug 2, 2021

Describe the bug
If I try to concatenate two structs columns with no children columns I get a segfault.

Steps/Code to reproduce bug
Apply the patch and run.

diff --git a/cpp/tests/copying/concatenate_tests.cu b/cpp/tests/copying/concatenate_tests.cu
index 7d3b7beb2c..e1c3ce1622 100644
--- a/cpp/tests/copying/concatenate_tests.cu
+++ b/cpp/tests/copying/concatenate_tests.cu
@@ -826,6 +826,19 @@ TEST_F(StructsColumnTest, ConcatenateStructs)
   cudf::test::expect_columns_equivalent(*result, *expected);
 }
 
+TEST_F(StructsColumnTest, ConcatenateEmptyStructs)
+{
+  using namespace cudf::test;
+
+  auto expected = cudf::make_structs_column(10, {}, 0, rmm::device_buffer());
+  auto first = cudf::make_structs_column(5, {}, 0, rmm::device_buffer());
+  auto second = cudf::make_structs_column(5, {}, 0, rmm::device_buffer());
+
+  // concatenate
+  auto result = cudf::concatenate(std::vector<column_view>({*first, *second}));
+  cudf::test::expect_columns_equivalent(*result, *expected);
+}
+
 TEST_F(StructsColumnTest, ConcatenateSplitStructs)
 {
   using namespace cudf::test;

Expected behavior
It does not crash and ideally produces the correct answer.

@revans2 revans2 added bug Something isn't working Needs Triage Need team to review and classify Spark Functionality that helps Spark RAPIDS labels Aug 2, 2021
@ttnghia ttnghia removed the Needs Triage Need team to review and classify label Aug 4, 2021
@rapids-bot rapids-bot bot closed this as completed in #8947 Aug 6, 2021
rapids-bot bot pushed a commit that referenced this issue Aug 6, 2021
Closes #8929

Current PR is to fix the illegal memory access problem occurred when concatenating structs with empty children.

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

Approvers:
  - Nghia Truong (https://github.com/ttnghia)
  - Mike Wilson (https://github.com/hyperbolic2346)

URL: #8947
shwina pushed a commit to shwina/cudf that referenced this issue Aug 9, 2021
Closes rapidsai#8929

Current PR is to fix the illegal memory access problem occurred when concatenating structs with empty children.

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

Approvers:
  - Nghia Truong (https://github.com/ttnghia)
  - Mike Wilson (https://github.com/hyperbolic2346)

URL: rapidsai#8947
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Spark Functionality that helps Spark RAPIDS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants