Skip to content

iOS apps not symbolicating in release mode #4427

@jamescrosswell

Description

@jamescrosswell

Description

Symbolication / source context for stack traces is missing in release mode on iOS.

This is due to a problem in the .NET SDK when building for Apple platforms in release mode. This issue has been reported to Microsoft and is being tracked in the .NET runtime repository.

If this issue affects your application, please:

  1. Visit the .NET runtime issue
  2. Add a reaction (👍) to indicate this affects you
  3. Consider adding a comment describing your use case

This will help Microsoft prioritise the fix based on community impact.

Workarounds

Until the issue is resolved properly, symbolication on Apple platforms is only possible by disabling stripping. For example, by adding the following to your *.csproj file(s):

<PropertyGroup>
  <EnableAssemblyILStripping>false</EnableAssemblyILStripping>
</PropertyGroup>

Important Note: This may significantly increase the size of your application.

Links

Further details (original issue report)

It looks like there's a mismatch in the Age field of the DebugID. For example, this is what is being uploaded to Sentry (portable PDB file):

sentry-cli debug-files check ./samples/Sentry.Samples.Maui/obj/Release/net9.0-ios18.0/iossimulator-arm64/Sentry.Samples.Maui.pdb
Debug Info File Check
  Type: portablepdb debug companion
  Contained debug identifiers:
    > Debug ID: 38b96763-ba6a-469d-08f6-03cdcd8e4657-c17c59f
      Arch:     unknown
  Contained debug information:
    > debug, sources
  Usable: yes

But in the event I'm seeing:

"debug_id":"38b96763-ba6a-469d-08f6-03cdcd8e4657-1","debug_file":"/Users/jamescrosswell/code/sentry-dotnet/samples/Sentry.Samples.Maui/obj/Release/net9.0-ios18.0/iossimulator-arm64/Sentry.Samples.Maui.pdb"

If I run sentry-cli debug-files find 38b96763-ba6a-469d-08f6-03cdcd8e4657-1, I see:

38b96763-ba6a-469d-08f6-03cdcd8e4657-1 /Users/jamescrosswell/code/sentry-dotnet/samples/Sentry.Samples.Maui/obj/Release/net9.0-ios18.0/iossimulator-arm64/stripped/Sentry.Samples.Maui.dll [pe]

So the PE header for the stripped assembly that is actually running on the device has an Age field of 1. However this is not a debug file (and can't be uploaded).

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .net codeBlockedBugSomething isn't working

    Projects

    Status

    No status

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions