Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/9.0] Fix thread static cleanup paths #107554

Merged
merged 3 commits into from
Sep 10, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 9, 2024

Backport of #107438 to release/9.0

/cc @davidwrighton

Customer Impact

  • Customer reported
  • Found internally

Cleanup of thread statics was taking a lock at an inappropriate time, and research into that problem identified that collectible thread statics were not working correctly. These issues are now fixed.

Regression

  • Yes
  • No

This was regressed with the large statics rewrite this summer. Thread statics for collectible assemblies were not leak free in .NET 8.

Testing

This fix fixes an issue that was causing intermittent assertion failures.
This fix was verified with manual inspection as well as a bespoke stress test designed to stress thread statics on collectible assemblies.

Risk

Medium, thread statics cleanup is a not highly tested scenario due to our general lack of VM stress tests in the test suite. We are able to effectively find issues with normal thread statics, but statics on collectible assemblies are not highly stressed. This risk was mitigated with a bespoke thread statics for collectible assemblies stress test that I wrote, but we don't have good coverage here in CI, and there isn't a place to put the stress test.

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch is release/X.0-staging, not release/X.0.

  • If the change touches code that ships in a NuGet package, you have added the necessary package authoring and gotten it explicitly reviewed.

…ding the spin lock - Free the pLoaderHandle array when the thread is terminated
…ew more issues were found - Fix issue where the LoaderAllocator's SegmentedHandleIndex wasn't being freed - Fix issue where the logic to re-use TLSIndex values wasn't working properly
Copy link
Contributor

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

@JulieLeeMSFT JulieLeeMSFT added the Servicing-approved Approved for servicing release label Sep 10, 2024
@jkotas jkotas merged commit 751df15 into release/9.0 Sep 10, 2024
91 of 95 checks passed
@jkotas jkotas deleted the backport/pr-107438-to-release/9.0 branch September 10, 2024 05:35
@github-actions github-actions bot locked and limited conversation to collaborators Oct 10, 2024
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.

5 participants