diagnostics: `dotnet dump analyze` commands like `pe` crashes the debugging session

Description

I can load the dump, but commands like pe, clrstack, clrthreads crash the process with this exception:

Unhandled Exception: System.OverflowException: Array dimensions exceeded supported range.
   at Microsoft.Diagnostics.Runtime.Linux.ElfSymbolGnuHash..ctor(Reader reader, Boolean is64Bit, Int64 address)
   at Microsoft.Diagnostics.Runtime.Linux.ElfDynamicSection..ctor(Reader reader, Boolean is64Bit, Int64 address, Int64 size)
   at Microsoft.Diagnostics.Runtime.Linux.ElfFile.get_DynamicSection()
   at Microsoft.Diagnostics.Runtime.CoredumpReader.TryGetSymbolAddress(UInt64 baseAddress, String name, UInt64& offset)
   at Microsoft.Diagnostics.DebugServices.Implementation.RuntimeService.Microsoft.Diagnostics.Runtime.IExportReader.TryGetSymbolAddress(UInt64 baseAddress, String name, UInt64& offset) in /_/src/Microsoft.Diagnostics.DebugServices.Implementation/RuntimeService.cs:line 243
   at Microsoft.Diagnostics.Runtime.DataTarget.GetOrCreateClrVersions()
   at Microsoft.Diagnostics.DebugServices.Implementation.RuntimeService.BuildRuntimes() in /_/src/Microsoft.Diagnostics.DebugServices.Implementation/RuntimeService.cs:line 302
   at Microsoft.Diagnostics.DebugServices.Implementation.RuntimeService.FindRuntime() in /_/src/Microsoft.Diagnostics.DebugServices.Implementation/RuntimeService.cs:line 260
   at Microsoft.Diagnostics.DebugServices.Implementation.RuntimeService.get_CurrentRuntime() in /_/src/Microsoft.Diagnostics.DebugServices.Implementation/RuntimeService.cs:line 84
   at SOS.Hosting.TargetWrapper.GetRuntime(IntPtr self, IntPtr* ppRuntime) in /_/src/SOS/SOS.Hosting/TargetWrapper.cs:line 100
   at SOS.Hosting.SOSHost.ExecuteCommand(String command, String arguments) in /_/src/SOS/SOS.Hosting/SOSHost.cs:line 187
   at SOS.Hosting.SOSCommand.Invoke() in /_/src/SOS/SOS.Hosting/Commands/SOSCommand.cs:line 74

The same happens in lldb.

OS Linux: Manjaro 21.0.5 Ornara, x86_64 Linux 5.12.2-1-MANJARO

dotnet tool list:

Package Id                             Version         Commands       
----------------------------------------------------------------------
dotnet-dump                            5.0.221401      dotnet-dump    
dotnet-ildasm                          0.12.2          dotnet-ildasm  
dotnet-script                          1.1.0           dotnet-script  
dotnet-sos                             5.0.221401      dotnet-sos     
dotnet-symbol                          1.0.212301      dotnet-symbol  
microsoft.logging.clog                 0.2.0           clog           
microsoft.logging.clog2text.lttng      0.2.0           clog2text_lttng

dotnet --info

.NET SDK (reflecting any global.json):
 Version:   6.0.100-preview.4.21212.5
 Commit:    c6e6c1b622

Runtime Environment:
 OS Name:     manjaro
 OS Version:  
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/6.0.100-preview.4.21212.5/

Host (useful for support):
  Version: 6.0.0-preview.4.21205.3
  Commit:  b7a1648825

.NET SDKs installed:
  2.1.816 [/usr/share/dotnet/sdk]
  5.0.100 [/usr/share/dotnet/sdk]
  5.0.202 [/usr/share/dotnet/sdk]
  6.0.100-preview.4.21212.5 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 5.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.0-preview.4.21207.16 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.28 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.12 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.14 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0-preview.4.21205.3 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download

Regression?

Potentially, I have recently updated the tools. I did run dotnet sos install afterwards.

Other information

I can share the dump on which I’m experiencing this. I can also share a dump of the dotnet dump process.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (17 by maintainers)

Most upvoted comments

0x3f is probably enough to get everything.

Mike is correct, that is the underlying issue here. I have updated ClrMD to generate a better exception and message when we encounter this issue in the future, thanks for the report!

https://github.com/microsoft/clrmd/pull/1200

Linux system core dumps don’t have enough state for our tools to work. You need to make it a full system dump by setting the /proc/<pid>/coredump_filter filter to 0xff.

echo 0xff > /proc/self/coredump_filter

Then generate dump in the shell instance.