runtime: [9.0.1xx-rc1] `MSB0001: Internal MSBuild Error` while building command-line-api

While building in the CentOSStream9_Mono_Offline_CurrentSourceBuiltSdk_x64 leg (Mono Stage 2), the build encountered the following error:

Time Elapsed 00:00:02.47
    MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
    Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Cannot acquire required number of nodes.
    =============
    System.AggregateException: One or more errors occurred. (Method has zero rva)
     ---> Microsoft.Build.BackEnd.NodeFailedToLaunchException: Method has zero rva
     ---> System.BadImageFormatException: Method has zero rva
    File name: 'System.Diagnostics.Process'
       at System.Runtime.Serialization.SerializationGuard.ThrowIfDeserializationInProgress(String switchSuffix, Int32& cachedValue)
       at System.Diagnostics.Process.Start()
       at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
       at Microsoft.Build.BackEnd.NodeLauncher.StartInternal(String msbuildLocation, String commandLineArgs)
       --- End of inner exception stack trace ---
       at Microsoft.Build.BackEnd.NodeLauncher.StartInternal(String msbuildLocation, String commandLineArgs)
       at Microsoft.Build.BackEnd.NodeLauncher.<>c__DisplayClass3_0.<Start>b__0()
       at Microsoft.Build.BackEnd.NodeLauncher.DisableMSBuildServer(Func`1 func)
       at Microsoft.Build.BackEnd.NodeLauncher.Start(String msbuildLocation, String commandLineArgs, Int32 nodeId)
       at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.<>c__DisplayClass14_0.<GetNodes>g__StartNewNode|2(Int32 nodeId)
       at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.<>c__DisplayClass14_0.<GetNodes>b__0(Int32 nodeId)
       --- End of inner exception stack trace ---

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 21 (18 by maintainers)

Most upvoted comments

Surprised to see the mono runtime being used at all for building the product - I thought we’d only be running on coreclr.

That’s the purpose of this build leg: it first uses coreclr SDK to build an SDK with mono runtime enabled. Then it uses that built SDK to build everything again.

@steveisok - The SB team is a bit of a middle man here. @omajid has a repo and is willing to help diagnose. Can I assign to someone on the runtime or transfer to the runtime?

Feel free to transfer it to runtime.

Do you have access to a dump by chance?

I reproduced it on a ppc64le test machine using .NET 9 Preview 7 to build itself. I can test with a newer version if that will be helpful.

                  MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
                  Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Cannot acquire required number of nodes.
                  =============
                  System.AggregateException: One or more errors occurred. (Method has zero rva)
                   ---> Microsoft.Build.BackEnd.NodeFailedToLaunchException: Method has zero rva
                   ---> System.BadImageFormatException: Method has zero rva
                  File name: 'System.Diagnostics.Process'
                     at System.Runtime.Serialization.SerializationGuard.ThrowIfDeserializationInProgress(String switchSuffix, Int32& cachedValue) in /_/src/runtime/src/libraries/Common/src/System/Runtime/Serialization/SerializationGuard.cs:line 20
                     at System.Diagnostics.Process.Start() in /_/src/runtime/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs:line 1282
                     at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) in /_/src/runtime/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs:line 1352
                     at Microsoft.Build.BackEnd.NodeLauncher.StartInternal(String msbuildLocation, String commandLineArgs) in /_/src/msbuild/src/Build/BackEnd/Components/Communications/NodeLauncher.cs:line 121
                     --- End of inner exception stack trace ---
                     at Microsoft.Build.BackEnd.NodeLauncher.StartInternal(String msbuildLocation, String commandLineArgs) in /_/src/msbuild/src/Build/BackEnd/Components/Communications/NodeLauncher.cs:line 131
                     at Microsoft.Build.BackEnd.NodeLauncher.<>c__DisplayClass3_0.<Start>b__0() in /_/src/msbuild/src/Build/BackEnd/Components/Communications/NodeLauncher.cs:line 42
                     at Microsoft.Build.BackEnd.NodeLauncher.DisableMSBuildServer(Func`1 func) in /_/src/msbuild/src/Build/BackEnd/Components/Communications/NodeLauncher.cs:line 203
                     at Microsoft.Build.BackEnd.NodeLauncher.Start(String msbuildLocation, String commandLineArgs, Int32 nodeId) in /_/src/msbuild/src/Build/BackEnd/Components/Communications/NodeLauncher.cs:line 42
                     at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.<>c__DisplayClass14_0.<GetNodes>g__StartNewNode|2(Int32 nodeId) in /_/src/msbuild/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs:line 336
                     at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.<>c__DisplayClass14_0.<GetNodes>b__0(Int32 nodeId) in /_/src/msbuild/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs:line 244
                     --- End of inner exception stack trace ---
                  
                  
                   ---> System.AggregateException: One or more errors occurred. (Method has zero rva)
                   ---> Microsoft.Build.BackEnd.NodeFailedToLaunchException: Method has zero rva
                   ---> System.BadImageFormatException: Method has zero rva
                  File name: 'System.Diagnostics.Process'
                     at System.Runtime.Serialization.SerializationGuard.ThrowIfDeserializationInProgress(String switchSuffix, Int32& cachedValue) in /_/src/runtime/src/libraries/Common/src/System/Runtime/Serialization/SerializationGuard.cs:line 20
                     at System.Diagnostics.Process.Start() in /_/src/runtime/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs:line 1282
                     at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) in /_/src/runtime/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs:line 1352
                     at Microsoft.Build.BackEnd.NodeLauncher.StartInternal(String msbuildLocation, String commandLineArgs) in /_/src/msbuild/src/Build/BackEnd/Components/Communications/NodeLauncher.cs:line 121
                     --- End of inner exception stack trace ---
                     at Microsoft.Build.BackEnd.NodeLauncher.StartInternal(String msbuildLocation, String commandLineArgs) in /_/src/msbuild/src/Build/BackEnd/Components/Communications/NodeLauncher.cs:line 131
                     at Microsoft.Build.BackEnd.NodeLauncher.<>c__DisplayClass3_0.<Start>b__0() in /_/src/msbuild/src/Build/BackEnd/Components/Communications/NodeLauncher.cs:line 42
                     at Microsoft.Build.BackEnd.NodeLauncher.DisableMSBuildServer(Func`1 func) in /_/src/msbuild/src/Build/BackEnd/Components/Communications/NodeLauncher.cs:line 203
                     at Microsoft.Build.BackEnd.NodeLauncher.Start(String msbuildLocation, String commandLineArgs, Int32 nodeId) in /_/src/msbuild/src/Build/BackEnd/Components/Communications/NodeLauncher.cs:line 42
                     at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.<>c__DisplayClass14_0.<GetNodes>g__StartNewNode|2(Int32 nodeId) in /_/src/msbuild/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs:line 336
                     at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.<>c__DisplayClass14_0.<GetNodes>b__0(Int32 nodeId) in /_/src/msbuild/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs:line 244
                     --- End of inner exception stack trace ---
                     --- End of inner exception stack trace ---
                     at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Exception innerException, Object[] args) in /_/src/msbuild/src/Shared/ErrorUtilities.cs:line 68
                     at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.GetNodes(String msbuildLocation, String commandLineArgs, Int32 nextNodeId, INodePacketFactory factory, Handshake hostHandshake, NodeContextCreatedDelegate createNode, NodeContextTerminateDelegate terminateNode, Int32 numberOfNodesToCreate) in /_/src/msbuild/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs:line 258
                     at Microsoft.Build.BackEnd.NodeProviderOutOfProc.CreateNodes(Int32 nextNodeId, INodePacketFactory factory, Func`2 configurationFactory, Int32 numberOfNodesToCreate) in /_/src/msbuild/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProc.cs:line 102
                     at Microsoft.Build.BackEnd.NodeManager.AttemptCreateNode(INodeProvider nodeProvider, NodeConfiguration nodeConfiguration, Int32 numberOfNodesToCreate) in /_/src/msbuild/src/Build/BackEnd/Components/Communications/NodeManager.cs:line 333
                     at Microsoft.Build.BackEnd.NodeManager.CreateNodes(NodeConfiguration configuration, NodeAffinity nodeAffinity, Int32 numberOfNodesToCreate) in /_/src/msbuild/src/Build/BackEnd/Components/Communications/NodeManager.cs:line 105
                     at Microsoft.Build.Execution.BuildManager.PerformSchedulingActions(IEnumerable`1 responses) in /_/src/msbuild/src/Build/BackEnd/BuildManager/BuildManager.cs:line 2615
                     at Microsoft.Build.Execution.BuildManager.HandleNewRequest(Int32 node, BuildRequestBlocker blocker) in /_/src/msbuild/src/Build/BackEnd/BuildManager/BuildManager.cs:line 2338
                     at Microsoft.Build.Execution.BuildManager.ProcessPacket(Int32 node, INodePacket packet) in /_/src/msbuild/src/Build/BackEnd/BuildManager/BuildManager.cs:line 1591
                     at Microsoft.Build.Execution.BuildManager.<>c__DisplayClass81_0.<Microsoft.Build.BackEnd.INodePacketHandler.PacketReceived>b__0() in /_/src/msbuild/src/Build/BackEnd/BuildManager/BuildManager.cs:line 1187
                     at Microsoft.Build.Execution.BuildManager.ProcessWorkQueue(Action action) in /_/src/msbuild/src/Build/BackEnd/BuildManager/BuildManager.cs:line 1544
                  --- End of stack trace from previous location ---
                     at Microsoft.Build.Execution.BuildManager.EndBuild() in /_/src/msbuild/src/Build/BackEnd/BuildManager/BuildManager.cs:line 1093
                     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, TextWriter targetsWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsNotAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, ProjectIsolationMode isolateProjects, GraphBuildOptions graphBuildOptions, Boolean lowPriority, Boolean question, Boolean isBuildCheckEnabled, String[] inputResultsCaches, String outputResultsCache, Boolean saveProjectResult, BuildResult& result, String[] commandLine) in /_/src/msbuild/src/MSBuild/XMake.cs:line 1628
                  
...

    24>/home/omajid/dotnet9.0/dotnet-9.0.0-preview.7.24405.7/repo-projects/Directory.Build.targets(428,5): error MSB3073: The command "/home/omajid/dotnet9.0/dotnet-9.0.0-preview.7.24405.7/src/cecil/eng/common/build.sh --restore --build --pack --publish --ci --configuration Release -bl /p:DotNetBuildRepo=true /p:DotNetBuildOrchestrator=true /p:RestoreConfigFile=/home/omajid/dotnet9.0/dotnet-9.0.0-preview.7.24405.7/artifacts/obj/cecil/NuGet.config /p:SourceBuildUseMonoRuntime=true /p:SourceBuiltAssetsDir=/home/omajid/dotnet9.0/dotnet-9.0.0-preview.7.24405.7/artifacts/assets/Release/ /p:SourceBuiltAssetManifestsDir=/home/omajid/dotnet9.0/dotnet-9.0.0-preview.7.24405.7/artifacts/obj/AssetManifests/cecil/ /p:SourceBuiltSymbolsDir=/home/omajid/dotnet9.0/dotnet-9.0.0-preview.7.24405.7/artifacts/obj/Symbols/cecil/ /p:ArcadeBuildFromSource=true /p:DotNetBuildSourceOnly=true /p:PreviouslySourceBuiltNupkgCacheDir="/home/omajid/dotnet9.0/dotnet-9.0.0-preview.7.24405.7/prereqs/packages/previously-source-built/" /p:ReferencePackageNupkgCacheDir="/home/omajid/dotnet9.0/dotnet-9.0.0-preview.7.24405.7/prereqs/packages/reference/" /p:SourceBuiltShippingPackagesDir=/home/omajid/dotnet9.0/dotnet-9.0.0-preview.7.24405.7/artifacts/packages/Release/Shipping/cecil/ /p:SourceBuiltNonShippingPackagesDir=/home/omajid/dotnet9.0/dotnet-9.0.0-preview.7.24405.7/artifacts/packages/Release/NonShipping/cecil/ /v:n" exited with code 1. [/home/omajid/dotnet9.0/dotnet-9.0.0-preview.7.24405.7/repo-projects/cecil.proj]

Here’s the binlogs from the cecil project: binlogs.tar.gz

This is MSBuild reporting a failure to create a new worker process with a command line like dotnet path/to/MSBuild.dll. Looking at it I’d suspect a runtime problem, maybe System.Process itself?

Maybe @rainersigwald would have a better idea.