Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'dotnet-dump analyze' crashes when loading core dump #3003

Closed
moomiji opened this issue Apr 11, 2022 · 4 comments
Closed

'dotnet-dump analyze' crashes when loading core dump #3003

moomiji opened this issue Apr 11, 2022 · 4 comments
Assignees
Labels
bug Something isn't working dotnet-dump
Milestone

Comments

@moomiji
Copy link

moomiji commented Apr 11, 2022

Description

bash-5.1# dotnet-dump collect -p 1 --type Mini -o ./1
Writing dump to /1
Complete

bash-5.1# ls -alSh
total 1.5G
-rw-------   1 root root 1.5G Apr 12  core_20220412_012637
-rw-------   1 root root  15M Apr 12  1

bash-5.1# dotnet-dump analyze 1
Loading core dump: 1 ...
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.ArgumentException: An item with the same key has already been added. Key: 3421085696 (Parameter 'key')
   at System.Collections.Generic.SortedList`2.Add(TKey key, TValue value)
   at Microsoft.Diagnostics.Runtime.Utilities.ElfCoreFile.LoadFileTable()
   at Microsoft.Diagnostics.Runtime.CoredumpReader.EnumerateModules()
   at Microsoft.Diagnostics.Runtime.Utilities.LinuxDefaultSymbolLocator..ctor(IDataReader reader)
   at Microsoft.Diagnostics.Runtime.DataTarget..ctor(CustomDataTarget customTarget)
   at Microsoft.Diagnostics.Runtime.DataTarget.LoadDump(String displayName, Stream stream, CacheOptions cacheOptions, Boolean leaveOpen)
   at Microsoft.Diagnostics.Runtime.DataTarget.LoadDump(String filePath, CacheOptions cacheOptions)
   at Microsoft.Diagnostics.Tools.Dump.Analyzer.Analyze(FileInfo dump_path, String[] command) in /_/src/Tools/dotnet-dump/Analyzer.cs:line 65
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Delegate.DynamicInvoke(Object[] args)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseErrorReporting>b__21_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__22_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseDirective>b__20_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseDebugDirective>b__11_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext()

Configuration

Running in Container (mcr.microsoft.com/dotnet/sdk:6.0.201-alpine3.14-arm64v8).

bash-5.1# dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.201
 Commit:    ef40e6aa06

Runtime Environment:
 OS Name:     alpine
 OS Version:  3.14
 OS Platform: Linux
 RID:         alpine.3.14-arm
 Base Path:   /usr/share/dotnet/sdk/6.0.201/
@moomiji moomiji added the bug Something isn't working label Apr 11, 2022
@mikelle-rogers
Copy link
Member

@moomiji Thank you for reporting this issue. We are working through issues and will look into this one as soon as possible.

@mikem8361 mikem8361 self-assigned this Apr 13, 2022
@mikem8361 mikem8361 added this to the .NET 7.0 milestone Apr 13, 2022
@mikem8361
Copy link
Member

Is there any way you could attach the core dump? Zip it up to make it smaller?

@moomiji
Copy link
Author

moomiji commented May 9, 2022

Hi @mikem8361 ,

I zipped a core dump file which attached by dotnet-dump collect --type Mini.
core_20220509_154002.zip

mikem8361 added a commit to mikem8361/clrmd that referenced this issue May 9, 2022
The unhandled exception in the ELF reader happened because there is a duplicate file pointer
entry for some images in the list. Removed the unnecessary ElfLoadedImage file table list
and tracked the minimum pointer instead. This is the symstore ELF reader does and it works
great.

Issue: dotnet/diagnostics#3003

Passes the SOS tests.
leculver pushed a commit to microsoft/clrmd that referenced this issue May 10, 2022
The unhandled exception in the ELF reader happened because there is a duplicate file pointer
entry for some images in the list. Removed the unnecessary ElfLoadedImage file table list
and tracked the minimum pointer instead. This is the symstore ELF reader does and it works
great.

Issue: dotnet/diagnostics#3003

Passes the SOS tests.
@mikem8361
Copy link
Member

This should be fixed now. It may be a month or so before our next tools release that includes this fix.

@ghost ghost locked as resolved and limited conversation to collaborators Jun 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working dotnet-dump
Projects
None yet
Development

No branches or pull requests

3 participants