Skip to content

Conversation

@sithhell
Copy link
Contributor

In the case when when_all is being stopped from a stop source in the environment, the stop_source was triggered multiple times leading to a use after free bug.

This patch fixes this by performing the following steps:

  • Inside the stop callback, increment the reference count.
  • Try setting the state to stopped, only if stopped, trigger the internal stop_source which cancels the children.
  • Arrive to decrement the count again and handle any concurrent completions if needed.

In the case when when_all is being stopped from a stop source in the
environment, the stop_source was triggered multiple times leading to a
use after free bug.

This patch fixes this by performing the following steps:

 - Inside the stop callback, increment the reference count.
 - Try setting the state to stopped, only if stopped, trigger the
   internal stop_source which cancels the children.
 - Arrive to decrement the count again and handle any concurrent
   completions if needed.
@copy-pr-bot
Copy link

copy-pr-bot bot commented Dec 17, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@ericniebler
Copy link
Collaborator

/ok to test 1982e32

@ericniebler
Copy link
Collaborator

/ok to test 75c45fb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants