runtime: Can not load or initialize libmscordaccor.so when debugging a coredump in lldb

We have a coredump from our application that was built using the .NET Core 2.0.3 SDK, a standalone app. The application was running on CentOS7.

To perform some analysis on the dump, I’ve exported the file onto an Ubuntu 16.04 VM, with lldb-3.6 installed, and the same .NET Core SDK Version that was used to build the application.

I’m launching lldb like this:

lldb-3.6 /usr/bin/dotnet --core ./mydumpfilehere

The dump is loaded, and I’m able to use the standard lldb commands, so far, so good. Now I want to load the sos plugin, which I do by running:

plugin load /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.3/libsosplugin.so

Now, if I type help, I see the commands from the plugin.

Finally, I setclrpath to setclrpath /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.3 and to my knowledge, I should be good to go.

Now, as soon as I use any sos command, I get the following message:

Failed to load data access DLL, 0x80004005
Can not load or initialize libmscordaccore.so. The target runtime may not be initialized.

I thought, that perhaps, the SDK versions weren’t quite matching up, so I built the coreclr repo, and used the plugin from there instead, still with no luck.

Finally, I thought I might be able to use the plugin that’s actually shipped with our self contained app, again, that does not work.

The only thing I can think of, is I need to analyse this on a CentOS 7 machine, but my (limited) understanding is that shouldn’t matter?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 7
  • Comments: 22 (11 by maintainers)

Most upvoted comments

You have correct steps (yes on setclrpath). The only thing that seems to be missing in your above comments is the host (“dotnet” or “corerun”) used to run your test program. lldb doesn’t seem to find any of the other modules if I don’t add the host program to the --core comand line.

Here is the script I use to load my core dump on Ubuntu:

BUILD_DIR=$HOME/coreclr/bin/Product/Linux.x64.Debug
DOTNET=/usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.3
HOST=$HOME/save/centosdump/dotnet
$LLDB_PATH -o "plugin load $BUILD_DIR/libsosplugin.so" -o "setclrpath $DOTNET" --core $HOME/save/centosdump/core.43690 $HOST

If you only have 2.0.3 installed then the HOST path should be HOST=/usr/share/dotnet/dotnet

$ ls
core.43690*  dotnet*  loadcore*

Hopefully that is clearer.