-
Notifications
You must be signed in to change notification settings - Fork 871
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 out-of-bound access in cudf::detail::label_segments
#11497
Conversation
Added DO_NOT_MERGE label, waiting for Spark team to verify. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks for the fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test that catches this?
No way to catch this consistently. I had to run tests in Spark with large random input columns to get the test inconsistently failed.
|
In addition, the current list distinct tests already covered this case but they never failed. |
I guess maybe |
I ran this locally with a test that was reproducing and with the patch it doesn't anymore. LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 good catch!
Rerun tests. |
Codecov Report
@@ Coverage Diff @@
## branch-22.08 #11497 +/- ##
=============================================
Coverage 86.47% 86.47%
=============================================
Files 144 144
Lines 22856 22856
=============================================
Hits 19765 19765
Misses 3091 3091 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
👍 Yikes. This is a good corner case to look out for. |
In
cudf::detail::label_segments
, when the input lists column has empty/nulls lists at the end of the column, itsoffsets
column will contain out-of-bound indices. This leads to invalid memory access bug. Such bug is elusive and doesn't show up consistently. Test failures reported in NVIDIA/spark-rapids#6249 are due to this.The existing unit tests already cover such corner case. Unfortunately, the bug didn't show up until being tested on some systems. Even that, it was very difficult to reproduce it.
Closes #11495.