Skip to content

let_value, _error, & _stopped: Use After Move On Exception From Connect#1711

Merged
ericniebler merged 1 commit intoNVIDIA:mainfrom
RobertLeahy:let_value_use_after_move_20251213
Dec 15, 2025
Merged

let_value, _error, & _stopped: Use After Move On Exception From Connect#1711
ericniebler merged 1 commit intoNVIDIA:mainfrom
RobertLeahy:let_value_use_after_move_20251213

Conversation

@RobertLeahy
Copy link
Contributor

When a completion signal is sent on the appropriate completion channel (i.e. set_value, set_error, or set_stopped) let_value, let_error, and let_stopped (respectively):

  1. Store the values associated with the signal, if any,
  2. Invoke their associated invocable with those stored values, and then
  3. Connect the sender returned by that invocation

Prior to this commit the implementation of the operations enumerated above moved the final receiver into the connect operation in step 3 (more precisely those implementations moved the final receiver into a wrapper receiver which was in turn moved into that connect operation). This meant that if the connect operation:

  1. Decay-copied the receiver (thereby moving from it), and then
  2. Threw an exception

The resulting error completion signal would be sent to a receiver which had been moved from.

Reproduced in a unit test and fixed.

When a completion signal is sent on the appropriate completion channel
(i.e. set_value, set_error, or set_stopped) let_value, let_error, and
let_stopped (respectively):

1. Store the values associated with the signal, if any,
2. Invoke their associated invocable with those stored values, and then
3. Connect the sender returned by that invocation

Prior to this commit the implementation of the operations enumerated
above moved the final receiver into the connect operation in step 3
(more precisely those implementations moved the final receiver into a
wrapper receiver which was in turn moved into that connect operation).
This meant that if the connect operation:

1. Decay-copied the receiver (thereby moving from it), and then
2. Threw an exception

The resulting error completion signal would be sent to a receiver which
had been moved from.

Reproduced in a unit test and fixed.
@copy-pr-bot
Copy link

copy-pr-bot bot commented Dec 13, 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 43feda9

@ericniebler ericniebler merged commit fbb47a2 into NVIDIA:main Dec 15, 2025
21 checks passed
@ericniebler
Copy link
Collaborator

thanks, robert!

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