Skip to content

Dotnet build hangs while building libs.tests natively using cross built dotnet sdk #101121

Closed
dotnet/roslyn
#74994
@alhad-deshpande

Description

@alhad-deshpande

Description

Dotnet build hangs while building libs.tests natively using cross built dotnet sdk.

Brief Analysis and probable root cause:

  1. The hang occurs while building project using msbuild runtime/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.FirstCallAfterUpdate/System.Reflection.Metadata.ApplyUpdate.Test.FirstCallAfterUpdate.csproj
  2. Mono trace log for "Microsoft.DotNet.HotReload.Utils.Generator" shows there is FileNotFoundException.
  3. Traced the filename using strace command and found that the missing file is "/root/.nuget/packages/microsoft.dotnet.hotreload.utils.generator.buildtool/9.0.0-alpha.0.24168.2/tools/net9.0/BuildHost-netcore/Microsoft.Build.dll".
  4. If we check the directory contents for /root/.nuget/packages/microsoft.dotnet.hotreload.utils.generator.buildtool/9.0.0-alpha.0.24168.2/tools/net9.0/BuildHost-netcore/ then there is a file with name "Microsoft.Build.Locator.dll" but not "Microsoft.Build.dll".

Complete mono trace log for Microsoft.DotNet.HotReload.Utils.Generator namespace:

[root@devfirst-dotnet-rhel8-8-1 logs]# export MONO_ENV_OPTIONS="--trace=N:Microsoft.DotNet.HotReload.Utils.Generator"
[root@devfirst-dotnet-rhel8-8-1 logs]# /root/alhad/runtime/dotnet-sdk-ppc64le/.dotnet/dotnet /root/.nuget/packages/microsoft.dotnet.hotreload.utils.generator.buildtool/9.0.0-alpha.0.24168.2/build/../tools/net9.0/Microsoft.DotNet.HotReload.Utils.Generator.BuildTool.dll -msbuild:/root/alhad/runtime/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.FirstCallAfterUpdate/System.Reflection.Metadata.ApplyUpdate.Test.FirstCallAfterUpdate.csproj -script:/root/alhad/runtime/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.FirstCallAfterUpdate/deltascript.json -p:Configuration=Debug
[0x7fff8a9a5160: 0.00000 0] ENTER:c Microsoft.DotNet.HotReload.Utils.Generator.Config:Builder ()()
[0x7fff8a9a5160: 0.00019 0] LEAVE:c Microsoft.DotNet.HotReload.Utils.Generator.Config:Builder ()([.ConfigBuilder:0x7fff7c402bc8]
[0x7fff8a9a5160: 0.04096 0] ENTER:c Microsoft.DotNet.HotReload.Utils.Generator.MsbuildConfig:.ctor (Microsoft.DotNet.HotReload.Utils.Generator.Config/ConfigBuilder)(this:0x7fff7c405820[Microsoft.DotNet.HotReload.Utils.Generator.MsbuildConfig Microsoft.DotNet.HotReload.Utils.Generator.BuildTool.dll], [.ConfigBuilder:0x7fff7c402bc8])
[0x7fff8a9a5160: 0.04116 1] ENTER:c Microsoft.DotNet.HotReload.Utils.Generator.Config:.ctor (Microsoft.DotNet.HotReload.Utils.Generator.Config/ConfigBuilder)(this:0x7fff7c405820[Microsoft.DotNet.HotReload.Utils.Generator.MsbuildConfig Microsoft.DotNet.HotReload.Utils.Generator.BuildTool.dll], [.ConfigBuilder:0x7fff7c402bc8])
[0x7fff8a9a5160: 0.04145 1] LEAVE:c Microsoft.DotNet.HotReload.Utils.Generator.Config:.ctor (Microsoft.DotNet.HotReload.Utils.Generator.Config/ConfigBuilder)(
[0x7fff8a9a5160: 0.04146 0] LEAVE:c Microsoft.DotNet.HotReload.Utils.Generator.MsbuildConfig:.ctor (Microsoft.DotNet.HotReload.Utils.Generator.Config/ConfigBuilder)(
[0x7fff8a9a5160: 0.04437 0] ENTER:c Microsoft.DotNet.HotReload.Utils.Generator.Runner:Make (Microsoft.DotNet.HotReload.Utils.Generator.Config)([Microsoft.DotNet.HotReload.Utils.Generator.MsbuildConfig:0x7fff7c405820])
[0x7fff8a9a5160: 0.04444 1] ENTER:c Microsoft.DotNet.HotReload.Utils.Generator.Config:get_Live ()(this:0x7fff7c405820[Microsoft.DotNet.HotReload.Utils.Generator.MsbuildConfig Microsoft.DotNet.HotReload.Utils.Generator.BuildTool.dll])
[0x7fff8a9a5160: 0.04445 1] LEAVE:c Microsoft.DotNet.HotReload.Utils.Generator.Config:get_Live ()(result=0
[0x7fff8a9a5160: 0.04500 0] LEAVE:c Microsoft.DotNet.HotReload.Utils.Generator.Runner:Make (Microsoft.DotNet.HotReload.Utils.Generator.Config)([Microsoft.DotNet.HotReload.Utils.Generator.Runners.ScriptRunner:0x7fff7c405e60]
[0x7fff8a9a5160: 0.04516 0] ENTER:c Microsoft.DotNet.HotReload.Utils.Generator.Runner:Run (System.Threading.CancellationToken)(this:0x7fff7c405e60[Microsoft.DotNet.HotReload.Utils.Generator.Runners.ScriptRunner Microsoft.DotNet.HotReload.Utils.Generator.BuildTool.dll], [00,00,00,00,00,00,00,00,])
[0x7fff8a9a5160: 0.23871 0] LEAVE:c Microsoft.DotNet.HotReload.Utils.Generator.Runner:Run (System.Threading.CancellationToken)([.AsyncStateMachineBox`1:0x7fff7c424560]
[0x7fff738cf140: 0.26416 0] ENTER:c Microsoft.DotNet.HotReload.Utils.Generator.Runner:PrepareCapabilities ()(this:0x7fff7c405e60[Microsoft.DotNet.HotReload.Utils.Generator.Runners.ScriptRunner Microsoft.DotNet.HotReload.Utils.Generator.BuildTool.dll])
[0x7fff738cf140: 0.26422 1] ENTER:c Microsoft.DotNet.HotReload.Utils.Generator.Config:get_EditAndContinueCapabilities ()(this:0x7fff7c405820[Microsoft.DotNet.HotReload.Utils.Generator.MsbuildConfig Microsoft.DotNet.HotReload.Utils.Generator.BuildTool.dll])
[0x7fff738cf140: 0.26423 1] LEAVE:c Microsoft.DotNet.HotReload.Utils.Generator.Config:get_EditAndContinueCapabilities ()([System.String[]:0x7fff7c4025b8]
[0x7fff738cf140: 0.26446 1] ENTER:c Microsoft.DotNet.HotReload.Utils.Generator.EditAndContinueCapabilitiesParser:.cctor ()()
[0x7fff738cf140: 0.28896 1] LEAVE:c Microsoft.DotNet.HotReload.Utils.Generator.EditAndContinueCapabilitiesParser:.cctor ()(
[0x7fff738cf140: 0.28897 1] ENTER:c Microsoft.DotNet.HotReload.Utils.Generator.EditAndContinueCapabilitiesParser:Parse (System.Collections.Generic.IEnumerable`1<string>)(XX)
[0x7fff738cf140: 0.28912 2] ENTER:c Microsoft.DotNet.HotReload.Utils.Generator.EditAndContinueCapabilitiesParser:Tokenize (System.Collections.Generic.IEnumerable`1<string>)(XX)
[0x7fff738cf140: 0.28918 2] LEAVE:c Microsoft.DotNet.HotReload.Utils.Generator.EditAndContinueCapabilitiesParser:Tokenize (System.Collections.Generic.IEnumerable`1<string>)((unknown return type 15)
[0x7fff738cf140: 0.28940 2] ENTER:c Microsoft.DotNet.HotReload.Utils.Generator.EditAndContinueCapabilitiesParser:Parse (System.Collections.Generic.IEnumerable`1<Microsoft.DotNet.HotReload.Utils.Generator.EditAndContinueCapabilitiesParser/Token>)(XX)
[0x7fff738cf140: 0.29011 2] LEAVE:c Microsoft.DotNet.HotReload.Utils.Generator.EditAndContinueCapabilitiesParser:Parse (System.Collections.Generic.IEnumerable`1<Microsoft.DotNet.HotReload.Utils.Generator.EditAndContinueCapabilitiesParser/Token>)((unknown return type 15)
[0x7fff738cf140: 0.29012 1] LEAVE:c Microsoft.DotNet.HotReload.Utils.Generator.EditAndContinueCapabilitiesParser:Parse (System.Collections.Generic.IEnumerable`1<string>)((unknown return type 15)
[0x7fff738cf140: 0.29157 1] ENTER:c Microsoft.DotNet.HotReload.Utils.Generator.Runner:DefaultCapabilities ()(this:0x7fff7c405e60[Microsoft.DotNet.HotReload.Utils.Generator.Runners.ScriptRunner Microsoft.DotNet.HotReload.Utils.Generator.BuildTool.dll])
[0x7fff738cf140: 0.29158 1] LEAVE:c Microsoft.DotNet.HotReload.Utils.Generator.Runner:DefaultCapabilities ()(result=1023
[0x7fff738cf140: 0.29162 1] ENTER:c Microsoft.DotNet.HotReload.Utils.Generator.Config:get_NoWarnUnknownCapabilities ()(this:0x7fff7c405820[Microsoft.DotNet.HotReload.Utils.Generator.MsbuildConfig Microsoft.DotNet.HotReload.Utils.Generator.BuildTool.dll])
[0x7fff738cf140: 0.29163 1] LEAVE:c Microsoft.DotNet.HotReload.Utils.Generator.Config:get_NoWarnUnknownCapabilities ()(result=0
[0x7fff738cf140: 0.29180 0] LEAVE:c Microsoft.DotNet.HotReload.Utils.Generator.Runner:PrepareCapabilities ()(result=1023
[0x7fff738cf140: 0.29196 0] ENTER:c Microsoft.DotNet.HotReload.Utils.Generator.Runner:SetupBaseline (Microsoft.DotNet.HotReload.Utils.Generator.EnC.EditAndContinueCapabilities,System.Threading.CancellationToken)(this:0x7fff7c405e60[Microsoft.DotNet.HotReload.Utils.Generator.Runners.ScriptRunner Microsoft.DotNet.HotReload.Utils.Generator.BuildTool.dll], 1023, [00,00,00,00,00,00,00,00,])
[0x7fff738cf140: 0.29293 1] ENTER:c Microsoft.DotNet.HotReload.Utils.Generator.Runner:InitMSBuild ()()
[0x7fff738cf140: 1.12321 1] LEAVE:c Microsoft.DotNet.HotReload.Utils.Generator.Runner:InitMSBuild ()(
[0x7fff738cf140: 1.12342 1] ENTER:c Microsoft.DotNet.HotReload.Utils.Generator.BaselineProject:Make (Microsoft.DotNet.HotReload.Utils.Generator.Config,Microsoft.DotNet.HotReload.Utils.Generator.EnC.EditAndContinueCapabilities,System.Threading.CancellationToken)([Microsoft.DotNet.HotReload.Utils.Generator.MsbuildConfig:0x7fff7c405820], 1023, [00,00,00,00,00,00,00,00,])
[0x7fff738cf140: 1.12455 2] ENTER:c Microsoft.DotNet.HotReload.Utils.Generator.BaselineProject:PrepareMSBuildProject (Microsoft.DotNet.HotReload.Utils.Generator.Config,Microsoft.DotNet.HotReload.Utils.Generator.EnC.EditAndContinueCapabilities,System.Threading.CancellationToken)([Microsoft.DotNet.HotReload.Utils.Generator.MsbuildConfig:0x7fff7c405820], 1023, [00,00,00,00,00,00,00,00,])
[0x7fff738cf140:] EXCEPTION handling: System.IO.FileNotFoundException:
[0x7fff738cf140: 2.18797 2] LEAVE:c Microsoft.DotNet.HotReload.Utils.Generator.BaselineProject:PrepareMSBuildProject (Microsoft.DotNet.HotReload.Utils.Generator.Config,Microsoft.DotNet.HotReload.Utils.Generator.EnC.EditAndContinueCapabilities,System.Threading.CancellationToken)((unknown return type 15)
[0x7fff738cf140: 2.18885 1] LEAVE:c Microsoft.DotNet.HotReload.Utils.Generator.BaselineProject:Make (Microsoft.DotNet.HotReload.Utils.Generator.Config,Microsoft.DotNet.HotReload.Utils.Generator.EnC.EditAndContinueCapabilities,System.Threading.CancellationToken)((unknown return type 15)
[0x7fff738cf140: 2.18978 0] LEAVE:c Microsoft.DotNet.HotReload.Utils.Generator.Runner:SetupBaseline (Microsoft.DotNet.HotReload.Utils.Generator.EnC.EditAndContinueCapabilities,System.Threading.CancellationToken)((unknown return type 15)
[0x7fff738cf140:] EXCEPTION handling: Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: C. Path '', line 0, position 0.
[0x7fff738cf140:] EXCEPTION handling: Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: C. Path '', line 0, position 0.

Reproduction Steps

  1. Cross build dotnet sdk on x86_64
  2. Native build runtime and libs.tests on any machine ppc64le/s390x or x86_64

Expected behavior

The dotnet native build should not hang

Actual behavior

The dotnet native build hangs.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions