Repository navigation
[libcu++] Fix host_launch callback data leak on registration failure - #12087
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Callback data lifecycle libcudacxx/include/cuda/__launch/host_launch.h |
The code adds the unique_ptr header and an execution-check-disabled host destructor for __stream_callback_data. host_launch retains callback data with unique_ptr during registration, then releases it after registration returns. The copyright year changes to 2026. |
Suggested reviewers: davebayer
Priority:
Change: Bug fix
Merge Risk: 
Minimal · previous review 3a1d9
-
No actionable issue remains from this review; the change is mergeable after normal checks.
Comment @coderabbitai help to get the list of available commands.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: NVIDIA/cccl/.coderabbit.yaml
- Review profile: CHILL
- Plan: Enterprise
- Run ID:
acfe00ef-23f7-4337-b1fe-060f651532ee
📒 Files selected for processing: 1
libcudacxx/include/cuda/__launch/host_launch.h
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.
This comment has been minimized.
This comment has been minimized.
| auto* __casted_data_ptr = static_cast<_CallbackData*>(__data_ptr); | ||
| if (__status == ::CUDA_SUCCESS) | ||
| { | ||
| (void) ::cuda::std::apply(__casted_data_ptr->__callable_, ::cuda::std::move(__casted_data_ptr->__args_)); | ||
| } | ||
| delete __casted_data_ptr; |
There was a problem hiding this comment.
We should wrap this in a unique_ptr as well. The user callable may throw and we leak the _CallbackData* all the same
This comment has been minimized.
This comment has been minimized.
🥳 CI Workflow Results🟩 Finished in 2h 13m: Pass: 100%/228 | Total: 5d 04h | Max: 2h 12m | Hits: 66%/1087271See results here. |
If __streamAddCallback throws we would leak __callback_data_ptr, this PR fixes that with unique_ptr