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

dotnet-dump : "Can not load or initialize libmscordaccore.so" #4632

Closed
colinsusie opened this issue Apr 23, 2024 · 5 comments
Closed

dotnet-dump : "Can not load or initialize libmscordaccore.so" #4632

colinsusie opened this issue Apr 23, 2024 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@colinsusie
Copy link

dotnet sdk version: 8.0.2
dotnet-dump version: 8.0.5

My program is running inside a container and has crashed, generating a coredump file:

-rw------- 1 root root  48G Apr 22 01:21  core-SingleThreadEve-11-0-0-1-1713720038

I attempted to analyze the dump file directly within the container using dotnet-dump, when i entering clrstack, I encountered the following error:

Type 'quit' or 'exit' to exit the session.
> clrstack
Failed to load data access module, 0x80004002
Can not load or initialize libmscordaccore.so. The target runtime may not be initialized.

For more information see https://go.microsoft.com/fwlink/?linkid=2135652

Despite following the guidance provided by the link, I was unable to resolve the issue.

Subsequently, I manually collected a dump of the running program within the same pod using dotnet-dump. I didnt encounter any problem by using the dump file I collected manaully.

Could you help me understand the reason behind this discrepancy? Thank you.

The system environment for both compiling and running the program is identical.

@colinsusie colinsusie added the bug Something isn't working label Apr 23, 2024
@mikem8361 mikem8361 self-assigned this Apr 23, 2024
@mikem8361 mikem8361 added this to the 9.0.0 milestone Apr 23, 2024
@mikem8361
Copy link
Member

This is usually the SDK is a source built and not an SDK installed from our feeds. The debugging modules needed are not on the Microsoft symbol server. Since .NET 8.0 most distros like Ubuntu install .NET from their own feeds a source-built SDK. And it looks and has a version like the official Microsoft builds.

If you want to analyze the dump on a different machine, copy the libcordaccore.so and libcordbi.so from the pod the dump was generated in and use the setclrpath to tell SOS where they are.

@mikem8361
Copy link
Member

System dumps do not have all the managed state needed for SOS/debugging. They can be made to work by setting the coredump_filter file to 0x3f (see FAQ.)

@colinsusie
Copy link
Author

I found that the dump file generated by dotnet defaults to/tmp/coredump< PID>
The dump file generated by ubuntu is specified by/proc/sys/kernel/core-pattern
When the dotnet program crashes, both dump files are generated.
The dump file generated by dotnet can be analyzed by dotnet_dump, while the system generated file cannot

@mikem8361
Copy link
Member

Dump files created by the system do not have enough managed state for dotnet-dump/sos to work. If you want to use a system dump the coredump_filter file needs to be set to at least 0x3F. See this for more info.

@colinsusie
Copy link
Author

Thank you. After setting 0x3f, dotnet-dump can analyze the dump files generated by the system normally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants