Skip to content

Mark mono/xamarin/dotnet system symbols as not inApp (iOS) #4194

Closed

Activity

  1. jamescrosswell commented on May 26, 2025

    @jamescrosswell
    Collaborator

    Tricky, the JSON for those frames doesn't include any Module information:

                {
                  "function": "mono_jit_exec",
                  "symbol": "mono_jit_exec",
                  "package": "/Users/jamescrosswell/Library/Developer/CoreSimulator/Devices/CFB78342-B78D-48E0-87A2-3B3A1311A8EE/data/Containers/Bundle/Application/0B1D5D54-E77B-4582-9033-B45046B4C46C/Sentry.Samples.Maui.app/libmonosgen-2.0.dylib",
                  "in_app": true,
                  "data": {
                    "orig_in_app": 0,
                    "client_in_app": false,
                    "symbolicator_status": "symbolicated"
                  },
                  "image_addr": "0x1158d8000",
                  "instruction_addr": "0x11593ea3c",
                  "symbol_addr": "0x11593e8d4"
                },

    The currently implementation of InAppExcludes only matches against either Module or Function and trying to identify all of the function names to match against isn't very practical.

    Ideally we could exclude based on the package name (e.g. libmonosgen bit in the example frame above).

  2. bruno-garcia commented on May 26, 2025

    @bruno-garcia
    MemberAuthor

    it's in package the json you shared

  3. jamescrosswell commented on May 26, 2025

    @jamescrosswell
    Collaborator

    it's in package the json you shared

    Yes I see that. That's why I added this to my comment:

    Ideally we could exclude based on the package name (e.g. libmonosgen bit in the example frame above).

    Do we want to do this though? These are our current Excludes:

    InAppExclude = new() {
    "System",
    "Mono",
    "Sentry",
    "Microsoft",
    "MS", // MS.Win32, MS.Internal, etc: Desktop apps
    "ABI.Microsoft", // MAUI
    "WinRT", // WinRT, UWP, WinUI
    "UIKit", // iOS / MacCatalyst
    "Newtonsoft.Json",
    "FSharp",
    "Serilog",
    "Giraffe",
    "NLog",
    "Npgsql",
    "RabbitMQ",
    "Hangfire",
    "IdentityServer4",
    "AWSSDK",
    "Polly",
    "Swashbuckle",
    "FluentValidation",
    "Autofac",
    "Stackexchange.Redis",
    "Dapper",
    "RestSharp",
    "SkiaSharp",
    "IdentityModel",
    "SqlitePclRaw",
    "Xamarin",
    "Android", // Ex: Android.Runtime.JNINativeWrapper...
    "Google",
    "MongoDB",
    "Remotion.Linq",
    "AutoMapper",
    "Nest",
    "Owin",
    "MediatR",
    "ICSharpCode",
    "Grpc",
    "ServiceStack"
    };

    I'm wary about any of those accidentally matching against package names when they were designed to match module names.

    We could probably do it if we were careful about how we designed the matcher. These are the two matchers we have for Module and Function:

    private static readonly Lazy<PrefixOrPatternMatcher> LazyModuleMatcher = new(() => new());
    private static readonly Lazy<DelimitedPrefixOrPatternMatcher> LazyFunctionMatcher = new(() => new());

    To match against packages, we'd need a regex that could unpack something like this "/some/path/libmonosgen-2.0.dylib"

  4. bruno-garcia commented on May 26, 2025

    @bruno-garcia
    MemberAuthor

    I'm wary about any of those accidentally matching against package names when they were designed to match module names.

    marking code as InApp takes priority so if users are explicitly marking something it should be fine. We can also write some during build with our msbuild plugin? Check everything that's being compiled in and mark all of those as InApp?

    To match against packages, we'd need a regex that could unpack something like this "/some/path/libmonosgen-2.0.dylib"

    We could do contains (libmono) or (monosgen)

  5. Flash0ver commented on Jun 3, 2025

    @Flash0ver
    Contributor

    We would like to add a dedicated "Package-Matcher" next to the existing "Module-" and "Function-Matchers".

    private static readonly Lazy<PrefixOrPatternMatcher> LazyModuleMatcher = new(() => new());
    private static readonly Lazy<DelimitedPrefixOrPatternMatcher> LazyFunctionMatcher = new(() => new());

    See also #4236 (comment)

  6. changed the title [-]Mark mono/xamarin/dotnet system symbols as not inApp[/-] [+]Mark mono/xamarin/dotnet system symbols as not inApp (iOS)[/+] on Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions