Open isbobbydigitalak opened 9 months ago
(gdb) p pCordb
$3 = (IUnknown *) 0x0
Looks like some libdbgshim.so issue, ManagedDebuggerHelpers::StartupCallback
callback called from libdbgshim.so
back to netcoredbg, and looks like some error happens, since it return NULL
for pCordb
.
https://github.com/dotnet/diagnostics/blob/1f512d6f5568d3303053fd5279a06425aae53e1c/src/dbgshim/dbgshim.cpp#L417
You probably could check error code from HRESULT hr
in
https://github.com/Samsung/netcoredbg/blob/27606c317017beb81bc1b81846cdc460a7a6aed3/src/debugger/manageddebugger.cpp#L453
Note, libdbgshim.so
is part of Diagnostics (https://github.com/dotnet/diagnostics), not netcoredbg, and now MS provide it as binary in NuGet package (that downloads during netcoredbg build from repo):
https://www.nuget.org/packages/Microsoft.Diagnostics.DbgShim
Also, you could test libdbgshim.so
from latest netcoredbg release. This one works for sure (at least on ubuntu 20.04, that we use for CI), since all releases we test on CI for all tests pass.
And (just in case) you could build libdbgshim.so
for your distro/envs from https://github.com/dotnet/diagnostics sources.
Thanks for the input! I will check the error code (though probably tomorrow or next week, already put a lot more time on this today than I should have!).
It is useful info that libdbgshim is downloaded as a binary. I ran ldd
on it the one I have installed now and saw that it is not able to resolve some dependencies (libstdc++ and libgcc_s). That doesn't really explain to me how it manages to still call back though. Furthermore, in my guix packaging attempt I wrote with the binary release, it uses patchelf to fix up all those dependencies (ldd shows all things resolved on those binaries), yet, netcoredbg still had the same behaviour, so while it's a problem it might not be the full story.
Anyhow, since guix (which is like nix) uses crazy paths for everything I might have a higher chance to succeed by going and building libdbgshim from source like you suggest. If it ends up working then it should be able to provide some hints for how I can package netcoredbg from the binary releases with patchelf.
Since this is some non-standard environment, you can also try to run all netcoredbg tests, see https://github.com/Samsung/netcoredbg/blob/master/test-suite/README.md. Also how did you install .net runtime, from binaries or built it yourself? It might be worth running .net runtime tests too to verify that it works.
I installed .NET runtime from binaries by modifying the package in the nonguix project (to update it to a newer version). It is probably worth running the runtime tests (if it's possible from binary build?), so far however, I have been using it for work without any issues, not only for extremely simple test programs.
Hello!
I can't get netcoredbg to work on even a simple project. Since I am using GUIX as my distro I decided to build netcoredbg from source so that we can rule out mis-matched libc version from the binary release and so on.
I have a very simple console test project that contains this source file
I built it with EmbedAllSources set to
true
.It crashes on the line
src/debugger/manageddebugger.cpp:559
in the latest released version of netcoredbg. This appears to be because the pCordb argument to StartupCallback is null. I don't know how to figure out why that is the case so I didn't go further than this.In case it helps I have also attached a gdb debugging session of what I tried: