-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Console.ForegroundColor deadlocks Console on OSX #34197
Comments
@danmosemsft I had a look at this issue. There is a deadlock happening here between Task setting
Task calling
|
Probably we want to continue
So the fix should be to ensure no-one holds I'll look into making this change. |
Actually, the user may also hold We can't call |
From a quick peek, most of the lazily-initialized members could be done optimistically, without a lock and just with a compare-exchange to substitute in the results. A few of them might be more complicated, though. |
Description
The console is locked with the following conditions :
Thread dotnet/core#1. Console.WriteLine
Thread dotnet/core#2. Console.ForegroundColor locks and never returns
Thread dotnet/core#3. Console.ReadLine is locked and never returns
Problem on NET Core OSX version 3.1.200. Works on Windows x64.
Expected
Thread dotnet/core#1. Console.WriteLine
Thread dotnet/core#2. Console.ForegroundColor returns
Thread dotnet/core#3. Console.ReadLine returns
Code to reproduce
`
`
environnement
SDK .NET Core (reflétant tous les global.json) :
Version: 3.1.200
Commit: c5123d973b
Environnement d'exécution :
OS Name: Mac OS X
OS Version: 10.15
OS Platform: Darwin
RID: osx.10.15-x64
Base Path: /usr/local/share/dotnet/sdk/3.1.200/
Host (useful for support):
Version: 3.1.2
Commit: 916b5cba26
.NET Core SDKs installed:
3.1.200 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Thanks for your help.
The text was updated successfully, but these errors were encountered: