Skip to content
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

Error: Failed to create CoreCLR, HRESULT: 0x80004005 #110251

Open
superbonaci opened this issue Nov 28, 2024 · 17 comments
Open

Error: Failed to create CoreCLR, HRESULT: 0x80004005 #110251

superbonaci opened this issue Nov 28, 2024 · 17 comments
Labels
area-Host untriaged New issue has not been triaged by the area owner

Comments

@superbonaci
Copy link

Description

I'm getting this error when launching a program compiled with dotnet. How can I debug what can be the cause?

Reproduction Steps

Run the program.

Expected behavior

Do not crash.

Actual behavior

Crashes.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Nov 28, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Nov 28, 2024
@filipnavara
Copy link
Member

It's "access violation" error. As a good start, you should at least state your platform (Windows? Linux?), .NET version, etc. It would be ideal if you could produce a small repro or at least capture a crash dump (instructions depend on the system).

@superbonaci
Copy link
Author

superbonaci commented Nov 28, 2024

It's macOs 15.1.1 with CPU Apple M1.
I can compile the dotnet app with debug info I think.
dotnet version is 9.0.100 and the app was compiled with that version too.

@janvorli
Copy link
Member

@filipnavara this is actually not an access violation error, that would be 0xC0000005. This error code (0x80004005) means E_FAIL. @superbonaci, does it write only the message you have put to the title to the console or is there something more?

@filipnavara
Copy link
Member

This error code (0x80004005) means E_FAIL.

D'oh. Of course. Thanks for correcting me :-)

@superbonaci
Copy link
Author

@janvorli it's only that.

@janvorli
Copy link
Member

janvorli commented Dec 3, 2024

@superbonaci how do you compile and run your app? Can you check if a hello world app that "dotnet new console" creates has the same problem? And have you compiled your app on the same Apple M1 device?

@superbonaci
Copy link
Author

@janvorli that command does not fail, and if I run it before my app doesn't crash either. It looks like "dotnet new console" sets a proper environment for my app which doesn't happen if I run it alone.

@janvorli
Copy link
Member

janvorli commented Dec 3, 2024

@superbonaci I am sorry I was not clear. I meant running the app created by the "dotnet new console" too. So in the same directory where you've ran the "dotnet new console", you'd do "dotnet run".

@superbonaci
Copy link
Author

@janvorli yes the Hello, World! appears then my program runs. I've noticed that this issue only happens with I call it from a script, if I run it from the terminal directly doesn't happen.

@janvorli
Copy link
Member

janvorli commented Dec 3, 2024

Ok, thank you for the details. Can you please share how you build and how you run your app? Invoking it from a script should make no difference.

@superbonaci
Copy link
Author

dotnet publish MyApp -p:PublishProfile=MacOSArm64

@janvorli
Copy link
Member

janvorli commented Dec 3, 2024

Thank you. I have several more questions:

  • what is the definition of the MacOSArm64 profile that you are using?
  • how exactly do you invoke your app from the script (I would like to know the full command line)?
  • are you sure that the right .NET runtime host is on the PATH when you run it from the script?

@superbonaci
Copy link
Author

The app was always published as self-contained:

$ dotnet publish MyApp -p:PublishProfile=MacOSArm64 -r osx-arm64 --self-contained

Compiled with newest update dotnet--9.0.101.arm64_sequoia.bottle.tar.gz using brew.sh and still same issue.
How can I debug it?

@elinor-fung
Copy link
Member

@superbonaci could you share the information @janvorli requested at #110251 (comment)?

@elinor-fung elinor-fung added needs-author-action An issue or pull request that requires more info or actions from the author. and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Dec 9, 2024
@superbonaci
Copy link
Author

Is there any GDB for dotnet? I just can't work with this.

@dotnet-policy-service dotnet-policy-service bot removed the needs-author-action An issue or pull request that requires more info or actions from the author. label Dec 9, 2024
@janvorli
Copy link
Member

janvorli commented Dec 9, 2024

@superbonaci you can use LLDB, that's what we use to debug native parts of the .NET runtime. I think we can help you more without you having to debug stuff though if you'd share all the details I have asked for before.

One more question - what is the reason for using the brew version of .NET instead of the official build? We don't control or test that one, so that could also be part of the problem.

@superbonaci
Copy link
Author

I'll try again after upgrading to macOS 15.2, in case it's operating system bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Host untriaged New issue has not been triaged by the area owner
Projects
Status: No status
Development

No branches or pull requests

5 participants