Repository navigation
Closed
Description
Description
After updating to macOS Sonoma from macOS Monterey, dotnet runtime does not start with error Failed to create CoreCLR, HRESULT: 0x8007000C.
❯ dotnet new console
Failed to create CoreCLR, HRESULT: 0x8007000C
❯ dotnet --info
Failed to create CoreCLR, HRESULT: 0x8007000C
Host:
Version: 8.0.0
Architecture: arm64
Commit: 5535e31a71
RID: osx-arm64
.NET SDKs installed:
8.0.100 [/opt/homebrew/Cellar/dotnet/8.0.0/libexec/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.0 [/opt/homebrew/Cellar/dotnet/8.0.0/libexec/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.0 [/opt/homebrew/Cellar/dotnet/8.0.0/libexec/shared/Microsoft.NETCore.App]
Other architectures found:
x64 [/usr/local/share/dotnet/x64]
registered at [/etc/dotnet/install_location_x64]
Environment variables:
DOTNET_ROOT [/opt/homebrew/Cellar/dotnet/8.0.0/libexec]
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Reproduction Steps
- Be on macOS Sonoma
- Run
dotnet --infoordotnet new console - Observe
Failed to create CoreCLR, HRESULT: 0x8007000C
Expected behavior
dotnet runtime starts and works normally.
Actual behavior
It outputs Failed to create CoreCLR, HRESULT: 0x8007000C and exists with SIGKILL.
Regression?
It was working perfectly on macOS Monterey for me.
.NET version stayed the same, installed through Homebrew.
Known Workarounds
No response
Configuration
Device: MacBook Air 13 (M1, 2020) 16 GB, 512 GB
.NET Version: 8.0.100 (Homebrew)
OS: macOS Sonoma Version 14.2 (23C64), ARM64
There was similar issue over on YouTrack/RIDER-97269, but it was somehow solved for the person reporting it.
Other information
I have attached a log of running dotnet --info with export COREHOST_TRACE=1.
dotnet_info.log
Activity
janvorli commentedon Dec 27, 2023
The error code means
ERROR_INVALID_ACCESSand it seems the only place it can come from is this:runtime/src/coreclr/pal/src/map/virtual.cpp
Line 1216 in 9fa5128
I'll update my macOS to the latest Sonoma and see if I can repro it.
janvorli commentedon Dec 27, 2023
@LilyStilson I've just tried it on my macOS (updating to the latest Sonoma got me 14.3 beta) and I cannot repro the issue. But I have not tried the homebrew version. So I wonder if homebrew could be involved in the process somehow. Can you please try to download the official .tar.gz from our site https://dotnet.microsoft.com/en-us/download/dotnet/8.0 (use the link in the Binaries column, macOS row, arm64), untar it somewhere and then run the dotnet from that location?
This is what I get:
LilyStilson commentedon Dec 27, 2023
@janvorli Hello, thanks for your reply.
I tried getting binaries from the link you sent me, but it's all the same for me
At this point, I'm not sure at all why this happens, and it looks like it's something that happens on my particular machine, and I have no idea why it even could happen...
LilyStilson commentedon Dec 29, 2023
I've also tried getting .NET version 7 (ARM, macOS) and it seems to work perfectly fine
doghouch commentedon Jan 11, 2024
I also had this issue on macOS Sonoma (14.1), so just a tad older than 14.2. Spent a few hours re-installing and stumbled on this issue with the exact same error code.
I saw the linked issue (which seems to be resolved), and the "temporary fix" was to re-enable SIP (System Integrity Protection), assuming it was disabled. Given that it seems to have already been tried here, I'm not sure what else to do -- would the best course of action be to just revert to a previous version of macOS?
Edit: Checked anyway and it seems like I had SIP disabled. Re-enabling SIP seems to have fixed the problem for me.
LilyStilson commentedon Feb 15, 2024
@doghouch Thanks for the idea with SIP, I actually haven't tried that one. Unfortunately, I don't really have time to always reboot into recovery and constantly enable-disable SIP if I want to work in Rider, so I just installed a macOS 14 VM to work this around. However, the issue persists, and imo it should not be like that: .NET 7 works even with SIP disabled.
doghouch commentedon Feb 18, 2024
Yeah, it doesn’t really make much sense to me either. While I managed to work around this (thankfully, I had only disabled SIP to install Linux on my machine, so flip-flopping didn’t become a problem), I do hope that a fix is found soon.
meghrathod commentedon Mar 2, 2024
@janvorli Can you try to reproduce this by disabling SIP temporarily, I'm using a legacy piece of software which requires SIP disabled, and I am unable to use apps that reply on this runtime with SIP disabled.
janvorli commentedon Mar 19, 2024
@meghrathod I am sorry for the delay, I was heads down investigating and fixing some bugs. I have tried to disable SIP today. And dotnet works for me without any issues:
With .NET 8
janvorli commentedon Mar 19, 2024
And the same with .NET 7:
janvorli commentedon Mar 19, 2024
Actually, I've just spotted something in one of the outputs from the dotnet --info above that has failed:
I wonder if they can somehow collide.
agocke commentedon Apr 15, 2024
From the log, it looks like the host, which is signed with the MSFT key, is trying to load the runtime from homebrew, which is signed with an ad hoc key. That is likely producing the security issue in the original issue. It's not clear what's happening with the other cases. I'm going to close this issue since it's not clear each of these problems is the same thing.