Skip to content

Intermittent hang/deadlock in .net core 5.0 RC1 while debugging #42375

@joakimriedel

Description

@joakimriedel

Description

After upgrading our web application from 3.1 to 5.0 RC1, I get intermittent hangs/deadlocks while debugging. At first, I thought it was a problem specific to Visual Studio 16.8 preview 3 (https://developercommunity.visualstudio.com/content/problem/1187332/debugger-hangs-sporadically-in-visual-studio-2019.html), but I have now verified that the issue is the same when debugging through Visual Studio Code which makes me think this is related to the 5.0 RC1 runtime and not the IDE.

I have not been able to reproduce this when running the project without debugging (ctrl-f5) - only when debugging (f5).

Unfortunately I cannot reliably reproduce this, it seems to be timing related and more often happens when loading pages in the application that fires a lot of different connections to the server. The application also heavily uses EF Core and SignalR Core.

Configuration

.NET Core 5.0 RC1
Win10 build 2004
Threadripper CPU

Regression?

Yes. This never occurred in net core 3.1.

Other information

I find it very hard to debug this issue. It only happens when starting the project in the debugger. But since it totally hangs the debugger, I am unable to break into the application. I cannot attach another debugger, then I get the error "another debugger is already attached".

Some characteristics:

When it happens, the diagnostics logger stops updating

image

I cannot break or terminate the debugger

image

image

The IIS worker process is idle.

image

The output window stops logging any more entries. The last entry is at random, I cannot see any pattern in that the hang would happen after a certain kind of event.

The only way to get back control is to kill the IIS worker process manually through task manager.

I have followed the steps to generate a dotnet-dump, but do not know how to analyze it.

How can I go forward to resolve this? I can reproduce but not choose when to reproduce. Sometimes it hangs on first load, sometimes I have to click around in the application for a few minutes to reproduce.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions