Open .NET Core 2.0 dump in lldb on Linux - which lldb version?

Posted on Nov 2, 2022

Question

I'm trying to open a .NET Core 2.0 dump on Ubuntu 16.04, following instructions from http://blogs.microsoft.co.il/sasha/2017/02/26/analyzing-a-net-core-core-dump-on-linux/

Dump is created from running process with createdump PID.

I can not determine correct version of lldb. ldd $(find /usr/share/dotnet -name libsosplugin.so) | grep lldb does not return anything (there is no lldb in the output).

I have tried latest, 3.5 and 3.6, to no avail: Can not load or initialize libmscordaccore.so. The target runtime may not be initialized.

How can I find a correct lldb version for .NET Core 2.0 dumps?


Update: commands with output

$ find /usr/share/dotnet -name libsosplugin.so /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.5/libsosplugin.so

$ ldd $(find /usr/share/dotnet -name libsosplugin.so) linux-vdso.so.1 => (0x00007ffca344f000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f3d7eecc000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f3d7ebc3000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f3d7e9ad000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3d7e5e3000)

Answer

Quite old question, but maybe this helps someone:

E.g. Dockerfile to include lldb and into asp dotnet 3.1

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1

WORKDIR /vsdbg RUN apt-get update
&& apt-get install -y –no-install-recommends
unzip
procps
lldb-3.9
&& rm -rf /var/lib/apt/lists/*
&& curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v vs2019 -l /vsdbg WORKDIR /app

Also at a look at this site: https://www.aaron-powell.com/posts/2019-04-04-debugging-dotnet-in-docker-with-vscode/

And add CAP_SYS_PTRACE at docker run if you want to attach to the running process inside container.