Avoid potential race conditions in device_scalar/device_uvector setters#725
Merged
rapids-bot[bot] merged 6 commits intorapidsai:branch-0.19from Mar 18, 2021
Merged
Conversation
This was referenced Mar 10, 2021
rongou
approved these changes
Mar 11, 2021
codereport
suggested changes
Mar 15, 2021
Contributor
codereport
left a comment
There was a problem hiding this comment.
Looks good, one minor change
Member
Author
|
I also expanded the |
rapids-bot bot
pushed a commit
to rapidsai/cugraph
that referenced
this pull request
Mar 17, 2021
After rapidsai/rmm#725 is merged, this PR updates cuspatial to eliminate passing literal values to device_uvector::set_element_async. Companion PR to rapidsai/cuspatial#367 Authors: - Mark Harris (@harrism) Approvers: - Seunghwa Kang (@seunghwak) - Alex Fender (@afender) - Andrei Schaffer (@aschaffer) URL: #1453
rapids-bot bot
pushed a commit
to rapidsai/cuspatial
that referenced
this pull request
Mar 18, 2021
After rapidsai/rmm#725 is merged, this PR updates cuspatial to eliminate passing literal values to `device_uvector::set_element_async`. Authors: - Mark Harris (@harrism) Approvers: - Paul Taylor (@trxcllnt) - Christopher Harris (@cwharris) URL: #367
Member
Author
|
@gpucibot merge |
rapids-bot bot
pushed a commit
to rapidsai/cudf
that referenced
this pull request
Mar 19, 2021
…_scalar::set_value (#7563) After rapidsai/rmm#725 is merged, this PR updates cuspatial to eliminate passing literal values to `device_scalar::set_value`. Note there are still similar issues with uses of `cudf::scalar` that need to be addressed. But I wanted to get this open before the end of the week. This can be merged after RMM 725 is merged to fix the build, so I think the `scalar` issues should be fixed separately. Authors: - Mark Harris (@harrism) Approvers: - Devavret Makkar (@devavret) - Paul Taylor (@trxcllnt) - Mike Wilson (@hyperbolic2346) URL: #7563
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is a subtle problem with
rmm::device_uvector::set_element_asyncandrmm::device_scalar::set_value. It's common to pass a literal (e.g. 0) to these functions. But these functions accept the parameter by reference, so if you pass a literal, it's possible for the temporary created to store the literal to be destroyed before thecudaMemcpyAsyncis performed, resulting in a use after free. This PR:&&) overload. This is a breaking API change.device_scalar, adds an optimization forbooltypes to always usecudaMemsetAsync.device_scalar, add a new methodset_value_zerofor the common case of initialization to zero. Also usescudaMemsetAsync.These changes will require PRs to fix up some uses in cudf, cuspatial, and cugraph.