soygul / NBug

Automated bug reporting library for .NET
http://soygul.com/nbug
MIT License
191 stars 78 forks source link

Reading the dump in visual studio after beign created #84

Closed advapiIT closed 7 years ago

advapiIT commented 7 years ago

Hello, I was looking exacly for a project as your in order to detect and report unhandled exception , btw I've tried with a simple project and when I read the dump created I got some issues on the stack..

Consider a really simple exception as

private Task OnFireCommandExecute() { throw new Exception(); }

Now it's currecly catched and the report tells

-

-

-2146233088

Exception of type 'System.Exception' was thrown. NBugCatelIntegration at NBugCatelIntegration.ViewModels.MainWindowViewModel.OnFireCommandExecute() in C:\Users\user\Source\Repos\NBugCatelIntegration\NBugCatelIntegration\ViewModels\MainWindowViewModel.cs:line 18 at Catel.MVVM.TaskCommand`3.<>c__DisplayClass5_0.<.ctor>b__0(TExecuteParameter executeParameter, CancellationToken cancellationToken, IProgress`1 progress) in C:\CI_WS\Ws\97969\Source\Catel\src\Catel.MVVM\Catel.MVVM.Shared\MVVM\Commands\TaskCommand.cs:line 52 at Catel.MVVM.TaskCommand`3.d__30.MoveNext() in C:\CI_WS\Ws\97969\Source\Catel\src\Catel.MVVM\Catel.MVVM.Shared\MVVM\Commands\TaskCommand.cs:line 234 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.b__6_0(Object state) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) System.Threading.Tasks.Task OnFireCommandExecute() @ NBugCatelIntegration.ViewModels.MainWindowViewModel System.Exception

When I open the minidump created (also the full one), I got the following stack

main

Wasn't is suppose to be on the command method? Thank in advance

soygul commented 7 years ago

Call stack on the minidump extends beyond the point of exception, up to the point where the minidump is written. This is a side effect of writing minidump from inside the same application as the one producing the exception. Hence you will have to be careful when replaying the callstack in debugger. This is not a bug, but a known limitation of the implementation.

advapiIT commented 7 years ago

Excuse me , so what's the advantage of having a dump if it's not on the stack trace ? I won't have the last error and variables

soygul commented 7 years ago

Memory dump contains the heap, which is unchanged between the point of exception and point on memory dump so you can step back in the call stack. Locking the thread since this goes beyond a bug report.