Skip to content

Fix non-inherited event handle causing wslrelay crash#40477

Open
OneBlue wants to merge 1 commit intomasterfrom
user/oneblue/relay-crash
Open

Fix non-inherited event handle causing wslrelay crash#40477
OneBlue wants to merge 1 commit intomasterfrom
user/oneblue/relay-crash

Conversation

@OneBlue
Copy link
Copy Markdown
Collaborator

@OneBlue OneBlue commented May 9, 2026

Summary of the Pull Request

This change solves a potential crash that happens before m_vmTerminatingEvent isn't actually inherited by wslrelay, and if it's numeric value happens to collide with another handle that's in use by wslrelay.exe, this leads to undefined behavior, since that handle will get double-closed.

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Copilot AI review requested due to automatic review settings May 9, 2026 00:51
@OneBlue OneBlue requested a review from a team as a code owner May 9, 2026 00:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a crash risk when launching wslrelay.exe for WSLC port relay by ensuring the VM terminating event handle is actually inherited by the child process (instead of only being marked inheritable and passed as a numeric value on the command line).

Changes:

  • Explicitly adds m_vmTerminatingEvent to the SubProcess handle inheritance list when launching wslrelay.exe.

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.

3 participants