Skip to content

CoreCLR_Shutdown and MetaDataGetDispenser Hang #69462

@TonyValenti

Description

@TonyValenti

Description

I have a highly concurrent application that ETL's data between systems.

It usually works just fine, however, sometimes it will hang (even when debugging). When it does, the following happens:

  1. App becomes unresponsive and stops processing data.
  2. App maxes out 1 CPU core (but isn't doing anything related to its job)
  3. Visual Studio starts having issues. It seems as if the debugger link between VS and my app gets frozen. I cannot pause/stop my app through VS, and the Diagnostics Tools window stops updating.
  4. The only way to recover is to end-task the application.

When this happens, I took a look at Process Explorer to look at threads and noticed that CoreClr_Shutdown is the function that is maxing out one CPU. I also noticed that there are a lot of MetaDataGetDispenser threads.

I am not sure what is happening but I suspect that there is some kind of race condition I am bumping into somewhere in the framework.

When .NET 6.0 first came out, I opened a ticket with MS Support using my MSDN subscription. I spent a lot of time and got nowhere. Since upgrading to .NET 6.0.5, this seems to happen a whole lot more.

Is there anyone who can help?

Below are screen shots of what I see through Process Explorer:
image

image

Reproduction Steps

Run my app. Sometimes it happens. Sometimes it does not.

Expected behavior

The app always runs responsively. If there is a bug in my app, I should still be able to pause/stop through VS.

Actual behavior

My app freezes and VS starts misbehaving. Trying to pause/stop through VS does nothing and I must end-task my app.

Regression?

It was an issue and now seems to occur more often since upgrading to .NET 6.0.5.

Known Workarounds

Kill my app and try again.

Configuration

.NET 6.0.5
Windows 11
x64
WPF

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions