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

Application start instruction #112

Closed
konraddysput opened this issue Apr 22, 2018 · 13 comments
Closed

Application start instruction #112

konraddysput opened this issue Apr 22, 2018 · 13 comments

Comments

@konraddysput
Copy link

Hey,

I have few problems with your project :(

  1. To start I should run cmd files from building directory. I receive errors with .NET Core (path are missing wtf) (please check attachment)
    dockeroutput.txt

  2. I try to use your application on Windows with Visual Studio 2017 (.NET Core 2.0 and .NET Framework are available on my machine). When I open solution on Visual Studio I receive error popup with information "Project file is incomplete. Expected imports are missing".

  3. I saw that you have sample console application - SuperDump.DebugDiag. I pass parameters to console app (DumpFilePath, Overwrite (true)) and I receive multiple exceptions when trying to run code (null reference exception for example on:
    analyzer.RunAnalysisRules(progress, options.SymbolPath, options.ImagePath, options.ReportFile);

What is exactly ImagePath and could you pass example input to SuperDump.DebugDiag application?

Thanks for your help!

@discostu105
Copy link
Member

Hi. Ok, let's figure it out :).

  1. The error says "Unable to locate the .NET Core SDK. Check that it is installed and that the version specified in global.json (if any) matches the installed version": Do you have .NET Core SDK installed? If yes, the reason this does not work could be that there is a global.json file committed which specifies the exact SDK version. You might have a newer minor version (which might be fine), but global.json dictates it. Try to remove global.json, it will probably just take the right version. If that works for you let me know, maybe I should remove it from the repo.

  2. Not entirely sure about this one. Can you find out which of the projects is affected (and maybe which "imports" are concerned)?

  3. SuperDump.DebugDiag.exe is a commandline app, which let's you invoke debugdiag analysis and let it write the results into a .mht file. It works standalone (without SuperDumpService). DebugDiag 2.2 needs to be installed on the same host to make this work and the path must be correctly configured in https://github.com/Dynatrace/superdump/blob/master/build/conf/appsettings.json. You can see how SuperDumpService invokes this analysis in

    private async Task RunDebugDiagAnalysis(DumpMetainfo dumpInfo, DirectoryInfo workingDir, string dumpFilePath) {
    . How exactly are you trying to invoke it? Can you share your command line?

ImagePath: Honestly I don't know exactly. It's in the DebugDiag API, but SuperDump actually does not set it. I guess it can be a path, where the windows debugger could look for images (dlls) if it needs any.

Can you share the complete stacktrace of your exception?

@discostu105
Copy link
Member

By the way: What are you trying to achive? Do you just want to use SuperDump, or do you want to develop/compile it?

@konraddysput
Copy link
Author

konraddysput commented Apr 22, 2018

Hey.
Thanks for really fast answers.

  1. When I try to use "reload" function in Visual Studio I receive informations about invalid imports:

image

image

Here we have output from "Output" window in Visual Studio:

C:\Users\Konrad\Downloads\superdump-master\src\SuperDumpService\SuperDumpService.csproj : error  : Project file is incomplete. Expected imports are missing.

C:\Users\Konrad\Downloads\superdump-master\src\LibunwindWrapper\LibunwindWrapper.vcxproj : warning  : The build tools for Visual Studio 2010 (v100) cannot be found. To build using the Visual Studio 2017 (v141) build tools, either click the Project menu or right-click the solution, and then select "Retarget Solution". Install Visual Studio 2010 (v100) to build using the Visual Studio 2010 (v100) build tools.

C:\Users\Konrad\Downloads\superdump-master\src\LibunwindWrapper\LibunwindWrapper.vcxproj : warning  : Platform '[ARM, 0]' referenced in the project file 'LibunwindWrapper' cannot be found.

C:\Users\Konrad\Downloads\superdump-master\src\LibunwindWrapper\LibunwindWrapper.vcxproj : warning  : Platform '[x64, 0]' referenced in the project file 'LibunwindWrapper' cannot be found.

C:\Users\Konrad\Downloads\superdump-master\src\LibunwindWrapper\LibunwindWrapper.vcxproj : warning  : Platform '[x86, 0]' referenced in the project file 'LibunwindWrapper' cannot be found.

C:\Users\Konrad\Downloads\superdump-master\src\SuperDumpService\SuperDumpService.csproj : error  : Project file is incomplete. Expected imports are missing.

C:\Users\Konrad\Downloads\superdump-master\src\SuperDumpService\SuperDumpService.csproj : error  : Project file is incomplete. Expected imports are missing
  1. To run SuperDump.DebugDiag example I replace reading data from console with my custom code
	var options = new Options() {
				DumpFile = @"path to .dmp file",
				Overwrite = true
			};

I prepare my minidump by using dbghelp.dll.

  1. What I want to archive?
    I want to learn something more about mini dump files because I want to have better debugging experience with .NET Application. What I want to do right now is to get more information about current application state programatically. I read documentation from CRLMD but I want to see something in "practice".

@konraddysput
Copy link
Author

konraddysput commented Apr 22, 2018

Ok, I Solve 0 and 1. When I use .NET CLI I can restore and build app. After restore and build I can open project in Visual Studio (really weird behaviour)

Thanks for your help!

@discostu105
Copy link
Member

Oh, interesting. Thanks for letting me know. Did you have to delete global.json to make it work?

@konraddysput
Copy link
Author

Yes, I did it.

@discostu105
Copy link
Member

Concerning the options for SuperDump.DebugDiag: Did you not set ReportFile property? It's required and might be the source of the NRE.

But I'd generally suggest to just use the command line arguments:

SuperDump.DebugDiag.exe --dump "C:\mydump.dmp" --out "C:\report.mht" --overwrite true

@discostu105
Copy link
Member

discostu105 commented Apr 22, 2018

Concerning seeing CLRMD "in practice", I would much rather suggest to look at the SuperDump project itself (https://github.com/Dynatrace/superdump/tree/master/src/SuperDump). It's also a commandline app, which takes a dump as input and produces a json file as output. It's the only thing that uses CLRMD in the whole solution.

An interesting class is maybe https://github.com/Dynatrace/superdump/blob/master/src/SuperDump/Analyzers/ThreadAnalyzer.cs. It gathers all thread stacktraces (native and managed) with and combines them. It uses CLRMD as well as dbgeng.dll directly.

You can direclty run it like this:

SuperDump.exe C:\mydump.dmp C:\out.json

Make sure to use the right bitness of SuperDump.exe (it must match your dump). If unsure, this is what SuperDumpSelector would do: it checks the bitness and invokes the correct version of SuperDump.exe.

@konraddysput
Copy link
Author

Im new in open source in Github - should we continue this topic if I have more questions?
After first run and first minidump file upload I receive this callstack:
Can you share with me how you generate minidump files?

Error: System.Exception: SuperDumpSelector exited with error code 1

stdout:
C:\Users\Konrad\Downloads\superdump-master\data\dumps\dcf4673\exm7069
detected x86 dump, selecting 32-bit build of SuperDump ...
starting process. exe: 'C:\Users\Konrad\Downloads\superdump-master\src\SuperDumpSelector\SuperDumpx86\SuperDump.exe' "C:\Users\Konrad\Downloads\superdump-master\data\dumps\dcf4673\exm7069\e736d49a-a355-4d77-8084-5a1caf673eb2.dmp" "C:\Users\Konrad\Downloads\superdump-master\data\dumps\dcf4673\exm7069\superdump-result.json", workdir: 'C:\Users\Konrad\Downloads\superdump-master\src\SuperDumpSelector\SuperDumpx86'



stderr:
SuperDumpSelector failed: System.AggregateException: Wystąpił przynajmniej jeden błąd. ---> SuperDump.Common.ProcessRunnerException: An exception occurred while starting a process: exe: 'C:\Users\Konrad\Downloads\superdump-master\src\SuperDumpSelector\SuperDumpx86\SuperDump.exe' "C:\Users\Konrad\Downloads\superdump-master\data\dumps\dcf4673\exm7069\e736d49a-a355-4d77-8084-5a1caf673eb2.dmp" "C:\Users\Konrad\Downloads\superdump-master\data\dumps\dcf4673\exm7069\superdump-result.json", workdir: 'C:\Users\Konrad\Downloads\superdump-master\src\SuperDumpSelector\SuperDumpx86' ---> System.ComponentModel.Win32Exception: Nie można odnaleźć określonego pliku
   w System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   w System.Diagnostics.Process.Start()
   w SuperDump.Common.ProcessRunner.<Start>b__13_0()
   --- Koniec śladu stosu wyjątków wewnętrznych ---
   w SuperDump.Common.ProcessRunner.<Start>b__13_0()
   w System.Threading.Tasks.Task.InnerInvoke()
   w System.Threading.Tasks.Task.Execute()
--- Koniec śladu stosu z poprzedniej lokalizacji, w której wystąpił wyjątek ---
   w System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   w System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   w System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   w SuperDump.Common.ProcessRunner.<Start>d__13.MoveNext()
--- Koniec śladu stosu z poprzedniej lokalizacji, w której wystąpił wyjątek ---
   w System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   w System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   w System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   w SuperDump.Common.ProcessRunner.<Run>d__15.MoveNext()
--- Koniec śladu stosu z poprzedniej lokalizacji, w której wystąpił wyjątek ---
   w System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   w System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   w System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   w SuperDumpSelector.Program.<RunSuperDump>d__2.MoveNext() w C:\Users\Konrad\Downloads\superdump-master\src\SuperDumpSelector\Program.cs:wiersz 64
   --- Koniec śladu stosu wyjątków wewnętrznych ---
   w System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   w System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   w System.Threading.Tasks.Task.Wait()
   w SuperDumpSelector.Program.Main(String[] args) w C:\Users\Konrad\Downloads\superdump-master\src\SuperDumpSelector\Program.cs:wiersz 34
---> (Wyjątek wewnętrzny #0) SuperDump.Common.ProcessRunnerException: An exception occurred while starting a process: exe: 'C:\Users\Konrad\Downloads\superdump-master\src\SuperDumpSelector\SuperDumpx86\SuperDump.exe' "C:\Users\Konrad\Downloads\superdump-master\data\dumps\dcf4673\exm7069\e736d49a-a355-4d77-8084-5a1caf673eb2.dmp" "C:\Users\Konrad\Downloads\superdump-master\data\dumps\dcf4673\exm7069\superdump-result.json", workdir: 'C:\Users\Konrad\Downloads\superdump-master\src\SuperDumpSelector\SuperDumpx86' ---> System.ComponentModel.Win32Exception: Nie można odnaleźć określonego pliku
   w System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   w System.Diagnostics.Process.Start()
   w SuperDump.Common.ProcessRunner.<Start>b__13_0()
   --- Koniec śladu stosu wyjątków wewnętrznych ---
   w SuperDump.Common.ProcessRunner.<Start>b__13_0()
   w System.Threading.Tasks.Task.InnerInvoke()
   w System.Threading.Tasks.Task.Execute()
--- Koniec śladu stosu z poprzedniej lokalizacji, w której wystąpił wyjątek ---
   w System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   w System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   w System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   w SuperDump.Common.ProcessRunner.<Start>d__13.MoveNext()
--- Koniec śladu stosu z poprzedniej lokalizacji, w której wystąpił wyjątek ---
   w System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   w System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   w System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   w SuperDump.Common.ProcessRunner.<Run>d__15.MoveNext()
--- Koniec śladu stosu z poprzedniej lokalizacji, w której wystąpił wyjątek ---
   w System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   w System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   w System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   w SuperDumpSelector.Program.<RunSuperDump>d__2.MoveNext() w C:\Users\Konrad\Downloads\superdump-master\src\SuperDumpSelector\Program.cs:wiersz 64<---


   at SuperDumpService.Services.AnalysisService.<AnalyzeWindows>d__10.MoveNext() in C:\Users\Konrad\Downloads\superdump-master\src\SuperDumpService\Services\AnalysisService.cs:line 89
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SuperDumpService.Services.AnalysisService.<Analyze>d__9.MoveNext() in C:\Users\Konrad\Downloads\superdump-master\src\SuperDumpService\Services\AnalysisService.cs:line 48

@discostu105
Copy link
Member

It says it cannot find SuperDumpx86. You probably did build the solution for x64/AnyCpu, but you also need to build it for x86 to be able to analyze 32-bit dumps.

@konraddysput
Copy link
Author

Yes, I saw that but it didn't help
Here is my configuration.
image

@discostu105
Copy link
Member

discostu105 commented Apr 22, 2018

Maybe the relative paths are messed up.

SuperDumpSelector looks at these directories for "SuperDump.exe": https://github.com/Dynatrace/superdump/blob/master/src/SuperDumpSelector/App.config

Judging from your path ...src\SuperDumpSelector\SuperDumpx86\SuperDump.exe, it seems it did not take the "dev environment" settings.

Can you check if src\SuperDump\bin\x86\SuperDump.exe exists in your filesystem?

@konraddysput
Copy link
Author

Thanks for your help - everything is working correctly. Thanks a lot for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants