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

Capture data for Mono server side symbolication

Open bruno-garcia opened this issue 4 years ago • 2 comments

#578 added parsing of Mono stacktraces. Part of the data it reads can be used to symbolicate frames with pdbs. But until Sentry adds support to it, there's no where to add it to the event.

https://github.com/getsentry/sentry-dotnet/pull/578/files#diff-591366d18813202fbdb64620c836b9f60442259c02a5e44d20e71895eef0c513R56

Platform = "mono", // needs to be agreed with the backend
ModuleVersionId = f.Mvid,
AotId = f.Aotid,
MethodIndex = f.MethodIndex.ToString("x4"),
IsILOffset = f.IsILOffset,

https://github.com/getsentry/sentry-dotnet/pull/578/files#diff-001afbb90f9f04a40a0eb9edcce5ac4a00b22e5d94a4622244d7901bee4cafbbR147

Protocol needs:

/// Module Version Id.
/// </summary>
/// <remarks>Used by the Mono AOT compiler</remarks>
[DataMember(Name = "mvid", EmitDefaultValue = false)]
public string? ModuleVersionId { get; set; }

/// <summary>
/// AOT Id.
/// </summary>
/// <remarks>Used by the Mono AOT compiler</remarks>
[DataMember(Name = "aotid", EmitDefaultValue = false)]
public string? AotId { get; set; }

/// <summary>
/// Method Index.
/// </summary>
/// <remarks>Used by the Mono AOT compiler</remarks>
[DataMember(Name = "method_index", EmitDefaultValue = false)]
public string? MethodIndex { get; set; }

/// <summary>
/// Is IL offset.
/// </summary>
/// <remarks>Used by the Mono AOT compiler</remarks>
[DataMember(Name = "is_il_offset", EmitDefaultValue = false)]
public bool? IsILOffset { get; set; }

bruno-garcia avatar Nov 08 '20 01:11 bruno-garcia

@jan-auer this is what I was referring to in terms of protocol change.

bruno-garcia avatar Nov 28 '20 00:11 bruno-garcia

related to #1740

SimonCropp avatar Jun 30 '22 21:06 SimonCropp

@bruno-garcia - Was this for a different use case than we implemented recently (with #2050)?

The whole StackFrameData class appears to be unused, BTW.

mattjohnsonpint avatar Feb 16 '23 00:02 mattjohnsonpint

However, it is the only place we have an AotId - so I wonder if that's what we need to help resolve #2180...

mattjohnsonpint avatar Feb 16 '23 17:02 mattjohnsonpint

Ok, after diving in further, I'm pretty sure that we can delete StackFrameData as dead code. It was used as part of MonoSentryStackTraceFactory, which was deleted in #2050. Basically, it's just for parsing info from the exception.StackTrace string that mono added when running with -debug (not debug configuration, but the mono debugging flag). We don't need to do that any more, as we have the ppdb support. which gets most of the same data, directly from the symbol files.

It doesn't help with #2180, as there is no pre-made exception.StackTrace string to parse there.

mattjohnsonpint avatar Feb 17 '23 01:02 mattjohnsonpint

Closing this issue, as it was handled by #2050 and corresponding Symbolic changes.

mattjohnsonpint avatar Feb 17 '23 01:02 mattjohnsonpint