dotnet / diagnostics

This repository contains the source code for various .NET Core runtime diagnostic tools and documents.
MIT License
1.18k stars 354 forks source link

dotnet dump throws unhandled exception #360

Closed tmds closed 5 years ago

tmds commented 5 years ago

I've installed latest versions of dotnet-dump and .NET Core 3.0 on Fedora 30.

$ dotnet tool list -g
Package Id       Version                     Commands   
--------------------------------------------------------
dotnet-dump      1.0.4-preview6.19311.1      dotnet-dump
$ dotnet --version
3.0.100-preview6-011807

I'm trying to analyze a coredump:

$ dotnet dump analyze /tmp/dump
> clrthreads

Things go wrong:

Unhandled Exception: System.IO.IOException: I/O error occurred.
   at Microsoft.Diagnostics.Runtime.Linux.Reader.Read[T](Int64 position)
   at Microsoft.Diagnostics.Runtime.Linux.ElfFile.LoadNotes()
   at Microsoft.Diagnostics.Runtime.Linux.ElfFile.get_BuildId()
   at Microsoft.Diagnostics.Runtime.CoreDumpReader.CreateModuleInfo(ElfLoadedImage img)
   at System.Linq.Enumerable.SelectArrayIterator`2.ToArray()
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at SOS.LLDBServicesWrapper.GetCoreClrDirectory(IntPtr self) in /_/src/SOS/SOS.Hosting/LLDBServicesWrapper.cs:line 102
   at SOS.SOSHost.ExecuteCommand(String command, String arguments) in /_/src/SOS/SOS.Hosting/SOSHost.cs:line 253
   at Microsoft.Diagnostic.Tools.Dump.SOSCommand.Invoke() in /_/src/Tools/dotnet-dump/Commands/SOSCommand.cs:line 50
Internal CLR error. (0x80131506)
   at SOS.SOSHost.ExecuteCommand(System.String, System.String)
   at Microsoft.Diagnostic.Tools.Dump.SOSCommand.Invoke()
   at System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Object[], System.Signature, Boolean, Boolean)
   at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   at Microsoft.Diagnostic.Repl.CommandProcessor+Handler.Invoke(System.Reflection.MethodInfo, System.CommandLine.Invocation.InvocationContext)
   at Microsoft.Diagnostic.Repl.CommandProcessor+Handler.System.CommandLine.Invocation.ICommandHandler.InvokeAsync(System.CommandLine.Invocation.InvocationContext)
   at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass2_0+<<InvokeAsync>b__0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass2_0+<<InvokeAsync>b__0>d, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<InvokeAsync>b__0>d ByRef)
   at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass2_0.<InvokeAsync>b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2<System.CommandLine.Invocation.InvocationContext,System.Threading.Tasks.Task>)
   at System.CommandLine.Invocation.InvocationExtensions+<>c+<<UseParseErrorReporting>b__16_0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationExtensions+<>c+<<UseParseErrorReporting>b__16_0>d, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<UseParseErrorReporting>b__16_0>d ByRef)
   at System.CommandLine.Invocation.InvocationExtensions+<>c.<UseParseErrorReporting>b__16_0(System.CommandLine.Invocation.InvocationContext, System.Func`2<System.CommandLine.Invocation.InvocationContext,System.Threading.Tasks.Task>)
   at System.CommandLine.Invocation.InvocationExtensions+<>c+<<UseSuggestDirective>b__7_0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationExtensions+<>c+<<UseSuggestDirective>b__7_0>d, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<UseSuggestDirective>b__7_0>d ByRef)
   at System.CommandLine.Invocation.InvocationExtensions+<>c.<UseSuggestDirective>b__7_0(System.CommandLine.Invocation.InvocationContext, System.Func`2<System.CommandLine.Invocation.InvocationContext,System.Threading.Tasks.Task>)
   at System.CommandLine.Invocation.InvocationExtensions+<>c+<<UseParseDirective>b__6_0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationExtensions+<>c+<<UseParseDirective>b__6_0>d, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<UseParseDirective>b__6_0>d ByRef)
   at System.CommandLine.Invocation.InvocationExtensions+<>c.<UseParseDirective>b__6_0(System.CommandLine.Invocation.InvocationContext, System.Func`2<System.CommandLine.Invocation.InvocationContext,System.Threading.Tasks.Task>)
   at System.CommandLine.Invocation.InvocationExtensions+<>c+<<UseHelp>b__14_0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationExtensions+<>c+<<UseHelp>b__14_0>d, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<UseHelp>b__14_0>d ByRef)
   at System.CommandLine.Invocation.InvocationExtensions+<>c.<UseHelp>b__14_0(System.CommandLine.Invocation.InvocationContext, System.Func`2<System.CommandLine.Invocation.InvocationContext,System.Threading.Tasks.Task>)
   at System.CommandLine.Invocation.InvocationExtensions+<>c__DisplayClass5_0+<<UseExceptionHandler>b__0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationExtensions+<>c__DisplayClass5_0+<<UseExceptionHandler>b__0>d, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<UseExceptionHandler>b__0>d ByRef)
   at System.CommandLine.Invocation.InvocationExtensions+<>c__DisplayClass5_0.<UseExceptionHandler>b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2<System.CommandLine.Invocation.InvocationContext,System.Threading.Tasks.Task>)
   at System.CommandLine.Invocation.InvocationPipeline+<InvokeAsync>d__2.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationPipeline+<InvokeAsync>d__2, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<InvokeAsync>d__2 ByRef)
   at System.CommandLine.Invocation.InvocationPipeline.InvokeAsync(System.CommandLine.IConsole)
   at System.CommandLine.Invocation.InvocationExtensions+<InvokeAsync>d__9.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationExtensions+<InvokeAsync>d__9, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<InvokeAsync>d__9 ByRef)
   at System.CommandLine.Invocation.InvocationExtensions.InvokeAsync(System.CommandLine.Parser, System.CommandLine.ParseResult, System.CommandLine.IConsole)
   at Microsoft.Diagnostic.Tools.Dump.Analyzer+<>c__DisplayClass4_0+<<Analyze>b__0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.Diagnostic.Tools.Dump.Analyzer+<>c__DisplayClass4_0+<<Analyze>b__0>d, dotnet-dump, Version=1.0.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<Analyze>b__0>d ByRef)
   at Microsoft.Diagnostic.Tools.Dump.Analyzer+<>c__DisplayClass4_0.<Analyze>b__0(System.String, System.Threading.CancellationToken)
   at Microsoft.Diagnostic.Repl.ConsoleProvider+<Dispatch>d__33.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.Diagnostic.Repl.ConsoleProvider+<Dispatch>d__33, Microsoft.Diagnostic.Repl, Version=1.0.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<Dispatch>d__33 ByRef)
   at Microsoft.Diagnostic.Repl.ConsoleProvider.Dispatch(System.String, System.Func`3<System.String,System.Threading.CancellationToken,System.Threading.Tasks.Task>)
   at Microsoft.Diagnostic.Repl.ConsoleProvider+<ProcessKeyInfo>d__32.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.Diagnostic.Repl.ConsoleProvider+<ProcessKeyInfo>d__32, Microsoft.Diagnostic.Repl, Version=1.0.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<ProcessKeyInfo>d__32 ByRef)
   at Microsoft.Diagnostic.Repl.ConsoleProvider.ProcessKeyInfo(System.ConsoleKeyInfo, System.Func`3<System.String,System.Threading.CancellationToken,System.Threading.Tasks.Task>)
   at Microsoft.Diagnostic.Repl.ConsoleProvider+<Start>d__19.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.Diagnostic.Repl.ConsoleProvider+<Start>d__19, Microsoft.Diagnostic.Repl, Version=1.0.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<Start>d__19 ByRef)
   at Microsoft.Diagnostic.Repl.ConsoleProvider.Start(System.Func`3<System.String,System.Threading.CancellationToken,System.Threading.Tasks.Task>)
   at Microsoft.Diagnostic.Tools.Dump.Analyzer+<Analyze>d__4.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.Diagnostic.Tools.Dump.Analyzer+<Analyze>d__4, dotnet-dump, Version=1.0.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<Analyze>d__4 ByRef)
   at Microsoft.Diagnostic.Tools.Dump.Analyzer.Analyze(System.IO.FileInfo, System.String[])
   at System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Object[], System.Signature, Boolean, Boolean)
   at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   at System.Delegate.DynamicInvokeImpl(System.Object[])
   at System.CommandLine.Invocation.ModelBindingCommandHandler+<InvokeAsync>d__6.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.ModelBindingCommandHandler+<InvokeAsync>d__6, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<InvokeAsync>d__6 ByRef)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(System.CommandLine.Invocation.InvocationContext)
   at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass2_0+<<InvokeAsync>b__0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass2_0+<<InvokeAsync>b__0>d, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<InvokeAsync>b__0>d ByRef)
   at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass2_0.<InvokeAsync>b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2<System.CommandLine.Invocation.InvocationContext,System.Threading.Tasks.Task>)
   at System.CommandLine.Invocation.InvocationExtensions+<>c+<<UseParseErrorReporting>b__16_0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationExtensions+<>c+<<UseParseErrorReporting>b__16_0>d, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<UseParseErrorReporting>b__16_0>d ByRef)
   at System.CommandLine.Invocation.InvocationExtensions+<>c.<UseParseErrorReporting>b__16_0(System.CommandLine.Invocation.InvocationContext, System.Func`2<System.CommandLine.Invocation.InvocationContext,System.Threading.Tasks.Task>)
   at System.CommandLine.Invocation.InvocationExtensions+<>c__DisplayClass8_0+<<UseTypoCorrections>b__0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationExtensions+<>c__DisplayClass8_0+<<UseTypoCorrections>b__0>d, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<UseTypoCorrections>b__0>d ByRef)
   at System.CommandLine.Invocation.InvocationExtensions+<>c__DisplayClass8_0.<UseTypoCorrections>b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2<System.CommandLine.Invocation.InvocationContext,System.Threading.Tasks.Task>)
   at System.CommandLine.Invocation.InvocationExtensions+<>c+<<UseSuggestDirective>b__7_0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationExtensions+<>c+<<UseSuggestDirective>b__7_0>d, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<UseSuggestDirective>b__7_0>d ByRef)
   at System.CommandLine.Invocation.InvocationExtensions+<>c.<UseSuggestDirective>b__7_0(System.CommandLine.Invocation.InvocationContext, System.Func`2<System.CommandLine.Invocation.InvocationContext,System.Threading.Tasks.Task>)
   at System.CommandLine.Invocation.InvocationExtensions+<>c+<<UseParseDirective>b__6_0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationExtensions+<>c+<<UseParseDirective>b__6_0>d, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<UseParseDirective>b__6_0>d ByRef)
   at System.CommandLine.Invocation.InvocationExtensions+<>c.<UseParseDirective>b__6_0(System.CommandLine.Invocation.InvocationContext, System.Func`2<System.CommandLine.Invocation.InvocationContext,System.Threading.Tasks.Task>)
   at System.CommandLine.Invocation.InvocationExtensions+<>c+<<UseHelp>b__14_0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationExtensions+<>c+<<UseHelp>b__14_0>d, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<UseHelp>b__14_0>d ByRef)
   at System.CommandLine.Invocation.InvocationExtensions+<>c.<UseHelp>b__14_0(System.CommandLine.Invocation.InvocationContext, System.Func`2<System.CommandLine.Invocation.InvocationContext,System.Threading.Tasks.Task>)
   at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass3_0+<<UseVersionOption>b__0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass3_0+<<UseVersionOption>b__0>d, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<UseVersionOption>b__0>d ByRef)
   at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass3_0.<UseVersionOption>b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2<System.CommandLine.Invocation.InvocationContext,System.Threading.Tasks.Task>)
   at System.CommandLine.Invocation.InvocationExtensions+<>c+<<RegisterWithDotnetSuggest>b__17_0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationExtensions+<>c+<<RegisterWithDotnetSuggest>b__17_0>d, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<RegisterWithDotnetSuggest>b__17_0>d ByRef)
   at System.CommandLine.Invocation.InvocationExtensions+<>c.<RegisterWithDotnetSuggest>b__17_0(System.CommandLine.Invocation.InvocationContext, System.Func`2<System.CommandLine.Invocation.InvocationContext,System.Threading.Tasks.Task>)
   at System.CommandLine.Invocation.InvocationExtensions+<>c__DisplayClass5_0+<<UseExceptionHandler>b__0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationExtensions+<>c__DisplayClass5_0+<<UseExceptionHandler>b__0>d, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<UseExceptionHandler>b__0>d ByRef)
   at System.CommandLine.Invocation.InvocationExtensions+<>c__DisplayClass5_0.<UseExceptionHandler>b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2<System.CommandLine.Invocation.InvocationContext,System.Threading.Tasks.Task>)
   at System.CommandLine.Invocation.InvocationExtensions+<>c+<<UseDebugDirective>b__4_0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationExtensions+<>c+<<UseDebugDirective>b__4_0>d, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<UseDebugDirective>b__4_0>d ByRef)
   at System.CommandLine.Invocation.InvocationExtensions+<>c.<UseDebugDirective>b__4_0(System.CommandLine.Invocation.InvocationContext, System.Func`2<System.CommandLine.Invocation.InvocationContext,System.Threading.Tasks.Task>)
   at System.CommandLine.Invocation.InvocationExtensions+<>c+<<CancelOnProcessTermination>b__0_0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationExtensions+<>c+<<CancelOnProcessTermination>b__0_0>d, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<<CancelOnProcessTermination>b__0_0>d ByRef)
   at System.CommandLine.Invocation.InvocationExtensions+<>c.<CancelOnProcessTermination>b__0_0(System.CommandLine.Invocation.InvocationContext, System.Func`2<System.CommandLine.Invocation.InvocationContext,System.Threading.Tasks.Task>)
   at System.CommandLine.Invocation.InvocationPipeline+<InvokeAsync>d__2.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationPipeline+<InvokeAsync>d__2, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<InvokeAsync>d__2 ByRef)
   at System.CommandLine.Invocation.InvocationPipeline.InvokeAsync(System.CommandLine.IConsole)
   at System.CommandLine.Invocation.InvocationExtensions+<InvokeAsync>d__9.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationExtensions+<InvokeAsync>d__9, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<InvokeAsync>d__9 ByRef)
   at System.CommandLine.Invocation.InvocationExtensions.InvokeAsync(System.CommandLine.Parser, System.CommandLine.ParseResult, System.CommandLine.IConsole)
   at System.CommandLine.Invocation.InvocationExtensions+<InvokeAsync>d__11.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationExtensions+<InvokeAsync>d__11, System.CommandLine, Version=0.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<InvokeAsync>d__11 ByRef)
   at System.CommandLine.Invocation.InvocationExtensions.InvokeAsync(System.CommandLine.Parser, System.String[], System.CommandLine.IConsole)
   at Microsoft.Diagnostic.Tools.Dump.Program.<Main>(System.String[])

I had a look at the files dotnet dump is trying to use. It is looking for a Microsoft.DiaSymReader.Native.amd64.dll but is not able to find it.

In the linux-x64 sdk, there are such files at:

$ find . -name 'Microsoft.DiaSymReader.Native.amd64.dll'
./sdk/3.0.100-preview6-012264/Roslyn/bincore/runtimes/win/native/Microsoft.DiaSymReader.Native.amd64.dll
./sdk/3.0.100-preview6-012264/Roslyn/bincore/runtimes/win-x64/native/Microsoft.DiaSymReader.Native.amd64.dll

the Windows sdk has an additional one:

$ find . -name 'Microsoft.DiaSymReader.Native.amd64.dll'
./shared/Microsoft.NETCore.App/3.0.0-preview6-27804-01/Microsoft.DiaSymReader.Native.amd64.dll
./sdk/3.0.100-preview6-012264/Roslyn/bincore/runtimes/win-x64/native/Microsoft.DiaSymReader.Native.amd64.dll
./sdk/3.0.100-preview6-012264/Roslyn/bincore/runtimes/win/native/Microsoft.DiaSymReader.Native.amd64.dll

I tried copying the windows sdk dll to the linux sdk, but I still get the same stacktrace.

mikem8361 commented 5 years ago

I think this is probably something in the dump that it can’t handle. Can you send me the core dump?

FYI, dotnet-dump should not be loading Microsoft.DiaSymReader.Native.amd64.dll on Linux. It is Windows only for Windows PDBs.

tmds commented 5 years ago

Can you send me the core dump?

dump.tar.gz

This is how I create the coredump:

        static void Main(string[] args)
        {
            throw new Exception("Throwing exception to abort");
        }

executed with dotnet 3.0.100-preview6-012264 on Fedora 30. Then get the coredump file:

$ coredumpctl dump -1 -o /tmp/dump
tmds commented 5 years ago

@mikem8361 are you able to reproduce the issue?

mikem8361 commented 5 years ago

Yes, I can repro the exception with your dump. I haven't had a chance to really debug it yet.

tmds commented 5 years ago

It seems to throw when we get the BuildId from the ElfFile.

Unhandled Exception: System.IO.IOException: I/O error occurred.
   at Microsoft.Diagnostics.Runtime.Linux.Reader.Read[T](Int64 position)
   at Microsoft.Diagnostics.Runtime.Linux.ElfFile.LoadNotes()
   at Microsoft.Diagnostics.Runtime.Linux.ElfFile.get_BuildId(

Taking some bits from clrmd master, and trying to repro as follows:

            var stream = File.Open("/tmp/dump", FileMode.Open, FileAccess.Read, FileShare.Read);
            var reader = new Reader(new StreamAddressSpace(stream));
            var elfFile = new ElfFile(reader);
            System.Console.WriteLine(elfFile.BuildId);

This is not throwing, elfFile.BuildId returns null.

Looking into clrmd changes, maybe this is fixed by https://github.com/microsoft/clrmd/commit/be718af9496e65b9e610f99409657de796281a18.

Is there some daily build I could use to see if the issue is fixed?

mikem8361 commented 5 years ago

Yes, I have this fixed. I need to get into the clrmd repo (Microsoft.Diagnostics.Runtime) that dotnet-dump depends on in the diagnostics repo. It will be fixed by the Preview 7 release of the diagnostics tools.

mikem8361 commented 5 years ago

The above clrmd change isn't enough. Some modules don't have a build id and so the IOException needs to be catch.

mikem8361 commented 5 years ago

Fixed with this PR. It updated the version of Microsoft.Diagnostics.Runtime with the fix.

tmds commented 5 years ago

@mikem8361 is there a daily nuget feed I can use to try this?

mikem8361 commented 5 years ago

This is a preview 7 (not the final one) build: 3.0.0-preview7.19359.1

$ dotnet tool install -g dotnet-dump --version 3.0.0-preview7.19359.1 --add-source https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json