"dotnet-dump analyze" command fails on stretch based docker image.
xinyanmsft opened this issue · comments
To reproduce,
- create a .net core application in a container, using mcr.microsoft.com/dotnet/core/sdk:2.1.603-stretch as its base image.
- run the container with --privileged option.
- collect the core dump file by calling 'dotnet-dump collect -p 1'.
- run 'dotnet-dump analyze
Result:
dotnet-dump collect -p 1
Writing minidump with heap to file /app/core_20190425_161006
Written 244236288 bytes (59628 pages) to core file
Complete
dotnet-dump analyze ./core_20190425_161006
Loading core dump: ./core_20190425_161006 ...
Ready to process analysis commands. Type 'help' to list available commands or 'help [command]' to get detailed help on a command.
Type 'quit' or 'exit' to exit the session.
Unhandled exception: System.DllNotFoundException: Unable to load shared library 'libdl.so' or one of its dependencies. In order to help diagnose
loading problems, consider setting the LD_DEBUG environment variable: liblibdl.so.so: cannot open shared object file: No such file or directory
at Microsoft.Diagnostics.Runtime.LinuxFunctions.dlopen(String filename, Int32 flags)
at SOS.SOSHost.ExecuteCommand(String command, String arguments) in //src/SOS/SOS.Hosting/SOSHost.cs:line 76
at Microsoft.Diagnostic.Tools.Dump.Analyzer.Analyze(FileInfo dump_path, String[] command) in //src/Tools/dotnet-dump/Analyzer.cs:line 61
at System.CommandLine.Invocation.CommandHandler.GetResultCodeAsync(Object value, InvocationContext context)
at System.CommandLine.Invocation.CommandHandler.GetResultCodeAsync(Object value, InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass3_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__16_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c__DisplayClass8_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__7_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__4_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__6_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__14_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass3_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__17_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__5_0>d.MoveNext()
One workaround is to install gcc or g++.
A work around is to install the "libc6-dev" package.
Catch above exception and recommend installing libc6-dev.
Documenting the work around and display a better error message with the work around is the only fix we have now.