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

No Line number on Android .NET 9 on `UnhandledExceptionRaiser`

Open bruno-garcia opened this issue 10 months ago • 1 comments

EDIT:

Just realized that the frame below has line and sources! Not sure why the top frame doesn't. It makes it so that no source is visible by default (only the top frame expands to show sources by default).

So this is very low priority since the app itself has sources and line.

Might be related to one being an Android library: https://github.com/getsentry/symbol-collector/tree/main/src ?

Image


Original report:

Symbols uploaded, SDK version 5.9.0

Image

Exception captured by:

https://github.com/getsentry/sentry-dotnet/blob/0e11682db1da08cf4052525e528328197bc26354/src/Sentry/Platforms/Android/SentrySdk.cs#L203

Event screenshots

Image

Image

Image

Image

JSON

{
  "event_id": "98fcb18d4fc74723b7bdbebade653f7c",
  "project": 5953206,
  "release": "[email protected]+1",
  "dist": "1",
  "platform": "csharp",
  "message": "",
  "datetime": "2025-06-01T16:10:20+00:00",
  "tags": [
    [
      "device",
      "Pixel 7"
    ],
    [
      "device.family",
      "Pixel"
    ],
    [
      "environment",
      "production"
    ],
    [
      "handled",
      "no"
    ],
    [
      "level",
      "error"
    ],
    [
      "mechanism",
      "UnhandledExceptionRaiser"
    ],
    [
      "os",
      "Android 13"
    ],
    [
      "os.name",
      "Android"
    ],
    [
      "os.rooted",
      "no"
    ],
    [
      "runtime",
      ".NET 9.0.4"
    ],
    [
      "runtime.name",
      ".NET"
    ],
    [
      "dist",
      "1"
    ],
    [
      "release",
      "[email protected]+1"
    ],
    [
      "user",
      "id:bbcef7e8-78ac-4c7f-9e6c-6faa6212e599"
    ],
    [
      "server_name",
      "localhost"
    ]
  ],
  "_dsc": {
    "environment": "production",
    "public_key": "656e2e78d37d4511a4ea2cb3602e7a65",
    "release": "[email protected]+1",
    "replay_id": null,
    "trace_id": "4c3cef15308a413ab07303b1e0782f84",
    "transaction": null
  },
  "_metrics": {
    "bytes.ingested.event": 8031,
    "bytes.ingested.event.attachment": 13498,
    "bytes.stored.event": 20433,
    "bytes.stored.event.attachment": 13498
  },
  "contexts": {
    "Current Culture": {
      "calendar": "GregorianCalendar",
      "display_name": "English (United Kingdom)",
      "name": "en-GB",
      "type": "Current Culture"
    },
    "Dynamic Code": {
      "Compiled": true,
      "Supported": true,
      "type": "Dynamic Code"
    },
    "Memory Info": {
      "compacted": false,
      "concurrent": false,
      "finalization_pending_count": 0,
      "high_memory_load_threshold_bytes": 222518476,
      "pause_durations": [0, 0],
      "total_available_memory_bytes": 247242752,
      "type": "Memory Info"
    },
    "ThreadPool Info": {
      "available_completion_port_threads": 1000,
      "available_worker_threads": 32767,
      "max_completion_port_threads": 1000,
      "max_worker_threads": 32767,
      "min_completion_port_threads": 1,
      "min_worker_threads": 8,
      "type": "ThreadPool Info"
    },
    "app": {
      "app_start_time": "2025-06-01T16:10:20.1491472+00:00",
      "type": "app"
    },
    "device": {
      "name": "Pixel 7",
      "family": "Pixel",
      "model": "Pixel 7",
      "model_id": "TQ3A.230705.001",
      "arch": "arm64-v8a",
      "battery_level": 100,
      "orientation": "portrait",
      "manufacturer": "Google",
      "brand": "google",
      "screen_resolution": "1080x2201",
      "screen_density": 2.625,
      "screen_dpi": 420,
      "charging": true,
      "low_memory": false,
      "simulator": false,
      "memory_size": 7786541056,
      "free_memory": 3126915072,
      "storage_size": 118015217664,
      "free_storage": 96858828800,
      "boot_time": "2025-06-01T15:04:21.6089064+00:00",
      "timezone": "America/New_York",
      "device_unique_identifier": "ff378224711f4c2bb86103dde153a6e0",
      "timezone_display_name": "(UTC-05:00) Eastern Time (New York)",
      "type": "device"
    },
    "os": {
      "os": "Android 13",
      "name": "Android",
      "version": "13",
      "build": "TQ3A.230705.001",
      "kernel_version": "5.10.157-android13-4-00001-g914e947b041d-ab10144456",
      "rooted": false,
      "raw_description": "Linux 5.10.157-android13-4-00001-g914e947b041d-ab10144456 #1 SMP PREEMPT Tue May 16 08:47:42 UTC 2023",
      "type": "os"
    },
    "runtime": {
      "runtime": ".NET 9.0.4",
      "name": ".NET",
      "version": "9.0.4",
      "raw_description": ".NET 9.0.4",
      "identifier": "android-arm64",
      "type": "runtime"
    },
    "trace": {
      "trace_id": "4c3cef15308a413ab07303b1e0782f84",
      "span_id": "7dd3e778022ea5c3",
      "status": "unknown",
      "origin": "manual",
      "type": "trace"
    }
  },
  "culprit": "MainActivity.cs in void MainActivity.OnCreate(Bundle savedInstanceState)",
  "debug_meta": {
    "images": [
      {
        "code_id": "cbcf6d39c000",
        "code_file": "SymbolCollector.Android.dll",
        "debug_id": "c5e71e56-ca0c-4747-9c11-e2cd35b7c4e2-fbb52e33",
        "debug_file": "/Users/bruno/git/symbol-collector/src/SymbolCollector.Android/obj/Release/net9.0-android/SymbolCollector.Android.pdb",
        "debug_checksum": "SHA256:561ee7c50cca47175c11e2cd35b7c4e2332eb57b67bf61c0651fd796aa1127d5",
        "image_addr": "0x0",
        "candidates": [
          {
            "download": {
              "status": "notfound"
            },
            "source": "sentry:android",
            "source_name": "Android"
          },
          {
            "download": {
              "status": "notfound"
            },
            "source": "sentry:ios",
            "source_name": "Apple"
          },
          {
            "download": {
              "status": "notfound"
            },
            "source": "sentry:microsoft",
            "source_name": "Microsoft"
          },
          {
            "download": {
              "status": "notfound"
            },
            "source": "sentry:nuget",
            "source_name": "NuGet.org"
          },
          {
            "debug": {
              "status": "ok"
            },
            "download": {
              "features": {
                "has_debug_info": true,
                "has_sources": true,
                "has_symbols": false,
                "has_unwind_info": false
              },
              "status": "ok"
            },
            "location": "sentry://project_debug_file/869461244",
            "source": "sentry:project",
            "source_name": "Sentry"
          }
        ],
        "debug_status": "found",
        "features": {
          "has_debug_info": true,
          "has_sources": true,
          "has_symbols": false,
          "has_unwind_info": false
        },
        "type": "pe_dotnet"
      }
    ]
  },
  "environment": "production",
  "exception": {
    "values": [
      {
        "type": "System.ArgumentOutOfRangeException",
        "value": "cannot be empty Arg_ParamName_Name, traceId",
        "module": "System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e",
        "stacktrace": {
          "frames": [
            {
              "function": "void JNINativeWrapper.Wrap_JniMarshal_PPL_V(_JniMarshal_PPL_V callback, IntPtr jnienv, IntPtr klazz, IntPtr p0)",
              "package": "Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065",
              "in_app": false,
              "data": {
                "client_in_app": false,
                "symbolicator_status": "missing_symbol"
              },
              "instruction_addr": "0x5"
            },
            {
              "function": "void Activity.n_OnCreate_Landroid_os_Bundle_(IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState)",
              "package": "Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065",
              "in_app": false,
              "data": {
                "client_in_app": false,
                "symbolicator_status": "missing_symbol"
              },
              "instruction_addr": "0xf"
            },
            {
              "function": "void MainActivity.OnCreate(Bundle savedInstanceState)",
              "package": "SymbolCollector.Android, Version=1.23.0.0, Culture=neutral, PublicKeyToken=null",
              "filename": "MainActivity.cs",
              "abs_path": "/Users/bruno/git/symbol-collector/src/SymbolCollector.Android/MainActivity.cs",
              "lineno": 33,
              "pre_context": [
                "        Microsoft.Maui.ApplicationModel.ActivityStateManager.Default.Init(this, savedInstanceState);",
                "",
                "#pragma warning disable 618",
                "        _friendlyName = $\"Android:{Build.Manufacturer}-{Build.CpuAbi}-{Build.Model}\";",
                "#pragma warning restore 618"
              ],
              "context_line": "        _host = Host.Init(this, \"https://[email protected]/5953206\",",
              "post_context": [
                "            Intent?.GetStringExtra(\"sentryTrace\"));",
                "        _serviceProvider = _host.Services;",
                "",
                "        // It's set in Host.Init above",
                "        SentrySdk.ConfigureScope(s =\u003E _startupTransaction = s.Transaction!);"
              ],
              "in_app": true,
              "data": {
                "client_in_app": true,
                "symbolicator_status": "symbolicated"
              },
              "instruction_addr": "0x89",
              "addr_mode": "rel:0",
              "function_id": "0x11"
            },
            {
              "function": "IHost Host.Init(Context context, string dsn, string sentryTrace)",
              "package": "SymbolCollector.Android.Library, Version=1.23.0.0, Culture=neutral, PublicKeyToken=null",
              "in_app": true,
              "data": {
                "client_in_app": true,
                "symbolicator_status": "missing_symbol"
              },
              "instruction_addr": "0x3b"
            },
            {
              "function": "ITransactionTracer SentrySdk.StartTransaction(string, string, SentryTraceHeader)",
              "package": "Sentry, Version=5.9.0.0, Culture=neutral, PublicKeyToken=fba2ec45388e2af0",
              "in_app": false,
              "data": {
                "client_in_app": false,
                "symbolicator_status": "missing_symbol"
              },
              "instruction_addr": "0x0"
            },
            {
              "function": "ITransactionTracer HubExtensions.StartTransaction(IHub, ITransactionContext) x 2",
              "package": "Sentry, Version=5.9.0.0, Culture=neutral, PublicKeyToken=fba2ec45388e2af0",
              "in_app": false,
              "data": {
                "client_in_app": false,
                "symbolicator_status": "missing_symbol"
              },
              "instruction_addr": "0x7"
            },
            {
              "function": "ITransactionTracer Hub.StartTransaction(ITransactionContext, IReadOnlyDictionary\u003Cstring, object\u003E, DynamicSamplingContext) x 2",
              "package": "Sentry, Version=5.9.0.0, Culture=neutral, PublicKeyToken=fba2ec45388e2af0",
              "in_app": false,
              "data": {
                "client_in_app": false,
                "symbolicator_status": "missing_symbol"
              },
              "instruction_addr": "0x1d1"
            },
            {
              "function": "DynamicSamplingContext DynamicSamplingContextExtensions.CreateDynamicSamplingContext(TransactionTracer, SentryOptions, IReplaySession)",
              "package": "Sentry, Version=5.9.0.0, Culture=neutral, PublicKeyToken=fba2ec45388e2af0",
              "in_app": false,
              "data": {
                "client_in_app": false,
                "symbolicator_status": "missing_symbol"
              },
              "instruction_addr": "0x0"
            },
            {
              "function": "DynamicSamplingContext DynamicSamplingContext.CreateFromTransaction(TransactionTracer, SentryOptions, IReplaySession)",
              "package": "Sentry, Version=5.9.0.0, Culture=neutral, PublicKeyToken=fba2ec45388e2af0",
              "in_app": false,
              "data": {
                "client_in_app": false,
                "symbolicator_status": "missing_symbol"
              },
              "instruction_addr": "0x6a"
            },
            {
              "function": "new DynamicSamplingContext(SentryId, string, bool?, double?, double?, string, string, string, IReplaySession)",
              "package": "Sentry, Version=5.9.0.0, Culture=neutral, PublicKeyToken=fba2ec45388e2af0",
              "in_app": false,
              "data": {
                "client_in_app": false,
                "symbolicator_status": "missing_symbol"
              },
              "instruction_addr": "0x13"
            }
          ]
        },
        "raw_stacktrace": {
          "frames": [
            {
              "function": "void JNINativeWrapper.Wrap_JniMarshal_PPL_V(_JniMarshal_PPL_V callback, IntPtr jnienv, IntPtr klazz, IntPtr p0)",
              "package": "Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065",
              "in_app": false,
              "data": {
                "client_in_app": false
              },
              "instruction_addr": "0x5"
            },
            {
              "function": "void Activity.n_OnCreate_Landroid_os_Bundle_(IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState)",
              "package": "Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065",
              "in_app": false,
              "data": {
                "client_in_app": false
              },
              "instruction_addr": "0xf"
            },
            {
              "function": "void MainActivity.OnCreate(Bundle savedInstanceState)",
              "package": "SymbolCollector.Android, Version=1.23.0.0, Culture=neutral, PublicKeyToken=null",
              "in_app": true,
              "data": {
                "client_in_app": true
              },
              "instruction_addr": "0x89",
              "addr_mode": "rel:0",
              "function_id": "0x11"
            },
            {
              "function": "IHost Host.Init(Context context, string dsn, string sentryTrace)",
              "package": "SymbolCollector.Android.Library, Version=1.23.0.0, Culture=neutral, PublicKeyToken=null",
              "in_app": true,
              "data": {
                "client_in_app": true
              },
              "instruction_addr": "0x3b"
            },
            {
              "function": "ITransactionTracer SentrySdk.StartTransaction(string, string, SentryTraceHeader)",
              "package": "Sentry, Version=5.9.0.0, Culture=neutral, PublicKeyToken=fba2ec45388e2af0",
              "in_app": false,
              "data": {
                "client_in_app": false
              },
              "instruction_addr": "0x0"
            },
            {
              "function": "ITransactionTracer HubExtensions.StartTransaction(IHub, ITransactionContext) x 2",
              "package": "Sentry, Version=5.9.0.0, Culture=neutral, PublicKeyToken=fba2ec45388e2af0",
              "in_app": false,
              "data": {
                "client_in_app": false
              },
              "instruction_addr": "0x7"
            },
            {
              "function": "ITransactionTracer Hub.StartTransaction(ITransactionContext, IReadOnlyDictionary\u003Cstring, object\u003E, DynamicSamplingContext) x 2",
              "package": "Sentry, Version=5.9.0.0, Culture=neutral, PublicKeyToken=fba2ec45388e2af0",
              "in_app": false,
              "data": {
                "client_in_app": false
              },
              "instruction_addr": "0x1d1"
            },
            {
              "function": "DynamicSamplingContext DynamicSamplingContextExtensions.CreateDynamicSamplingContext(TransactionTracer, SentryOptions, IReplaySession)",
              "package": "Sentry, Version=5.9.0.0, Culture=neutral, PublicKeyToken=fba2ec45388e2af0",
              "in_app": false,
              "data": {
                "client_in_app": false
              },
              "instruction_addr": "0x0"
            },
            {
              "function": "DynamicSamplingContext DynamicSamplingContext.CreateFromTransaction(TransactionTracer, SentryOptions, IReplaySession)",
              "package": "Sentry, Version=5.9.0.0, Culture=neutral, PublicKeyToken=fba2ec45388e2af0",
              "in_app": false,
              "data": {
                "client_in_app": false
              },
              "instruction_addr": "0x6a"
            },
            {
              "function": "new DynamicSamplingContext(SentryId, string, bool?, double?, double?, string, string, string, IReplaySession)",
              "package": "Sentry, Version=5.9.0.0, Culture=neutral, PublicKeyToken=fba2ec45388e2af0",
              "in_app": false,
              "data": {
                "client_in_app": false
              },
              "instruction_addr": "0x13"
            }
          ]
        },
        "thread_id": 1,
        "mechanism": {
          "type": "UnhandledExceptionRaiser",
          "description": "This exception was caught by the Android global error handler. The application likely crashed as a result of this exception.",
          "handled": false,
          "data": {
            "HResult": "0x80131502"
          }
        }
      }
    ]
  },
  "fingerprint": [
    "{{ default }}"
  ],
  "grouping_config": {
    "enhancements": "KLUv_SAYwQAAkwKRs25ld3N0eWxlOjIwMjMtMDEtMTGQ#KLUv_SAYwQAAkwKRs25ld3N0eWxlOjIwMjMtMDEtMTGQ#KLUv_SAYwQAAkwKRs25ld3N0eWxlOjIwMjMtMDEtMTGQ",
    "id": "newstyle:2023-01-11"
  },
  "hashes": [
    "abe7be7d27b6f10de5aa9e52d3e3f765",
    "b1b315da3ca7f9567d7642ab30fc0c08"
  ],
  "ingest_path": [
    {
      "version": "25.5.1",
      "public_key": "XE7QiyuNlja9PZ7I9qJlwQotzecWrUIN91BAO7Q5R38"
    }
  ],
  "key_id": "1795050",
  "level": "error",
  "logger": "",
  "metadata": {
    "function": "IHost Host.Init(Context context, string dsn, string sentryTrace)",
    "in_app_frame_mix": "mixed",
    "type": "System.ArgumentOutOfRangeException",
    "value": "cannot be empty Arg_ParamName_Name, traceId"
  },
  "modules": {
    "Java.Interop": "9.0.0.0",
    "K4os.Compression.LZ4": "1.3.6.0",
    "Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.0.0",
    "Microsoft.Extensions.Hosting.Abstractions": "9.0.0.0",
    "Microsoft.Extensions.Http.Resilience": "9.0.0.0",
    "Microsoft.Maui.Essentials": "1.0.0.0",
    "Mono.Android": "0.0.0.0",
    "Mono.Android.Runtime": "0.0.0.0",
    "Polly.Core": "8.0.0.0",
    "Sentry": "5.9.0.0",
    "Sentry.Android.AssemblyReader": "5.9.0.0",
    "Sentry.Bindings.Android": "5.9.0.0",
    "SymbolCollector.Android": "1.23.0.0",
    "SymbolCollector.Android.Library": "1.23.0.0",
    "SymbolCollector.Core": "1.23.0.0",
    "System.Collections": "9.0.0.0",
    "System.Collections.Concurrent": "9.0.0.0",
    "System.Collections.Immutable": "9.0.0.0",
    "System.Collections.NonGeneric": "9.0.0.0",
    "System.ComponentModel": "9.0.0.0",
    "System.Console": "9.0.0.0",
    "System.Diagnostics.DiagnosticSource": "9.0.0.0",
    "System.IO.Compression": "9.0.0.0",
    "System.IO.Compression.Brotli": "9.0.0.0",
    "System.IO.Compression.ZipFile": "9.0.0.0",
    "System.IO.MemoryMappedFiles": "9.0.0.0",
    "System.Linq": "9.0.0.0",
    "System.Linq.Expressions": "9.0.0.0",
    "System.Memory": "9.0.0.0",
    "System.Net.Http": "9.0.0.0",
    "System.Net.Primitives": "9.0.0.0",
    "System.Net.Requests": "9.0.0.0",
    "System.Net.WebProxy": "9.0.0.0",
    "System.Private.CoreLib": "9.0.0.0",
    "System.Private.Uri": "9.0.0.0",
    "System.Reflection.Metadata": "9.0.0.0",
    "System.Runtime": "9.0.0.0",
    "System.Runtime.CompilerServices.Unsafe": "9.0.0.0",
    "System.Runtime.InteropServices": "9.0.0.0",
    "System.Security.Cryptography": "9.0.0.0",
    "System.Text.Encoding.Extensions": "9.0.0.0",
    "System.Text.Encodings.Web": "9.0.0.0",
    "System.Text.Json": "9.0.0.0",
    "System.Text.RegularExpressions": "9.0.0.0",
    "Xamarin.AndroidX.Core": "1.0.0.0"
  },
  "nodestore_insert": 1748794223.10213,
  "received": 1748794221.26799,
  "sdk": {
    "name": "sentry.dotnet",
    "version": "5.9.0",
    "packages": [
      {
        "name": "nuget:sentry.dotnet",
        "version": "5.9.0"
      }
    ]
  },
  "timestamp": 1748794220.40045,
  "title": "System.ArgumentOutOfRangeException: cannot be empty Arg_ParamName_Name, traceId",
  "type": "error",
  "user": {
    "id": "bbcef7e8-78ac-4c7f-9e6c-6faa6212e599",
    "ip_address": "66.85.52.26",
    "username": "u0_a260",
    "sentry_user": "id:bbcef7e8-78ac-4c7f-9e6c-6faa6212e599",
    "geo": {
      "country_code": "US",
      "city": "Santa Clara",
      "subdivision": "California",
      "region": "United States"
    }
  },
  "version": "7",
  "location": null
}

bruno-garcia avatar Jun 01 '25 16:06 bruno-garcia

Also odd that it's not getting line numbers or source context for the Sentry SDK frames:

Image

I wonder if this exception type is created by some Mono binding thing and doesn't have the right IL metadata we need in order to make the stack trace in a way we can look up debug symbols and source bundles later

bruno-garcia avatar Jun 01 '25 17:06 bruno-garcia

Also odd that it's not getting line numbers or source context for the Sentry SDK frames:

That could be related to:

  • https://github.com/getsentry/sentry-dotnet/pull/4294

That was fixed in the 5.13.0 release (looks like you were running 5.9.0 when you ran into this issue).

jamescrosswell avatar Aug 19 '25 10:08 jamescrosswell

OK so it's been a while and it's prob fixed on a version newer than I had. let's close it. I'll reopen if I encounting this again

bruno-garcia avatar Sep 05 '25 02:09 bruno-garcia