Skip to content

Can not load or initialize libmscordaccor.so when debugging a coredump in lldb #122

@klesta490

Description

@klesta490

Hi,
I am trying to investigate our application crash

  • net core app running in docker
  • docker based on image microsoft/dotnet:2.1.7-runtime-stretch-slim
  • there is no .net runtime on host, only in docker image
  • host is centos

Our app is crashing with
kernel: traps: dotnet[12953] general protection error:0 in libgcc_s.so.1[7fbb0da04000+16000] error message in system logs (propably some native lib we call from C# is causing memory corruption).
I decided co create dump on next crash. So I setup COMPlus_DbgEnableMiniDump=1 and COMPlus_DbgMiniDumpType=4 (because I want to see method names #56). Also I run docker container as --privileged so dump is possible. When error occurs, dump is successfully created in /tmp directory.
I create image from crashed container so I can inspect dump
docker commit -m "crash" <container-name>.

Now I run this container with /bin/bash entrypoint and continue analysis with lldb-4.0 (as far as I know 3.9 is minimal working version).

I open dump using
lldb-4.0 $(which dotnet) --core /tmp/coredump.1
lldb> plugin load /usr/share/dotnet/shared/Microsoft.NETCore.App/2.1.7/libsosplugin.so
lldb> setclrpath /usr/share/dotnet/shared/Microsoft.NETCore.App/2.1.7
now I run any sos command and I get

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

Really weird is, that this approach is working flawlessly with demo project I have written to check this dump analysis scenario.

I have found #42 but I don't think that any advice from this issue is relevant to me, because I analyze dump with exactly same environment with which dump was created.

Thanks for help, any advice will be appreciated

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions