dotnet / core

.NET news, announcements, release notes, and more!
https://dot.net
MIT License
21.03k stars 4.91k forks source link

On some older processors, QueueUserAPC2 on Win11 results in an illegal instruction exception #6733

Closed L00pZBreak3r closed 2 years ago

L00pZBreak3r commented 3 years ago

7.0.100, 6.0.100-rtm, 6.0.100-RC2. Even without any NET SDK installed, I get Failed to create CoreCLR, HRESULT: 0x80004005

windowsdesktop-runtime-5.0.10-win-x64 is installed, so dotnet.exe should work somehow. However, dotnet.exe --help gives Failed to create CoreCLR, HRESULT: 0x80004005

Unfortunately, Google finds nothing useful on Failed to create CoreCLR, HRESULT: 0x80004005 .

Originally posted by @L00pZBreak3r in https://github.com/dotnet/installer/issues/12030#issuecomment-926500138

mairaw commented 3 years ago

@marcpopMSFT you were originally helping @L00pZBreak3r on this issue. Do you need more info?

marcpopMSFT commented 3 years ago

If dotnet.exe doesn't work, I'd route to @vitek-karas as possibly the runtime is not working. This isn't an arm64 windows machine by any chance is it?

L00pZBreak3r commented 3 years ago

No, it's mundane x64.

vitek-karas commented 3 years ago

Just to be sure (but I don't expect this to do much):

set COREHOST_TRACE=1
set COREHOST_TRACEFILE=host.txt
dotnet --help
set COREHOST_TRACE=0

This should produce host.txt with lot of detailed tracing. Please note that the file may contain information about the machine, local paths and env. variables. Make sure you're OK to share it first. I think the interesting part will be the few lines around the failure (should be near the end of the file).

From your post it seems you installed multiple different versions. Are all of those installed into the default location (C:\Program Files\dotnet)?

Would it be possible to try if any .NET works? For example you can download the .zip instead of an installer, extract it to any directory (not program files) and try to run the dotnet.exe --help from it.

JurjenBiewenga commented 3 years ago

Hi,

We had a very similar problem after updating the SDK to preview 7 on OSX and running one of our .net standard 2 projects which uses the FlatSharp Compiler (compile time flatbuffer compilation). Updating the runtime to .NET Core 2.1 Runtime (v2.1.30) seems to have fixed it.

We also tried to use COREHOST_TRACE to get a log file however it appears that no log file was created.

vitek-karas commented 3 years ago

@JurjenBiewenga the COREHOST_TRACEFILE setting is only available on .NET Core 3.1 and higher. The COREHOST_TRACE=1 should still work on .NET Core 2.1, but it write all of the diag info into stderr.

How did you run a .NET Standard 2 project? (what was the TFM in the project file?, are you building an application project file, or some other way? How do you run it?)

JurjenBiewenga commented 3 years ago

@vitek-karas Unfortunately we also did not see any console output with COREHOST_TRACE=1. We were running a solution with some projects (console applications) targetting .net 6(net6.0) and some (class libraries) targetting .net standard 2 (netstandard2.0), The .net standard 2 project has a dependency on FlatSharp.Compiler, it calls their compiler on the FlatBuffer Schema (FBS) files in the project with the following args: dotnet /Users/jurjenbiewenga/.nuget/packages/flatsharp.compiler/5.2.0/tools/netcoreapp2.1/FlatSharp.Compiler.dll --nullable-warnings false --input "/Users/jurjenbiewenga/git/solution/project/project.Data/Schemas/schema.fbs" --output obj/Debug/netstandard2.0/ This is the call that failed and trying to manually execute this command gave the same error, so we ran that wrapped in your example above. Unfortunately this gave no additional output.

vitek-karas commented 3 years ago

@JurjenBiewenga thanks for the response. Sorry, I probably screwed up the commands. On Linux/macOS it probably needs to be export COREHOST_TRACE=1. (I was trying this on Windows, sorry for the wrong command).

JurjenBiewenga commented 3 years ago

Ah makes sense, unfortunately I don't have a repro at the moment. Could try to recreate one next week.

vitek-karas commented 3 years ago

Today I found that if the System.Private.CoreLib.dll is missing the runtime fails like this. Can you please check that in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\<version> there is a file called System.Private.CoreLib.dll ? (It could be a corrupted install for example).

If I delete the file, dotnet --help fails with the same failure as above.

JurjenBiewenga commented 3 years ago

I managed to reproduce the issue, sending you an email with the trace logs. Where do I check for System.Private.CoreLib.dll on osx?

L00pZBreak3r commented 3 years ago

"C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.10\System.Private.CoreLib.dll" "C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.0-preview.5.21301.5\System.Private.CoreLib.dll" "C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.0-rc.1.21451.13\System.Private.CoreLib.dll" "C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Private.CoreLib.dll"

"C:\Program Files\dotnet\dotnet.exe" --help Failed to create CoreCLR, HRESULT: 0x80004005

"C:\Program Files (x86)\dotnet\dotnet.exe" --help This works, but this installation has no SDKs.

"C:\JustAFolder\dotnet-sdk-7.0.100-alpha.1.21506.8-win-x64\dotnet.exe" --help Failed to create CoreCLR, HRESULT: 0x80004005

vitek-karas commented 3 years ago

@L00pZBreak3r Do you know when it started to happen? Do you have any other version installed (other than those listed above)?

I tried installing the exact same 7.0.100-alpa.1.21506.8-win-x64 into a custom location and it works for me unfortunately.

L00pZBreak3r commented 3 years ago

You are absolutely right. I strongly suspect that this trouble isn't caused by NET runtime itself. It's something in Windows. The problem is I cannot find any other place where I could ask for help with this issue. Google gives nothing helpful on "Failed to create CoreCLR, HRESULT: 0x80004005" or on anything similar. So the only hope is that somebody here might happen to encounter a similar problem.

Later I'll try to check this in another installation of Windows.

L00pZBreak3r commented 3 years ago

Is it possible to debug the CoreCLR initialization process? Maybe it would show something helpful. The last lines in my host.txt are:

Property FX_DEPS_FILE = C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\Microsoft.NETCore.App.deps.json Property TRUSTED_PLATFORM_ASSEMBLIES = C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.IO.UnmanagedMemoryStream.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.Extensions.Logging.Abstractions.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\dotnet.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.Build.NuGetSdkResolver.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.AspNetCore.DeveloperCertificates.XPlat.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.ApplicationInsights.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.NET.HostModel.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.Build.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\System.Resources.Extensions.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.Build.Framework.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.IO.Pipes.AccessControl.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\NuGet.Versioning.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Runtime.Serialization.Json.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.TemplateEngine.Core.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.Build.Tasks.Core.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.Build.Utilities.Core.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.Deployment.DotNet.Releases.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Web.HttpUtility.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Runtime.CompilerServices.VisualC.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.DotNet.Cli.CommandLine.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\runtimes\win\lib\netcoreapp3.0\System.Security.Cryptography.Pkcs.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\runtimes\win\lib\netcoreapp3.0\System.Drawing.Common.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.Extensions.CommandLineUtils.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.Extensions.Configuration.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.Extensions.Options.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Web.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.Extensions.Configuration.Abstractions.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.Extensions.Configuration.Binder.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Reflection.DispatchProxy.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.Extensions.DependencyInjection.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Collections.Concurrent.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.TestPlatform.Build.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.Extensions.DependencyInjection.Abstractions.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.DotNet.SdkResolver.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\System.Configuration.ConfigurationManager.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.Extensions.DependencyModel.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Threading.Thread.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.NET.StringTools.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.Extensions.Logging.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\NuGet.LibraryModel.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.Extensions.Logging.Configuration.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.Extensions.Primitives.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.Extensions.Logging.Console.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Security.Claims.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.Extensions.Options.ConfigurationExtensions.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\NuGet.ProjectModel.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Security.Cryptography.Primitives.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.ComponentModel.Annotations.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.TemplateEngine.Abstractions.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Private.CoreLib.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.TemplateEngine.Cli.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.TemplateEngine.Core.Contracts.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.TemplateEngine.Edge.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\runtimes\win\lib\netstandard2.0\System.Security.Cryptography.ProtectedData.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\NuGet.Packaging.Core.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.TemplateEngine.Orchestrator.RunnableProjects.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\NuGet.Protocol.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Resources.ResourceManager.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.TemplateEngine.Utils.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\NuGet.Build.Tasks.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.TemplateSearch.Common.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\NuGet.DependencyResolver.Core.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\runtimes\win\lib\net6.0\System.Diagnostics.EventLog.Messages.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\runtimes\win\lib\netcoreapp3.0\Microsoft.Win32.SystemEvents.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Newtonsoft.Json.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Diagnostics.TraceSource.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\NuGet.CommandLine.XPlat.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Security.Cryptography.Algorithms.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\NuGet.Commands.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\NuGet.Common.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Net.NameResolution.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Data.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.DotNet.Cli.Utils.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\NuGet.Configuration.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\NuGet.Credentials.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Transactions.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\NuGet.Frameworks.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\NuGet.Packaging.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Reflection.TypeExtensions.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\System.CodeDom.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\System.CommandLine.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\Microsoft.VisualBasic.Core.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\runtimes\win\lib\net6.0\System.Diagnostics.EventLog.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\runtimes\win\lib\netcoreapp2.0\System.Management.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\System.Security.Cryptography.Xml.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\System.Security.Permissions.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\runtimes\win\lib\net6.0\System.ServiceProcess.ServiceController.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Text.Encodings.Web.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Collections.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Text.Json.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Diagnostics.Contracts.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\runtimes\win\lib\netcoreapp3.0\System.Windows.Extensions.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Net.Http.Json.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.DotNet.Cli.Sln.Internal.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.DotNet.Configurer.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.IO.Compression.FileSystem.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.DotNet.InternalAbstractions.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.DotNet.NativeWrapper.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Linq.Parallel.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.DotNet.TemplateLocator.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.NET.Sdk.WorkloadManifestReader.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Net.Quic.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\Microsoft.Win32.Msi.dll;C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\MSBuild.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\Microsoft.VisualBasic.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.ServiceModel.Web.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\Microsoft.Win32.Primitives.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\mscorlib.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\netstandard.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.AppContext.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Buffers.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.ComponentModel.DataAnnotations.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Configuration.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Core.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Data.DataSetExtensions.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Diagnostics.Debug.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Diagnostics.Tools.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Diagnostics.Tracing.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Drawing.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Windows.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Dynamic.Runtime.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Globalization.Calendars.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Collections.NonGeneric.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Globalization.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Globalization.Extensions.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.IO.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Formats.Asn1.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.IO.FileSystem.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.IO.FileSystem.Primitives.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Reflection.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Net.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Numerics.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Transactions.Local.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Drawing.Primitives.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Numerics.Vectors.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Reflection.Emit.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Xml.XmlDocument.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Reflection.Emit.ILGeneration.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Text.Encoding.Extensions.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Reflection.Emit.Lightweight.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Reflection.Extensions.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Net.Primitives.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.ValueTuple.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Reflection.Primitives.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Resources.Reader.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Runtime.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Runtime.Extensions.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Runtime.Handles.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Runtime.Intrinsics.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Runtime.Loader.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Runtime.Serialization.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Runtime.Serialization.Xml.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Security.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Security.Principal.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Security.SecureString.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.ServiceProcess.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Text.Encoding.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Threading.Overlapped.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.ComponentModel.TypeConverter.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Threading.Tasks.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Threading.Tasks.Extensions.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Threading.ThreadPool.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Threading.Timer.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Xml.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Xml.Linq.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Xml.ReaderWriter.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.IO.MemoryMappedFiles.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Xml.Serialization.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Xml.XDocument.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Xml.XmlSerializer.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Runtime.Numerics.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Xml.XPath.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\WindowsBase.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\Microsoft.CSharp.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\Microsoft.Win32.Registry.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Collections.Immutable.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Collections.Specialized.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Security.Cryptography.OpenSsl.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.ComponentModel.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.ComponentModel.EventBasedAsync.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.ComponentModel.Primitives.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Net.Security.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Console.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Data.Common.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Diagnostics.DiagnosticSource.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Diagnostics.FileVersionInfo.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Diagnostics.Process.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Diagnostics.StackTrace.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Diagnostics.TextWriterTraceListener.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.IO.Compression.Brotli.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.IO.Compression.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.IO.Compression.ZipFile.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.IO.FileSystem.AccessControl.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.IO.FileSystem.DriveInfo.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.IO.FileSystem.Watcher.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.IO.IsolatedStorage.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.IO.Pipes.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Linq.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Linq.Expressions.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Linq.Queryable.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Memory.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Net.Http.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Net.WebSockets.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Net.HttpListener.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Net.Mail.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Net.NetworkInformation.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Net.Ping.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Net.Requests.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Net.ServicePoint.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Net.Sockets.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Net.WebClient.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Net.WebHeaderCollection.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Net.WebProxy.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Net.WebSockets.Client.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.ObjectModel.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Private.DataContractSerialization.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Private.Uri.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Private.Xml.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Private.Xml.Linq.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Reflection.Metadata.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Resources.Writer.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Runtime.CompilerServices.Unsafe.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Runtime.InteropServices.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Runtime.InteropServices.RuntimeInformation.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Runtime.Serialization.Formatters.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Runtime.Serialization.Primitives.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Security.AccessControl.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Security.Cryptography.Cng.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Security.Cryptography.Csp.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Security.Cryptography.Encoding.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Security.Cryptography.X509Certificates.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Security.Principal.Windows.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Text.Encoding.CodePages.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Text.RegularExpressions.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Threading.Channels.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Threading.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Threading.Tasks.Dataflow.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Threading.Tasks.Parallel.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Xml.XPath.XDocument.dll;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\System.Private.CoreLib.dll Property NATIVE_DLL_SEARCH_DIRECTORIES = C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\; Property PLATFORM_RESOURCE_ROOTS = Property APP_CONTEXT_BASE_DIRECTORY = C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\ Property HOSTFXR_PATH = C:\Program Files\dotnet\host\fxr\7.0.0-alpha.1.21480.1\hostfxr.dll Property APP_CONTEXT_DEPS_FILES = C:\Program Files\dotnet\sdk\7.0.100-alpha.1.21513.31\dotnet.deps.json;C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\Microsoft.NETCore.App.deps.json Property PROBING_DIRECTORIES = Property RUNTIME_IDENTIFIER = win10-x64 Property System.Reflection.Metadata.MetadataUpdater.IsSupported = false CoreCLR path = 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\coreclr.dll', CoreCLR dir = 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\' Loaded library from C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.0-alpha.1.21480.1\coreclr.dll Failed to create CoreCLR, HRESULT: 0x80004005

vitek-karas commented 3 years ago

Unfortunately there's no logging this early on (at least that I'm aware of) in the runtime. My plan for this (as it seems to be very rare, and VERY hard to repro) was to look through the init path in the runtime and add some kind of error tracing - E_FAIL is just the worst possible return code. So at the very least returns something more specific if possible and hopefully also find a way to print out some more information somewhere, so that we can at least start to guess what's wrong.

L00pZBreak3r commented 3 years ago

Obviously something in my Windows prevents CoreCLR from working properly. Unfortunately, I have no idea how to detect that something .

steveharter commented 3 years ago

@L00pZBreak3r any update?

Have you tried a newer release of 7.0 preview?

I assume just dotnet and dotnet --info work?

L00pZBreak3r commented 3 years ago

It's 7.0.100-alpha.1.21518.14 , that is a week old. The situation is still the same. As I see, this version doesn't have a more specific error reporting yet.

dotnet --info Failed to create CoreCLR, HRESULT: 0x80004005

Host (useful for support): Version: 7.0.0-alpha.1.21480.1 Commit: 9556913857

.NET SDKs installed: 6.0.100-rc.1.21373.26 [C:\Program Files\dotnet\sdk] 6.0.100-rc.1.21373.26 [C:\Program Files\dotnet\sdk] 6.0.100-rc.2.21505.57 [C:\Program Files\dotnet\sdk] 6.0.100-rc.2.21505.57 [C:\Program Files\dotnet\sdk] 7.0.100-alpha.1.21518.14 [C:\Program Files\dotnet\sdk] 7.0.100-alpha.1.21518.14 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 6.0.0-rc.2.21480.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.0-rc.2.21480.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.0-alpha.1.21470.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.0-alpha.1.21470.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.0-preview.5.21301.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.0-preview.5.21301.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.0-rc.1.21451.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.0-rc.1.21451.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.0-rc.2.21480.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.0-rc.2.21480.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.0-alpha.1.21480.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.0-alpha.1.21480.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.0-rc.2.21501.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.0-rc.2.21501.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.0-alpha.1.21474.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.0-alpha.1.21474.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download

L00pZBreak3r commented 3 years ago

The most hilarious thing is I cannot build my own runtime-main to try to debug coreclr.dll, because it uses dotnet to build it!

vitek-karas commented 3 years ago

I looked through the startup code and found some things we could check without getting into the private builds and so on.

Looking through the code, the most likely case where E_FAIL is returned is when there's an exception during the startup. This should be relatively easy to catch in a debugger. There are a few cases where it will return E_FAIL without an exception happening, but those should be very rare... near impossible to hit on normal systems.

Did .NET (3.1, 5, 6) work on this machine in the past? If there's anything special about the system you can think of ... ?

L00pZBreak3r commented 3 years ago

I seem to find what causes my issue. My PC is 14 years old, it seems to be the cause. :(

runtime-main\src\coreclr\vm\threads.cpp (8354):

if (!(*pfnQueueUserAPC2Proc)(EmptyApcCallback, GetCurrentThread(), 0, SpecialUserModeApcWithContextFlags))

Calling QueueUserAPC2 on my old PC throws an illegal instruction exception. On modern PCs QueueUserAPC2 works just fine. So, a possible workaround for this very rare and very specific issue may be this:

void Thread::InitializeSpecialUserModeApc()
{
    WRAPPER_NO_CONTRACT;
    static_assert_no_msg(OFFSETOF__APC_CALLBACK_DATA__ContextRecord == offsetof(CLONE_APC_CALLBACK_DATA, ContextRecord));

    HMODULE hKernel32 = WszLoadLibraryEx(WINDOWS_KERNEL32_DLLNAME_W, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);

    // See if QueueUserAPC2 exists
    QueueUserAPC2Proc pfnQueueUserAPC2Proc = (QueueUserAPC2Proc)GetProcAddress(hKernel32, "QueueUserAPC2");
    if (pfnQueueUserAPC2Proc == nullptr)
    {
        return;
    }

    // See if QueueUserAPC2 supports the special user-mode APC with a callback that includes the interrupted CONTEXT. A special
    // user-mode APC can interrupt a thread that is in user mode and not in a non-alertable wait.
    bool resultQueueUserAPC2 = false;
    try
    {
        resultQueueUserAPC2 = (*pfnQueueUserAPC2Proc)(EmptyApcCallback, GetCurrentThread(), 0, SpecialUserModeApcWithContextFlags);
    }
    catch (...)
    {

    }

    // In the future, once code paths using the special user-mode APC get some bake time, it should be used regardless of
    // whether CET shadow stacks are enabled
    if (resultQueueUserAPC2 && AreCetShadowStacksEnabled())
    {
        s_pfnQueueUserAPC2Proc = pfnQueueUserAPC2Proc;
    }
}

Maybe my PC is not just old, maybe it's buggy, but I cannot confirm, nor exclude this possibility.

vitek-karas commented 3 years ago

@kouvel could you please take a look (just the above comment)? I don't know if there's only some hardware which we support or if this is just an omission. (I could not find anything about supported hardware for .NET on Windows).

steveharter commented 3 years ago

"C:\Program Files\dotnet\dotnet.exe" --help Failed to create CoreCLR, HRESULT: 0x80004005 "C:\Program Files (x86)\dotnet\dotnet.exe" --help This works, but this installation has no SDKs.

Is it possible the old machine doesn't support 64-bit, or has issues with it? You could try to use the 32-bit SDK.

Also, a quick search for "QueueUserAPC" showed that it is sometimes a malware vector, so you may want to ensure that is not the case.

L00pZBreak3r commented 3 years ago

To be more exact, the illegal instruction exception is thrown by the syscall instruction in ntdll.dll.NtQueueApcThreadEx2. Obviously, in the 32-bit ntdll.dll function NtQueueApcThreadEx2 is absolutely different from its 64-bit variant.

kouvel commented 3 years ago

My understanding is that in older versions of Windows the API shouldn't exist, and in ones where it exists, it should behave appropriately. I suppose this could happen if the API is using some new instruction without checking processor features.

@L00pZBreak3r:

I can ask around with that info.

L00pZBreak3r commented 3 years ago

Windows 11, the latest build (now it's 22483). Xeon X5660 on ASUS P6T7 WS SUPERCOMPUTER motherboard.

vitek-karas commented 3 years ago

I might be wrong, but this doesn't sound like a processor supported by Windows 11. If that is the case, it's not surprising the OS function can fail with invalid instruction.

kouvel commented 3 years ago

@L00pZBreak3r, it sounds like this is not expected, and some more info would be useful. Could you please take a crash dump of a simple app and send a link to me at kouvel@microsoft.com?

L00pZBreak3r commented 3 years ago

@kouvel, please elaborate what exactly I should do to create the crash dump in question.

kouvel commented 3 years ago

Should be able to create a dump by running the app under a debugger:

kouvel commented 3 years ago

@L00pZBreak3r, thank you for sharing a crash dump, it was helpful. The issue has been identified and will be fixed soon (roughly a few weeks) in Windows 11 insider builds. It is not clear at the moment that Windows 11 RTM will be fixed, given that the processor is not supported by Windows 11, we'll try to update the thread once there's a decision there.

L00pZBreak3r commented 3 years ago

@kouvel, it's just amazing! Frankly speaking, I never expected that any change would be made because of this case of an anonymous user's inconvenience. It has almost never happened before. So, it's just great news! Thank you!

T5meg commented 2 years ago

Any updates? 👀

L00pZBreak3r commented 2 years ago

Finally! Finally the fix was included in build 22509!

kouvel commented 2 years ago

Yes the fix should be in the insider builds as of build 22509. The fix is still going through the process for backporting, so there's no decision yet on whether it would be ported back to Win11 RTM.

Joren-Thijs-KasparSolutions commented 2 years ago

I faced the same issue today on Ubuntu after recently upgrading from Win10 to Win11.

What fixed it for me was removing my existing dotnet install sudo apt remove --purge dotnet-* and reinstalling following the docs

Johnserf-Seed commented 2 years ago

只是为了确定(但我不期望这能做很多事情):

set COREHOST_TRACE=1
set COREHOST_TRACEFILE=host.txt
dotnet --help
set COREHOST_TRACE=0

这应该会产生大量详细的跟踪。请注意,该文件可能包含有关计算机、本地路径和 env 的信息。变量。确保你可以先分享它。我认为有趣的部分将是围绕故障的几行(应该在文件末尾附近)。host.txt

从您的帖子中可以看出,您似乎安装了多个不同的版本。所有这些是否都安装到默认位置(C:\Program Files\dotnet)?

是否可以尝试是否有任何.NET可以工作?例如,您可以下载 而不是安装程序,将其解压缩到任何目录(不是程序文件),然后尝试从中运行。.zip``dotnet.exe --help

a professional answer

okarpov commented 2 years ago

got exectly the same error on Ubuntu Server 20.04

even df -h shows you have 11GB available out of 29GB - you still get this error

freeing up some disk space - solved this error and everything started working as expected

kouvel commented 2 years ago

@okarpov the issue you're seeing is probably something else, the issue above would only occur on Windows. If you can get some more information about the crash like stack traces or a core dump, please file a separate issue.

gsuberland commented 5 months ago

Yes the fix should be in the insider builds as of build 22509. The fix is still going through the process for backporting, so there's no decision yet on whether it would be ported back to Win11 RTM.

@kouvel I'm curious, what was the outcome of this decision in the end? Did the fix get backported to RTM?