dotnet/diagnostics

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

colinsusie opened this issue · 5 comments

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.

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.

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.)