Skip to content

Conversation

@bruno-garcia
Copy link
Member

While dogfooding Symbol Collector I came across a few issues. This patch attempts to fix one of them where clearly system frames were marked as InApp.

It seems that our logic in the SDK is not taking Package into account at all but we set it here:

Module = method.DeclaringType?.FullName ?? unknownRequiredField,
Package = method.DeclaringType?.Assembly.FullName

And it seems in some conditions, Module isn't set at all. For example on my test events:

From a .NET 9 CLI tool:

{
  "function": "void Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, string path, bool isDirError)",
  "package": "System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e",
  "filename": "Interop.IOErrors.cs",
  "abs_path": "/_/src/libraries/Common/src/Interop/Unix/Interop.IOErrors.cs",
  "lineno": 16,
  "pre_context": [
    "    private static void ThrowExceptionForIoErrno(ErrorInfo errorInfo, string? path, bool isDirError)",
    "    {",
    "        Debug.Assert(errorInfo.Error != Error.SUCCESS);",
    "        Debug.Assert(errorInfo.Error != Error.EINTR, \"EINTR errors should be handled by the native shim and never bubble up to managed code\");",
    ""
  ],
  "context_line": "        throw Interop.GetExceptionForIoErrno(errorInfo, path, isDirError);",
  "post_context": [
    "    }",
    "",
    "    internal static void CheckIo(Error error, string? path = null, bool isDirError = false)",
    "    {",
    "        if (error != Interop.Error.SUCCESS)"
  ],
  "in_app": true,
  "data": {
    "client_in_app": true,
    "symbolicator_status": "symbolicated"
  },
  "instruction_addr": "0x0",
  "addr_mode": "rel:0",
  "function_id": "0x2",
  "source_link": "https://raw.githubusercontent.com/dotnet/runtime/f57e6dc747158ab7ade4e62a75a6750d16b771e8/src/libraries/Common/src/Interop/Unix/Interop.IOErrors.cs"
}

Note "in_app": true when clearly this is not inApp (Package is System.)

And .NET 9 Android, but in this case seems like we didn't mark Java. as InApp

{
  "function": "void JniStaticMethods.InvokeVoidMethod(string, JniArgumentValue*)",
  "package": "Java.Interop, Version=9.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065",
  "in_app": true,
  "data": {
    "client_in_app": true,
    "symbolicator_status": "missing_symbol"
  },
  "instruction_addr": "0x14"
},

At first I thought we were overriding the default list, hence the test and refactoring. Let me know if you rather I undo that.

@bruno-garcia bruno-garcia marked this pull request as ready for review June 1, 2025 06:07
@bruno-garcia bruno-garcia enabled auto-merge (squash) June 1, 2025 15:51
@bruno-garcia bruno-garcia merged commit 9beef00 into main Jun 3, 2025
35 checks passed
@bruno-garcia bruno-garcia deleted the fix/inapp-frame-incorrect-pkg branch June 3, 2025 09:43
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

Successfully merging this pull request may close these issues.

4 participants