sentry-dotnet icon indicating copy to clipboard operation
sentry-dotnet copied to clipboard

Incorrect stack traces for UWP in .NET Native

Open jamescrosswell opened this issue 10 months ago • 5 comments

Originally posted by @tipa in https://github.com/getsentry/sentry-dotnet/issues/3240#issuecomment-2063345520

Today I received another funny stack trace (it is the raw stack trace) - https://timopartl.sentry.io/issues/5216095235:


System.ArgumentException: Value does not fall within the expected range.
  Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw
  Module "System.Runtime.CompilerServices.TaskAwaiter", in GetResult
  Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw
  Module "System.Runtime.CompilerServices.TaskAwaiter", in GetResult
  Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw
  Module "System.Runtime.CompilerServices.TaskAwaiter", in GetResult
  Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw
  Module "System.Runtime.CompilerServices.TaskAwaiter", in GetResult
  Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw
  Module "System.Runtime.CompilerServices.TaskAwaiter", in GetResult

It's from a manually captured exception, but the crash report I was referring to in my last comment was from a crash (and also it was the raw stack trace), here's the link: https://timopartl.sentry.io/issues/5178256155

Here's another example project to reproduce the issue (run in Release mode). It logs the stack trace manually as breadcrumb, and this is what I see in the dashboard: Sentry_UWP.zip

stack trace: image

stack trace from breadcrumb:

at Sentry_UWP.SubPage.Toggle_Toggled(Object, RoutedEventArgs) + 0x8
   at Windows.Foundation.AsyncOperationProgressHandler`2.Invoke(IAsyncOperationWithProgress`2, TProgress) + 0x2e
   at __Interop.Intrinsics.HasThisCall__13[TArg0](Object, IntPtr, Object, TArg0) + 0x36
   at Sentry_UWP!<BaseAddress>+0x4d29d0
   at System.Runtime.InteropServices.McgMarshal.ThrowOnExternalCallFailed(Int32, RuntimeTypeHandle) + 0x21
   at __Interop.ComCallHelpers.Call(__ComObject, RuntimeTypeHandle, Int32, SByte) + 0xc0
   at __Interop.ForwardComStubs.Stub_29[TThis](__ComObject, Boolean, Int32) + 0x37
   at Sentry_UWP.SubPage.OnNavigatedTo(NavigationEventArgs) + 0x56
   at Windows.UI.Xaml.Controls.Page.global::Windows.UI.Xaml.Controls.IPageOverrides.OnNavigatedTo(NavigationEventArgs) + 0xa
   at Sentry_UWP!<BaseAddress>+0x4e498e

This is a very simple example so there's not a lot information missing, but I would at least expect to see the line Sentry_UWP.SubPage.OnNavigatedTo(NavigationEventArgs) . If you want me to, I can try to produce a crash that has a longer stack trace with more information missing. But I think even this small exmaple shows that there's something wrong.

jamescrosswell avatar Apr 18 '24 22:04 jamescrosswell