dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.13k stars 4.04k forks source link

error MSB6006: "csc.dll" exited with code 137 #39276

Closed livarcocc closed 3 years ago

livarcocc commented 5 years ago

@khteh commented on Thu Oct 10 2019

Steps to reproduce

Screenshot from 2019-10-11 10-54-24

Expected behavior

Actual behavior

Environment data

dotnet --info output:

$ dn --info
.NET Core SDK (reflecting any global.json):
 Version:   3.0.100
 Commit:    04339c3a26

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  19.04
 OS Platform: Linux
 RID:         ubuntu.19.04-x64
 Base Path:   /usr/share/dotnet-3.0.100/sdk/3.0.100/

Host (useful for support):
  Version: 3.0.0
  Commit:  7d57652f33

.NET Core SDKs installed:
  3.0.100 [/usr/share/dotnet-3.0.100/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.0.0 [/usr/share/dotnet-3.0.100/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.0.0 [/usr/share/dotnet-3.0.100/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download
gafter commented 5 years ago

Please provide the source files and a build script that demonstrates the failure.

khteh commented 5 years ago

Reply from CircleCI:

Exit code 137 typically means that your process is getting killed because it is running out of memory.

Could that point to potentially memory leak in the toolchain?

khteh commented 5 years ago

I have 33 projects in the .sln. I can build the .csproj individually without the error MSB6006.

SohamJadiya commented 4 years ago

Hey Did anybody solved this error? Because I am getting the same error whilst trying to build nopcommerce on centos with dotnet.

adebelyi commented 4 years ago

Hey Did anybody solved this error? Because I am getting the same error whilst trying to build nopcommerce on centos with dotnet.

How much RAM do you have? In my situation after restarting the server everything was ok. After some time, build was falling with this error until I restart the server.

hasancemcerit commented 4 years ago

This exact same error occurs on my TeamCity build agent that runs on Ubuntu as well.

My observation is that I have sonarqube analyzer step enabled when this error in dotnet build occurs. If I disable that step, I haven't encountered the error. 🤔

Although I watched the memory usage while the build is running and it didn't peak, I also think it might be something to do with memory.

ibnuh commented 3 years ago

In my situation after restarting the server everything was ok. After some time, build was falling with this error until I restart the server.

What on earth is happening.. been trying to solve this for days and solution is just to restart the server, wish I tried your suggestion first time I saw it!!

gr8tushar commented 3 years ago

Facing the same issue. Any plans of fixing it?

Marcel-B commented 3 years ago

Free up more space for Docker.

image

ecooperman commented 3 years ago

Wow, glad I stumbled up on....a restart fixed it but I was really scratching my head since this worked for me the very first time I tried!

cbries commented 3 years ago

Happend right now on our azure build agents:

image

`##[error] [174.86s] /tmp/hmi/pennywise2/hmi/dotnet_sdk_freebsd_x64/sdk/5.0.100-dev/Roslyn/Microsoft.CSharp.Core.targets(70,5): error MSB6006: "csc.dll" exited with code 137. [/usr/home/msbuild/agent02/_work/2/s/TcHmiServer/_build/freebsd-x64/Microsoft.NET/TcHmiExtensionContainer/Core/TcHmiExtensionContainer.Core/TcHmiExtensionContainer.Core.csproj]

[error] [174.87s] /tmp/hmi/pennywise2/hmi/dotnet_sdk_freebsd_x64/sdk/5.0.100-dev/Roslyn/Microsoft.CSharp.Core.targets(70,5): error MSB6006: "csc.dll" exited with code 137. [/usr/home/msbuild/agent02/_work/2/s/TcHmiServer/_build/freebsd-x64/Microsoft.NET/TcHmiSrvExtNet/Core/TcHmiSrvExtNet.Core/1/TcHmiSrvExtNet.Core_1.csproj]

[error] [174.88s] /tmp/hmi/pennywise2/hmi/dotnet_sdk_freebsd_x64/sdk/5.0.100-dev/Roslyn/Microsoft.CSharp.Core.targets(70,5): error MSB6006: "csc.dll" exited with code 137. [/usr/home/msbuild/agent02/_work/2/s/TcHmiServer/_build/freebsd-x64/Microsoft.NET/PluginWebSocket/PluginWebSocket/PluginWebSocket.csproj]

[175.18s] [175.18s] Build FAILED. [175.18s] [175.18s] /usr/home/msbuild/agent02/_work/2/s/TcHmiServer/_build/freebsd-x64/Microsoft.NET/TcHmiExtensionContainer/Core/TcHmiExtensionContainer.Core/TcHmiExtensionContainer.Core.proj(6,3): warning MSB4011: "/tmp/hmi/pennywise2/hmi/dotnet_sdk_freebsd_x64/sdk/5.0.100-dev/Sdks/Microsoft.NET.Sdk/Sdk/Sdk.props" cannot be imported again. It was already imported at "/usr/home/msbuild/agent02/_work/2/s/TcHmiServer/_build/freebsd-x64/Microsoft.NET/TcHmiExtensionContainer/Core/TcHmiExtensionContainer.Core/TcHmiExtensionContainer.Core.csproj". This is most likely a build authoring error. This subsequent import will be ignored. [175.18s] /usr/home/msbuild/agent02/_work/2/s/TcHmiServer/_build/freebsd-x64/Microsoft.NET/TcHmiExtensionContainer/Core/TcHmiExtensionContainer.Core/TcHmiExtensionContainer.Core.csproj : warning MSB4011: "/tmp/hmi/pennywise2/hmi/dotnet_sdk_freebsd_x64/sdk/5.0.100-dev/Sdks/Microsoft.NET.Sdk/Sdk/Sdk.targets" cannot be imported again. It was already imported at "/usr/home/msbuild/agent02/_work/2/s/TcHmiServer/_build/freebsd-x64/Microsoft.NET/TcHmiExtensionContainer/Core/TcHmiExtensionContainer.Core/TcHmiExtensionContainer.Core.proj (202,3)". This is most likely a build authoring error. This subsequent import will be ignored. [175.18s] /usr/home/msbuild/agent02/_work/2/s/TcHmiServer/_build/freebsd-x64/Microsoft.NET/TcHmiExtensionContainer/Core/TcHmiExtensionContainer.Core/TcHmiExtensionContainer.Core.proj(6,3): warning MSB4011: "/tmp/hmi/pennywise2/hmi/dotnet_sdk_freebsd_x64/sdk/5.0.100-dev/Sdks/Microsoft.NET.Sdk/Sdk/Sdk.props" cannot be imported again. It was already imported at "/usr/home/msbuild/agent02/_work/2/s/TcHmiServer/_build/freebsd-x64/Microsoft.NET/TcHmiExtensionContainer/Core/TcHmiExtensionContainer.Core/TcHmiExtensionContainer.Core.csproj". This is most likely a build authoring error. This subsequent import will be ignored. [175.18s] /usr/home/msbuild/agent02/_work/2/s/TcHmiServer/_build/freebsd-x64/Microsoft.NET/TcHmiExtensionContainer/Core/TcHmiExtensionContainer.Core/TcHmiExtensionContainer.Core.csproj : warning MSB4011: "/tmp/hmi/pennywise2/hmi/dotnet_sdk_freebsd_x64/sdk/5.0.100-dev/Sdks/Microsoft.NET.Sdk/Sdk/Sdk.targets" cannot be imported again. It was already imported at "/usr/home/msbuild/agent02/_work/2/s/TcHmiServer/_build/freebsd-x64/Microsoft.NET/TcHmiExtensionContainer/Core/TcHmiExtensionContainer.Core/TcHmiExtensionContainer.Core.proj (202,3)". This is most likely a build authoring error. This subsequent import will be ignored.

[error] [175.18s] /tmp/hmi/pennywise2/hmi/dotnet_sdk_freebsd_x64/sdk/5.0.100-dev/Roslyn/Microsoft.CSharp.Core.targets(70,5): error MSB6006: "csc.dll" exited with code 137. [/usr/home/msbuild/agent02/_work/2/s/TcHmiServer/_build/freebsd-x64/Microsoft.NET/TcHmiExtensionContainer/Core/TcHmiExtensionContainer.Core/TcHmiExtensionContainer.Core.csproj]

[error] [175.18s] /tmp/hmi/pennywise2/hmi/dotnet_sdk_freebsd_x64/sdk/5.0.100-dev/Roslyn/Microsoft.CSharp.Core.targets(70,5): error MSB6006: "csc.dll" exited with code 137. [/usr/home/msbuild/agent02/_work/2/s/TcHmiServer/_build/freebsd-x64/Microsoft.NET/TcHmiSrvExtNet/Core/TcHmiSrvExtNet.Core/1/TcHmiSrvExtNet.Core_1.csproj]

[error] [175.18s] /tmp/hmi/pennywise2/hmi/dotnet_sdk_freebsd_x64/sdk/5.0.100-dev/Roslyn/Microsoft.CSharp.Core.targets(70,5): error MSB6006: "csc.dll" exited with code 137. [/usr/home/msbuild/agent02/_work/2/s/TcHmiServer/_build/freebsd-x64/Microsoft.NET/PluginWebSocket/PluginWebSocket/PluginWebSocket.csproj]

[175.18s] 4 Warning(s) [175.18s] 3 Error(s) `

ibnuh commented 3 years ago

I can reproduce this issue sporadically while building on a machine with 2gb of ram. I measured manually the ram usage on Task Manager, it was around 3.5gb.

So what I did is upgrade my builder instance to 4gb ram, and never encounter this issue again

ghost commented 3 years ago

Closing this issue as we've seen no reply to the request for more information. If you are able to get the requested information, please add it to the issue and we will retriage it.

Matheos96 commented 2 years ago

Reply from CircleCI:

Exit code 137 typically means that your process is getting killed because it is running out of memory.

Could that point to potentially memory leak in the toolchain?

Thanks. This was the root of my problem. I was running dotnet publish in docker and encountered the same issue. My problem was I had limited WSL2 on my machine to only use 2GB RAM max. Docker for Windows uses WSL2 in the background so removing this limitation solved my issue (y)

conanlk commented 3 months ago

Hi Everyone, Did anybody solve this issue? I have a same issue. I ran build docker in local without error. But when I run in pipeline, It raised error. I increase memory to 6GB RAM, but it is not work. I am being upgrade from .net 2.2 to .net 6.