roslyn: Long-running VBCSCompiler.dll process runs at 100% CPU after parent process dies
Version Used: Using dotnet SDK 2.2.0-preview1-007866 on macOS 10.13.2
Steps to Reproduce: TBH not sure 100% how to get into bad state. I don’t know what is launching VBCSCompiler.dll. The parent process is gone…which is the issue.
But, it has been happening fairly often over the last few days while working on the https://github.com/dotnet/cli repo using VS Code - Insiders + C# extension 1.13.1.
If someone can point me to how to capture more information about how this long-running compiler server starts, I can provide a better repro.
Expected Behavior: No long running compiler process after I shutdown tools and build scripts.
Actual Behavior:
VS Code is closed, and I’ve killed the the build.sh script, yet I have two VBCSCompiler processes running. ps
reports the processes have been open for ~ 18 hours.
The process was launched with these arguments:
/Users/namc/.dotnet/dotnet /Users/namc/.dotnet/sdk/2.2.0-preview1-007866/Roslyn/bincore/VBCSCompiler.dll -pipename:namc.False.bZ9mpL2HFmG8IVwxPkEmz6_N4OMYW1cLZOeZGRjGfv0
Process sample: processample.txt
[EDIT]
See below for a workaround: https://github.com/dotnet/roslyn/issues/24137#issuecomment-388494024
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 13
- Comments: 25 (9 by maintainers)
Commits related to this issue
- Limit compiler server pipe name length (#24265) On MacOS pipes are implemented using Unix domain sockets. Unix domain sockets must have a valid file path for their endpoint. The best place is in th... — committed to dotnet/roslyn by agocke 6 years ago
- Use new pipe API for compiler server on Unix The default behavior for the NamedPipeServerStream API is to take a pipe name and then construct a named pipe in the background using that name. In Window... — committed to agocke/roslyn by agocke 5 years ago
I was able to workaround this issue by creating the file
~/Library/LaunchAgents/UseSharedCompilation.plist
with the following content:Then logout and login. This should disable the shared compiler server for all apps, including Terminal, Visual Studio Code, and Visual Studio for Mac.
The workaround should be compatible with OS X Yosemite (10.10) or later.
I also have the same issue, even after manually killing all on the next build they all come back
I’ve also set DOTNET_RUNNING_IN_CONTAINER=true TMPDIR=/tmp
We are using teamcity and have also updated to the latest dotnet-cli runner
I am still facing this issue. Running on MacOS 10.14.4 on VSCode
I’ve started to notice this on JetBrains Rider but I can also reproduce with
dotnet run
.CPU usage spikes up to over 600%~700%(!!) during build, and the process behind it is
VBCSCompiler.dll
asps aux | grep dotnet
shows:Running on macOS Big Sur 11.5.1.
dotnet info
:I would appreciate getting a workaround or a solution to this as it really annoys me when casually building projects.
I’ve tried disabling VBCSCompiler via
/p:UseSharedCompilation=false
, but it has absolutely no effect andVBCSCompiler
still shows up.Similar issues on a long running Teamcity build agent
Another workaround: if you set the
TMPDIR
environment variable to/tmp
, that will probably fix the problem and let you still use the compiler server.