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/6.0-staging] Fix AV in host from tracing on exit #101260

Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Apr 18, 2024

Backport of #77425 and #77765 to release/6.0-staging

/cc @elinor-fung

Customer Impact

  • Customer reported
  • Found internally

This is affecting MATLAB, their customers, and their users. A common scenario for their customers is publishing MATLAB functions as .NET assemblies that can be used in .NET applications. This workflow runs into the AV addressed by this fix. This crash prevents those customers and their users from upgrading to the latest version of MATLAB - this bug effectively introduces a breaking change in their latest version.

The issue was that we were using a static variable that had a destructor for locking around tracing. If a thread calls exit, the static destructor is called on that thread with no synchronization with other threads. Other threads would try to use the destructed object, resulting in a crash.

The fix switches to a mechanism that does not have a destructor and removes unnecessary usage of the lock.

Regression

  • Yes
  • No

Testing

The original fixes in .NET 8 were verified by the customer. This customer has verified that .NET 8 works while .NET 6 does not.

Risk

Low. This fix has been in since early .NET 8.

Copy link
Contributor

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

@jeffschwMSFT jeffschwMSFT added the Servicing-consider Issue for next servicing release review label Apr 18, 2024
@jeffschwMSFT jeffschwMSFT added this to the 8.0.x milestone Apr 18, 2024
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 6.0.x

@rbhanda rbhanda modified the milestones: 6.0.x, 6.0.31 Apr 23, 2024
@rbhanda rbhanda added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Apr 23, 2024
@elinor-fung
Copy link
Member

Failures are all known (#100558) and unrelated.

@elinor-fung elinor-fung merged commit a24f294 into release/6.0-staging Apr 29, 2024
170 of 184 checks passed
@elinor-fung elinor-fung deleted the backport/pr-77425-to-release/6.0-staging branch April 29, 2024 22:00
@github-actions github-actions bot locked and limited conversation to collaborators May 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Host Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants