Skip to content

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jun 2, 2025

Backport of #100817 to release/8.0-staging

/cc @hoyosjs @janvorli

Customer Impact

  • Customer reported
  • Found internally

Reported on #115848. dotnet-test was crashing unreliable for the customer. Since several processes get spawned, some would fault and make it look like tests were crashing. This all happened before managed code even ran for them.

Regression

  • Yes
  • No

Testing

Ad Hoc

Risk

Low - code has existed for a while in 9.0 and 10.0

When a foreign thread running in .NET process is killed or crashes due
to some hardware exception, the .NET code that performs shutdown gets
called and incorrectly expects the thread to be a thread that's
registered with the runtime. It calls GetThread on it and then calls a
method on the thread. That leads to an assert in debug builds and crash
in release ones.

The function that is called is not needed for foreign threads though, so
the fix is to skip calling it if the GetThreadNULLOk returns NULL (that
means the thread is foreign and never registered with the runtime).
@hoyosjs hoyosjs requested a review from janvorli June 3, 2025 00:08
@hoyosjs hoyosjs added the Servicing-consider Issue for next servicing release review label Jun 3, 2025
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

lgtm. we will take for consideration in 8.0.x

@jeffschwMSFT jeffschwMSFT added this to the 8.0.x milestone Jun 3, 2025
Copy link
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

@rbhanda rbhanda modified the milestones: 8.0.x, 8.0.18 Jun 3, 2025
@rbhanda rbhanda added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jun 3, 2025
@hoyosjs hoyosjs merged commit 5cc544a into release/8.0-staging Jun 6, 2025
118 of 122 checks passed
@hoyosjs hoyosjs deleted the backport/pr-100817-to-release/8.0-staging branch June 6, 2025 02:56
@github-actions github-actions bot locked and limited conversation to collaborators Jul 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-VM-coreclr Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants