runtime: Unable to build on Ubuntu 18.04

I’m struggling to build on Ubuntu 18.04 recently. Things get going for a few minutes and then:

MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
System.ArgumentNullException: Value cannot be null.
Parameter name: array
   at Microsoft.Build.Execution.BuildManager.EndBuild()
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, Boolean isolateProjects, Boolean graphBuild, String[] inputResultsCaches, String outputResultsCache)

I’m not sure if this is related to dotnet/runtime#29629 or not, but on the surface it seems like two different issues.

This error always occurs after this in the build log:

Verifying closure of runtime.linux-x64.Microsoft.Private.CoreFx.NETCoreApp runtime assemblies
Verifying no duplicate types in runtime.linux-x64.Microsoft.Private.CoreFx.NETCoreApp runtime assemblies
Microsoft.Private.CoreFx.NETCoreApp -> /code/personal/corefx/artifacts/packages/Debug/specs/runtime.linux-x64.Microsoft.Private.CoreFx.NETCoreApp.nuspec
runtime.native.System.IO.Ports -> /code/personal/corefx/artifacts/packages/Debug/specs/runtime.native.System.IO.Ports.nuspec
runtime.native.System.IO.Ports -> /code/personal/corefx/artifacts/packages/Debug/specs/runtime.linux-x64.runtime.native.System.IO.Ports.nuspec
šŸ’„

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 36 (36 by maintainers)

Most upvoted comments

Nice job everyone helping root cause this. So the fix is already in Preview 6 then (plus the MSBuild change in next preview).

Thanks, folks! With a private of https://github.com/microsoft/msbuild/pull/4417, I get a better stack:

MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
System.ArgumentNullException: Value cannot be null.
Parameter name: array
   at System.Buffers.TlsOverPerCoreLockedStacksArrayPool`1.Return(T[] array, Boolean clearArray)
   at System.Diagnostics.Process.GetProcessName(Int32 processId)
   at System.Diagnostics.Process.GetProcessesByName(String processName, String machineName)
   at System.Diagnostics.Process.GetProcessesByName(String processName)
   at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.GetPossibleRunningNodes(String msbuildLocation) in /home/raines/src/msbuild/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs:line 263
   at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.GetNode(String msbuildLocation, String commandLineArgs, Int32 nodeId, INodePacketFactory factory, Int64 hostHandshake, Int64 clientHandshake, NodeContextTerminateDelegate terminateNode) in /home/raines/src/msbuild/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs:line 168
   at Microsoft.Build.BackEnd.NodeProviderOutOfProc.CreateNode(Int32 nodeId, INodePacketFactory factory, NodeConfiguration configuration) in /home/raines/src/msbuild/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProc.cs:line 124
   at Microsoft.Build.BackEnd.NodeManager.AttemptCreateNode(INodeProvider nodeProvider, NodeConfiguration nodeConfiguration) in /home/raines/src/msbuild/src/Build/BackEnd/Components/Communications/NodeManager.cs:line 357
   at Microsoft.Build.BackEnd.NodeManager.CreateNode(NodeConfiguration configuration, NodeAffinity nodeAffinity) in /home/raines/src/msbuild/src/Build/BackEnd/Components/Communications/NodeManager.cs:line 113
   at Microsoft.Build.Execution.BuildManager.PerformSchedulingActions(IEnumerable`1 responses) in /home/raines/src/msbuild/src/Build/BackEnd/BuildManager/BuildManager.cs:line 1925
   at Microsoft.Build.Execution.BuildManager.ProcessPacket(Int32 node, INodePacket packet) in /home/raines/src/msbuild/src/Build/BackEnd/BuildManager/BuildManager.cs:line 1221
   at Microsoft.Build.Execution.BuildManager.ProcessWorkQueue(Action action) in /home/raines/src/msbuild/src/Build/BackEnd/BuildManager/BuildManager.cs:line 1174
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Build.Execution.BuildManager.EndBuild() in /home/raines/src/msbuild/src/Build/BackEnd/BuildManager/BuildManager.cs:line 778
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, Boolean isolateProjects, Boolean graphBuild, String[] inputResultsCaches, String outputResultsCache) in /home/raines/src/msbuild/src/MSBuild/XMake.cs:line 1211

That looks like a corefx issue to me at first glance.

This appears to be fixed with 1b6f45c#diff-eb6c3669a3203e9c82dfb79eb45a93e1R285. /cc @tmds @wtgodbe

šŸ˜… regressed here: https://github.com/dotnet/corefx/commit/4214b09864bea0416f17727ffa39a55d950035d1 fixed here: https://github.com/dotnet/corefx/commit/1b6f45ca261467baea62ef577f8b8a7c6cf3b96c

Some more info on the relationship with vscode running: the issue occurs when there is a process with a command line that is long (strlen(arg[0]) + strlen(arg[1]) + 2 > 512).