getsentry / sentry-unity

Development of Sentry SDK for Unity
https://docs.sentry.io/platforms/unity/
MIT License
206 stars 51 forks source link

Crash reports on Mac player with Mono runtime do not include file path or line numbers #1763

Open wilg opened 1 month ago

wilg commented 1 month ago

Environment

How do you use Sentry? Sentry SaaS (sentry.io)

Which version of the SDK? sentry-unity 2.1.3

How did you install the package? (Git-URL, Assetstore) Git

Which version of Unity? 6000.0.14f1

Is this happening in Unity (editor) or on a player like Android, iOS, Windows? Player

Steps to Reproduce

Any crash.

Expected Result

Sentry shows file name and line numbers.

Actual Result

This is the full "Raw Stack Trace" that appears in Sentry.

Newest

  Module "UnityEngine.Logger", in Log
  Module "UnityEngine.Debug", in LogError
  Module "InteractableTrigger", in Trigger
  Module "NPC", in ShouldTriggerInteractable
  Module "InteractableTrigger", in OnTriggerExit

No file or line numbers appear in the symbolicated trace UI.

I am having a similar issue on Windows players (built on Windows), where file and line numbers do appear, but they use Windows-style paths and Sentry cannot associate the source code with them. https://github.com/getsentry/sentry-unity/issues/1764 Perhaps there is some connection between the two.

bitsandfoxes commented 3 weeks ago

That's odd for sure. Mono should work OOTB with whatever it is that Unity provides us. We'll have to check if that is something new with Unity 6.

wilg commented 2 weeks ago

Yeah, it's odd. As I said it does work on a Windows build built on a Windows machine, but not on a Mac build built on a Mac machine.

bitsandfoxes commented 2 weeks ago

I'm looking into this as part of #1775

bitsandfoxes commented 2 days ago

Interestingly enough the stacktraces differ out-of-the-box between an error captured in the Editor

NullReferenceException: Object reference not set to an instance of an object.
BugFarmButtons.ThrowNull () (at Assets/Scripts/BugFarmButtons.cs:23)
UnityEngine.Events.InvokableCall.Invoke () (at /Users/bokken/build/output/unity/unity/Runtime/Export/UnityEvent/UnityEvent.cs:178)
UnityEngine.Events.UnityEvent.Invoke () (at /Users/bokken/build/output/unity/unity/artifacts/generated/UnityEvent/UnityEvent_0.cs:57)
UnityEngine.UI.Button.Press () (at ./Library/PackageCache/com.unity.ugui/Runtime/UGUI/UI/Core/Button.cs:70)
UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at ./Library/PackageCache/com.unity.ugui/Runtime/UGUI/UI/Core/Button.cs:114)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at ./Library/PackageCache/com.unity.ugui/Runtime/UGUI/EventSystem/ExecuteEvents.cs:57)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at ./Library/PackageCache/com.unity.ugui/Runtime/UGUI/EventSystem/ExecuteEvents.cs:272)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
Sentry.Unity.Integrations.UnityLogHandlerIntegration:LogException(Exception, Object) (at /Users/bitfox/Workspace/sentry-unity/src/Sentry.Unity/Integrations/UnityLogHandlerIntegration.cs:63)
UnityEngine.EventSystems.EventSystem:Update() (at ./Library/PackageCache/com.unity.ugui/Runtime/UGUI/EventSystem/EventSystem.cs:530)

vs a Mono build

NullReferenceException: Object reference not set to an instance of an object.
  at BugFarmButtons.ThrowNull () [0x00000] in <f210a8a85f9d464080cea89ae1eaa6fd>:0 
  at UnityEngine.Events.InvokableCall.Invoke () [0x00010] in <c329f35d63d54ed6a65a0a1db8de060a>:0 
  at UnityEngine.Events.UnityEvent.Invoke () [0x00022] in <c329f35d63d54ed6a65a0a1db8de060a>:0 
  at UnityEngine.UI.Button.Press () [0x0001c] in <575219a1e432488989ef825f92d079fd>:0 
  at UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) [0x00009] in <575219a1e432488989ef825f92d079fd>:0 
  at UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00007] in <575219a1e432488989ef825f92d079fd>:0 
  at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) [0x00067] in <575219a1e432488989ef825f92d079fd>:0