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

corerun needs better error messages #7509

Closed
BruceForstall opened this issue Feb 26, 2017 · 4 comments · Fixed by #49529
Closed

corerun needs better error messages #7509

BruceForstall opened this issue Feb 26, 2017 · 4 comments · Fixed by #49529
Labels
area-Infrastructure-coreclr enhancement Product code improvement that does NOT require public API changes/additions help wanted [up-for-grabs] Good issue for external contributors
Milestone

Comments

@BruceForstall
Copy link
Member

Often I see

coreclr_initialize failed - status: 0x80131534

or similar. This is very unfriendly. Corerun should provide better root cause error messages so you're not required to fire up a debugger to track down every configuration "mistake".

@mazong1123
Copy link
Contributor

mazong1123 commented Mar 30, 2017

This error is for Unix only. How about adding a reason parameter to coreclr_initialize function, and update this parameter if any failure occurs inside this function? Then we are able to provide better error messages with useful debug info. For instance:

"PAL initialization failed"
"Failed to initialize runtime"
"Failed to set startup flag of runtime"

@janvorli
Copy link
Member

I think that such high level messages would not help in any of the cases people hit from time to time. If we wanted to generate helpful error messages, we would need to do that deep in the bowels of the coreclr runtime and PAL at all places we generate an error, because that's the only place where we really know why the specific error actually happened. The amount of code exercised during the initialization is large, so there are potentially many places that would need to be investigated and an error message generated.

And in some cases, the error code even comes from managed code, like e.g. the above mentioned code 0x80131534 which is COR_E_TYPEINITIALIZATION and which means that there was an unhandled exception during type initialization.

@danmoseley
Copy link
Member

Another option might be to recognize an environment variable analogous to the host's COREHOST_TRACE. When this is set, we write to console at places that historically have caused initialization failures. We can add more progressively as needed. The perf cost in the normal case would hopefully be low - a bunch of boolean checks and some code size. The goal simply being to help customers unblock themselves.

@jjxtra
Copy link

jjxtra commented Aug 15, 2019

Happens when I run a self contained app as non-sudo. Running as sudo I do not get the error. Latest .NET core 2.2, Linux x64, Ubuntu 18.04. Even hello world app has the issue.

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@msftgits msftgits added this to the Future milestone Jan 31, 2020
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Mar 14, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Mar 17, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Apr 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Infrastructure-coreclr enhancement Product code improvement that does NOT require public API changes/additions help wanted [up-for-grabs] Good issue for external contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants