Skip to content

[XM][Legacy] mmp does not appear to run dsymutil on output to fully generate native symbols #14872

Closed

Description

@tipa

Steps to Reproduce

I started using the recently released AppCenter SDK for macOS to track crashes in my app.
One crash report I would want to symbolicate and the AppCenter website offers a button to upload debug symbols with these hints:

How to find the symbols

- Choose Window > Organizer in Xcode.
- Select the tab Archives.
- Select your app in the left sidebar.
- Right-click on the archive of the needed version and select Show in Finder.
- Right-click on the .xcarchive in Finder and select Show Package Contents.
- You should see a folder named dSYMs which contains your dSYM bundle.

Unfortunately, all my packages do not contain a dSYM folder. I researched and tried various stuff for hours (like using --package-debug-symbols=true) - without success. How can I generate debug symbols for my MacOS app?

Environment

Visual Studio Community 2022 for Mac Preview
Version 17.0 Preview (17.0 build 8754)
Installation UUID: 74feca92-64cf-497e-93e5-0e5202aaa7de

Runtime
.NET 6.0.3 (64-bit)
Architecture: Arm64

Roslyn (Language Service)
4.1.0-3.22075.3+592501cbb9c9394072a245c15b3458ff88155d85

NuGet
Version: 6.0.0.262

.NET SDK (Arm64)
SDK: /usr/local/share/dotnet/sdk/6.0.202/Sdks
SDK Versions:
	6.0.202
	6.0.201
	6.0.100-rc.1.21463.6
	5.0.402 (x64 – Unsupported)
	5.0.401 (x64 – Unsupported)
	5.0.400 (x64 – Unsupported)
	5.0.302 (x64 – Unsupported)
	5.0.301 (x64 – Unsupported)
	5.0.203 (x64 – Unsupported)
	5.0.202 (x64 – Unsupported)
	5.0.201 (x64 – Unsupported)
	3.1.414 (x64 – Unsupported)
	3.1.413 (x64 – Unsupported)
	3.1.412 (x64 – Unsupported)
	3.1.411 (x64 – Unsupported)
	3.1.410 (x64 – Unsupported)
	3.1.409 (x64 – Unsupported)
	3.1.408 (x64 – Unsupported)
	3.1.407 (x64 – Unsupported)
MSBuild SDKs: /usr/local/share/dotnet/sdk/6.0.202/Sdks

.NET SDK (x64)
SDK Versions:
	6.0.202
	6.0.201
	6.0.200
	5.0.407
	5.0.406
	5.0.405
	3.1.418
	3.1.417
	3.1.416

.NET Runtime (Arm64)
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	6.0.4
	6.0.3
	6.0.0-rc.1.21451.13
	5.0.11 (x64 – Unsupported)
	5.0.10 (x64 – Unsupported)
	5.0.9 (x64 – Unsupported)
	5.0.8 (x64 – Unsupported)
	5.0.7 (x64 – Unsupported)
	5.0.6 (x64 – Unsupported)
	5.0.5 (x64 – Unsupported)
	5.0.4 (x64 – Unsupported)
	3.1.20 (x64 – Unsupported)
	3.1.19 (x64 – Unsupported)
	3.1.18 (x64 – Unsupported)
	3.1.17 (x64 – Unsupported)
	3.1.16 (x64 – Unsupported)
	3.1.15 (x64 – Unsupported)
	3.1.14 (x64 – Unsupported)
	3.1.13 (x64 – Unsupported)

.NET Runtime (x64)
Runtime: /usr/local/share/dotnet/x64/dotnet
Runtime Versions:
	6.0.4
	6.0.3
	6.0.2
	5.0.16
	5.0.15
	5.0.14
	3.1.24
	3.1.23
	3.1.22

Xamarin.Profiler
'/Applications/Xamarin Profiler.app' not found

Updater
Version: 11

Apple Developer Tools
Xcode 13.3.1 (20103)
Build 13E500a

Xamarin.Mac
Version: 8.8.0.3 (Visual Studio Community)
Hash: eb7f8ed35
Branch: xcode13.3
Build date: 2022-03-30 03:16:09-0400

Xamarin.iOS
Version: 15.8.0.3 (Visual Studio Community)
Hash: eb7f8ed35
Branch: xcode13.3
Build date: 2022-03-30 03:16:09-0400

Xamarin Designer
Version: 17.1.5.88
Hash: 25a718e34
Branch: remotes/origin/d17-0-vsmac
Build date: 2022-04-22 14:55:54 UTC

Xamarin.Android
Not Installed

Microsoft Build of OpenJDK
Java SDK: Not Found

Eclipse Temurin JDK
Java SDK: Not Found

Android SDK Manager
Version: 17.2.0.32
Hash: 358904c
Branch: remotes/origin/d17-2
Build date: 2022-04-22 14:55:59 UTC

Android Device Manager
Version: 0.0.0.1110
Hash: 6cb643c
Branch: remotes/origin/d17-2
Build date: 2022-04-22 14:55:59 UTC

Build Information
Release ID: 1700008754
Git revision: b1c3df15b587d32846f3254e47d654dfb6d3627b
Build date: 2022-04-22 14:54:05+00
Build branch: release-17.0
Build lane: release-17.0

Operating System
Mac OS X 12.3.1
Darwin 21.4.0 Darwin Kernel Version 21.4.0
    Fri Mar 18 00:47:26 PDT 2022
    root:xnu-8020.101.4~15/RELEASE_ARM64_T8101 arm64

Activity

  1. chamons commented on May 4, 2022

    @chamons
    Contributor

    So package-debug-symbols deals with managed symbols, as noted in the help:

    % /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/bin/mmp --help | grep package-debug-symbols -C 2
          --package-debug-symbols[=VALUE]
                                 Specify whether debug info files (*.mdb / *.pdb)
                                   should be packaged in the app. Default is 'true'
    

    For a Xamarin.Mac application, by default there actually is very little that has "reasonable" dSYM's for us to give you, just the launcher. This is because we JIT (Just in Time) compile your assemblies at application launch, which is different that you may see say on iOS. These JIT'ed assemblies are only in memory, and thus don't have a dSYM.

    However, as documented here you can enable AOT (Ahead of Time) compilation where we compile your application down to mostly native code. This will increase your app bundle size, along with build time, but also speed up startup time and produce a dSYM that may improve stack trace reports.

    Given your description, I would try enabling AOT and see if that is the behavior you desire.

  2. added
    macOSIssues affecting macOS
    need-infoWaiting for more information before the bug can be investigated
    on May 4, 2022
  3. added this to the Future milestone on May 4, 2022
  4. tipa commented on May 4, 2022

    @tipa
    Author

    I have enabled AOT already, that's why I am confused that there's no dSYM available:

    Screen Shot 2022-05-04 at 11 20 54 PM

    This is how the crashes show up in AppCenter:

    Screen Shot 2022-05-04 at 11 21 55 PM
    Screen Shot 2022-05-04 at 11 22 36 PM
    Screen Shot 2022-05-04 at 11 23 15 PM

  5. ghost removed
    need-infoWaiting for more information before the bug can be investigated
    on May 4, 2022
  6. ghost added
    need-attentionAn issue requires our attention/response
    on May 4, 2022
  7. tipa commented on May 9, 2022

    @tipa
    Author

    @chamons do you need any additional info?
    The dsym folder is created for my iOS project, but never for my macOS project.
    Should I post my .csproj here as well?

  8. tipa commented on May 16, 2022

    @tipa
    Author

    Any additional information I could provide?

  9. chamons commented on May 16, 2022

    @chamons
    Contributor

    Apologies for the delay in response.

    Could you please attach a build log for your project, ideally a binary build log, so I can look into this further.

  10. tipa commented on May 16, 2022

    @tipa
    Author

    @chamons I have sent a build log via mail as it contains confidential information that I don't want to share publicly.
    I am not familiar how to create a binary build, but if it's required, I will try to figure it out and provide that as well.

  11. chamons commented on May 18, 2022

    @chamons
    Contributor

    @tipa - Could you please attach (or mail to me) @/Users/timopartl/GitHub/workinghours/WorkingHours.MacOS/obj/Release/response-file.rsp as the arguments to mmp are not listed in your log.

  12. tipa commented on May 19, 2022

    @tipa
    Author

    I've sent the file via mail.
    It doesn't contain any mention of "--xml=LinkDescription.xml" however, which I specified for the Release builds as additional mmp arguments.

  13. tipa commented on Jun 3, 2022

    @tipa
    Author

    Did the mail arrive? Do you need any additional details?

  14. 12 remaining items

  15. ghost removed
    need-infoWaiting for more information before the bug can be investigated
    on Jul 14, 2022
  16. ghost added
    need-attentionAn issue requires our attention/response
    on Jul 14, 2022
  17. chamons commented on Jul 15, 2022

    @chamons
    Contributor

    Let me do some digging, something seems wrong...

  18. changed the title [-][macOS] Cannot find/generate debug symbols[/-] [+][XM][Legacy] mmp does not appear to run dsymutil on output to fully generate native symbols[/+] on Jul 15, 2022
  19. chamons commented on Jul 15, 2022

    @chamons
    Contributor

    After doing some research on the code in mmp, it does not appear we are correctly calling dsymutil to process native symbols.

    If I'm reading the code correctly, we are correctly running it on AOT'ed code.

  20. chamons commented on Jul 18, 2022

    @chamons
    Contributor

    I started looking at fixing this, but it turned out to take too long for my side aside triage slot.

    Patch: https://gist.github.com/123458ee81c3b2f64d765b5f90e0746a

    What I figured out:

    • We aren't calling CreateDsym anywhere in mmp, unlike in iOS (Application.mtouch.cs), so we need to add a call
    • However, the argument order seems to be different, if I used the iOS version I get errors that appear fixed just be reordering
    • However, even with that we fail with the lipo from RunLipoAndCreateDsym (App, AppPath, compiledExecutables);.
    • I could be calling RunLipoAndCreateDsym incorrectly, or it could have never worked with macOS dsyms, since we never make them in non-AOT use cases fwict.
  21. added
    bugIf an issue is a bug or a pull request a bug fix
    and removed
    need-attentionAn issue requires our attention/response
    on Jul 18, 2022
  22. chamons commented on Jul 18, 2022

    @chamons
    Contributor

    I have confirmed this is legacy only, as a dotnet6 project with <ArchiveOnBuild>true</ArchiveOnBuild> set will call dsymutil as part of a publish step.

  23. added
    only-legacyIssue or pull request that only affects legacy xamarin (and not .NET)
    on Jul 18, 2022
  24. ankasani commented on Jan 3, 2023

    @ankasani

    Hi Team, Is there any solution for this? even i am facing the issue!

    we use xamarin.ios 15.4 then we can see native symbols are generating, with xcode 13.2.1
    we changed xamarin.ios 16.0 then symbols are not generating, with xcode 14.1

  25. rolfbjarne commented on Jan 9, 2023

    @rolfbjarne
    Member

    @ankasani this particular problem is limited to Xamarin.Mac, which means that if you have a problem when using Xamarin.iOS, then it's a different problem. Please file a new issue and we'll have a look: https://github.com/xamarin/xamarin-macios/issues/new

  26. tipa commented on Jan 26, 2023

    @tipa
    Author

    As I now migrated my apps to .NET7, this is no longer an issue for me. I hope for AOT compilation to be possible again soon, as dealing with crash reports got much more difficult with JIT-compiled apps (even with debug symbols)

  27. ghost locked as resolved and limited conversation to collaborators on Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIf an issue is a bug or a pull request a bug fixmacOSIssues affecting macOSonly-legacyIssue or pull request that only affects legacy xamarin (and not .NET)

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions