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
Linux "dotnet run" fails with Win32Exception when launching at low process priority #5372
Comments
I made a small change on a fork to see what the fix might look like: master...Foritus:master It would be simpler to change the "lowPriority" priority to "Idle" but I assume someone cared enough to use BelowNormal rather than Idle, so I preserved the behaviour. |
related: #5365 |
Duplicate of #5365 |
I went with @bgianfo's design. In his words:
|
Hello, this has recently regressed and caused my build system to fall over. We manually invoke
dotnet build
withnice -n20 ionice -c3
to ensure the machine remains responsive during a large build, but this now causes msbuild to crash in recent builds.It looks like the bug is here: https://github.com/microsoft/msbuild/blob/236f48ecb51e413c13a16d55b6712df4d0a3ca9f/src/MSBuild/XMake.cs#L630
MSBuild needs to store the process' current priority instead of assuming it is running at "Normal".
Commit that introduced the regression: b111470#diff-3099880c51224257bef6905bc2dfbf3d
Steps to reproduce
dotnet new webapi
nice -n20 dotnet build
Observe crash.
MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
System.ComponentModel.Win32Exception (13): Permission denied
at System.Diagnostics.Process.set_PriorityClassCore(ProcessPriorityClass value)
at System.Diagnostics.Process.set_PriorityClass(ProcessPriorityClass value)
at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
Unhandled exception. System.ComponentModel.Win32Exception (13): Permission denied
at System.Diagnostics.Process.set_PriorityClassCore(ProcessPriorityClass value)
at System.Diagnostics.Process.set_PriorityClass(ProcessPriorityClass value)
at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
at Microsoft.Build.CommandLine.MSBuildApp.Main(String[] args)
Expected behavior
MSBuild doesn't crash.
Actual behavior
It crashes.
Environment data
dotnet --version
3.1.300
OS info:
Ubuntu Server 18 lts
The text was updated successfully, but these errors were encountered: