Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jan 19, 2024

Backport of #96936 to release/8.0-staging

/cc @davmason

Customer Impact

  • Customer reported
  • Found internally

This was reported by an internal customer, they ported their app to 8.0 and observed that there was regularly crashes on process exit. This was tracked down to a race between shutdown and threads firing events. If _ep_threads_lock is accessed after it is cleaned up it will cause an AV.

Regression

  • Yes (from .NET 6)
  • No

Testing

Customer has verified the fix

Risk

Low - we are not cleaning up some resources now, which should have no impact on the process and be relatively safe.

@ghost ghost added the area-Tracing-coreclr label Jan 19, 2024
@davmason davmason requested review from jeffschwMSFT, lateralusX and a team January 20, 2024 00:24
@davmason davmason self-assigned this Jan 20, 2024
@davmason davmason added this to the 8.0.x milestone Jan 20, 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.

approved. please get a code review. we will take for consideration in 8.0.x

Copy link
Member

@hoyosjs hoyosjs left a comment

Choose a reason for hiding this comment

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

Do we need to document anything as breaking for the mono embedding scenarios?

@davmason
Copy link
Contributor

Do we need to document anything as breaking for the mono embedding scenarios?

@lateralusX can correct me here, but I don't believe so. The worst case scenario is we leak a single lock, and the way the code is written we may have leaked it anyways, since the free only happens if _ep_threads is empty.

@lateralusX
Copy link
Member

Do we need to document anything as breaking for the mono embedding scenarios?

@lateralusX can correct me here, but I don't believe so. The worst case scenario is we leak a single lock, and the way the code is written we may have leaked it anyways, since the free only happens if _ep_threads is empty.

Its fine, no need to document, but I do think we should have different ways of uninitializing EventPipe at some point in the future, one that assumes process dies and that we have less control of threads (like we have now) and another that is a more strict uninitialize assuming all threads have been stopped/killed before when EventPipe gets uninitialized, in that scenario we could do proper cleanup of all resources allocated.

@jeffschwMSFT jeffschwMSFT added the Servicing-consider Issue for next servicing release review label Feb 6, 2024
@carlossanlop
Copy link
Contributor

Friendly reminder that Monday February 12th is the Code Complete deadline for the March Release. Please make sure to send the email to Tactics requesting approval.

@jeffschwMSFT jeffschwMSFT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Feb 9, 2024
@jeffschwMSFT jeffschwMSFT modified the milestones: 8.0.x, 8.0.3 Feb 9, 2024
@jeffschwMSFT jeffschwMSFT merged commit a143568 into release/8.0-staging Feb 9, 2024
@jkotas jkotas deleted the backport/pr-96936-to-release/8.0-staging branch February 10, 2024 07:05
@github-actions github-actions bot locked and limited conversation to collaborators Mar 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Tracing-coreclr Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants