-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to create CoreCLR, HRESULT: 0x8007001F on MacOSX #10870
Comments
Decoding this error: **********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.4.2
** Copyright (c) 2019 Microsoft Corporation
**********************************************************************
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community>certutil -error 0x8007001F
0x8007001f (WIN32: 31 ERROR_GEN_FAILURE) -- 2147942431 (-2147024865)
Error message text: A device attached to the system is not functioning.
CertUtil: -error command completed successfully. reveals that it is cc @janvorli |
I closed Linux VM and dotnet runs normally. However, this is a bit strange and doesn't look like memory problem according to vm_stat
In second sample system has less free memory but dotnet runs normally... P.S. I'm a bit curious why Blender, Libreoffice, Android Studio and R-Studio are able to start at the same time, but |
The ERROR_GEN_FAILURE can mean a lot of things. It means that something non-specific has failed during CoreCLR PAL initialization, it doesn't have to be related to memory at all. |
Yes. How I can get "instrumented version"? P.S. I'm not able to reproduce the problem after system reboot, but will try on holidays. |
I would create one for you and share it via e.g. OneDrive. But let's first wait to see if you can repro the issue again. |
It is hard to reproduce. But...
Notice the updated dotnet version. |
@nbkolchin what did the updated version change? It is less frequent than with the 3.1.102 you've reported a week ago? |
Nothing changed. The problem is hard to reproduce but exist in all tested versions. |
The problem is actually more serious than I thought. Published .NET applications also don't work.
This makes .NET not a viable solution for cross-platform development and we bet much on it... |
It is not a surprise, as the issue seems to be in the coreclr initialization and that's shared between the dotnet tool execution and any app execution. So it seems you can repro it quite well. Then it seems it would make sense to try to figure out the exact reason for the failure using an instrumented libcoreclr.dylib. |
@nbkolchin you can get a modified libcoreclr.dylib here: https://1drv.ms/u/s!AkLV4wRkyHYhyRiRIChDXxs8RvQJ?e=NnoGZ0
Then the easiest way to try it is to use the published version of your app and replace the libcoreclr.dylib in its directory by the one you've just downloaded and ungzipped. When you run the application, it would still fail, but it should display a different error code that corresponds to the step in the runtime initialization that has failed instead of just this generic failure code. Please share the error code (HRESULT) with me and I'll look it up. |
|
Hmm, that's interesting. So this is the function that fails: There are three possible failure points there:
So I wonder if it is the mlock failing. Can you please share the output of I will also share one more instrumented version of libcoreclr.dylib with you that will report clearly which of those three failures happened and what was the exact error. |
|
I've tracked problem to
But
|
It seems that parallels consume all the wired memory allowed. Wired memory is a memory that's locked (not allowed to be swapped to disk). It seems that the system wide limit is set to 80% of the physical memory. And it is the limit that causes the mlock to fail with EAGAIN. Looking at your vm_stat results that you've reported before, I can see that without parallels, the "Pages wired down" is 2229157 and with parallels, it is 3307031. |
Yes 16GB. I understand that this is weird MacOSX behaviour. Forcing some pages to swap (i.e. running application that eats some memory) make
|
Maybe there is something else running that consumes a lot of wired pages. Even without parallels, the 2229157 pages means that around 8.5GB of wired pages are consumed, which seems to be a lot and close to the limit that is approx 12.8GB on your device. On my Mac, the vm_stat reports only around 1.23GB of wired pages. I've found the following script to dump wired pages by process sorted by size at https://apple.stackexchange.com/questions/349037/30gb-out-of-32gb-being-used-for-wired-memory kextstat | awk 'NR==1{ printf "%10s %s\n", $5, $6; } NR!=1{ printf "%10d %s\n", $5, $6; }' | sort -n |
@janvorli does this issue belong in dotnet/runtime? |
@sfoslund I am sorry for missing your message. Yes, it belongs there. |
This issue was moved to dotnet/runtime#34793 |
related: #10737
MacOSX: 10.15.3, dotnet installed via brew cask.
Any dotnet cli command in MacOSX fails after starting Windows inside Parallels Desktop. After stopping Parallels, dotnet commands run normally.
Gist with COREHOST_TRACE: https://gist.github.com/nbkolchin/667e96211531eb277bdb320fcc23fc90
The text was updated successfully, but these errors were encountered: