Repository navigation
Fix use-after-free in memory_stats_logger - #22333
Merged
rapids-bot[bot] merged 7 commits intoApr 29, 2026
Merged
Conversation
Member
Author
|
/ok to test e5ebc94 |
bdice
approved these changes
Apr 29, 2026
bdice
left a comment
Contributor
There was a problem hiding this comment.
Thanks for this fix! I suggested one alternative which I believe is equivalent.
Co-authored-by: Bradley Dice <[email protected]>
Member
Author
|
pre-commit.ci autofix |
Member
Author
|
/ok to test 931a355 |
bdice
reviewed
Apr 29, 2026
davidwendt
requested changes
Apr 29, 2026
davidwendt
left a comment
Contributor
There was a problem hiding this comment.
I feel like this conflicts with this PR #22267 at least for the gtests fixture changes.
I'm not sure how best to resolve this.
Member
Author
mhaseeb123
approved these changes
Apr 29, 2026
Member
Author
|
/ok to test 0564656 |
davidwendt
approved these changes
Apr 29, 2026
Member
Author
|
/merge |
vyasr
pushed a commit
to vyasr/cudf
that referenced
this pull request
May 4, 2026
After NVIDIA#22008, `cudf::set_current_device_resource()` returns the previous resource as an owning `any_resource`. `memory_stats_logger` discarded that return value and held a non-owning `device_async_resource_ref` to the now-destroyed pool, causing a segfault on the next allocation (e.g. `GROUPBY_NVBENCH -b 4` crashed on iteration 2). ### Follow-up Mark RMM's `set_*/reset_*_device_resource` `[[nodiscard]]` so this misuse fails at compile time. Authors: - Yunsong Wang (https://github.com/PointKernel) - https://github.com/apps/pre-commit-ci Approvers: - Bradley Dice (https://github.com/bdice) - Muhammad Haseeb (https://github.com/mhaseeb123) - David Wendt (https://github.com/davidwendt) URL: NVIDIA#22333
shrshi
pushed a commit
to shrshi/cudf
that referenced
this pull request
May 12, 2026
After NVIDIA#22008, `cudf::set_current_device_resource()` returns the previous resource as an owning `any_resource`. `memory_stats_logger` discarded that return value and held a non-owning `device_async_resource_ref` to the now-destroyed pool, causing a segfault on the next allocation (e.g. `GROUPBY_NVBENCH -b 4` crashed on iteration 2). ### Follow-up Mark RMM's `set_*/reset_*_device_resource` `[[nodiscard]]` so this misuse fails at compile time. Authors: - Yunsong Wang (https://github.com/PointKernel) - https://github.com/apps/pre-commit-ci Approvers: - Bradley Dice (https://github.com/bdice) - Muhammad Haseeb (https://github.com/mhaseeb123) - David Wendt (https://github.com/davidwendt) URL: NVIDIA#22333
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.
Description
After #22008,
cudf::set_current_device_resource()returns the previous resource as an owningany_resource.memory_stats_loggerdiscarded that return value and held a non-owningdevice_async_resource_refto the now-destroyed pool, causing a segfault on the next allocation (e.g.GROUPBY_NVBENCH -b 4crashed on iteration 2).Follow-up
Mark RMM's
set_*/reset_*_device_resource[[nodiscard]]so this misuse fails at compile time.Checklist