Instruments arm64 app (i.e., Xcode Profile)

When I try to Profile my arm64 application the icon just bounces in the dock and the Record button in Instruments turns off. These are the messages I see in syslog:

Jul 7 16:19:42 omniamutantor com.apple.dt.instruments.dtarbiter[73606]: BUG in libdispatch: 20A5299w - 512 - 0x0
"com.apple.dt.instruments" = 34360131584;
"com.apple.dt.instruments" = 0;
"com.apple.dt.instruments" = 34360131584;
"com.apple.dt.instruments" = 0;
"com.apple.dt.instruments" = 34360131584;
"com.apple.dt.instruments" = 0;
Jul 7 16:39:44 omniamutantor Instruments[79734]: BUG in libdispatch: 20A5299w - 512 - 0x0
Jul 7 16:39:46 omniamutantor com.apple.dt.instruments.dtarbiter[79738]: BUG in libdispatch: 20A5299w - 512 - 0x0
Jul 7 16:40:13 omniamutantor com.apple.dt.instruments.dtsecurity[79742]: BUG in libdispatch: 20A5299w - 512 - 0x0
Jul 7 16:40:13 omniamutantor com.apple.dt.instruments.dtsecurity[79743]: BUG in libdispatch: 20A5299w - 512 - 0x0
Jul 7 17:12:55 omniamutantor com.apple.xpc.launchd[1]: Coalition Cache Hit: app<application.com.apple.dt.Instruments.34348.34556(501)> [10783]
Jul 7 17:12:55 omniamutantor Instruments[89397]: BUG in libdispatch: 20A5299w - 512 - 0x0
Jul 7 17:12:57 omniamutantor com.apple.dt.instruments.dtarbiter[89403]: BUG in libdispatch: 20A5299w - 512 - 0x0
Jul 7 17:13:05 omniamutantor com.apple.dt.instruments.dtsecurity[89405]: BUG in libdispatch: 20A5299w - 512 - 0x0

Anyone able to use Instruments on an arm64 app? Any special setup needed?

Accepted Reply

If you could provide a feedback report with a sudo sysdiagnose taken across the failure and include the ID here, that would be very helpful to triage further. As a potential workaround, you might be able to start profiling All Processes (for templates like Time Profiler) and then launch your application through Xcode. For single-process templates like Allocations, you might need to attach after the app is already launched, which would mean missing backtraces from before the attach point.

Replies

If you could provide a feedback report with a sudo sysdiagnose taken across the failure and include the ID here, that would be very helpful to triage further. As a potential workaround, you might be able to start profiling All Processes (for templates like Time Profiler) and then launch your application through Xcode. For single-process templates like Allocations, you might need to attach after the app is already launched, which would mean missing backtraces from before the attach point.
Hey,

This is certainly strange! A couple of questions:
  1. Are you able to launch the app using Xcode? If so, do you have any special launch environment set?

  2. Can you see if Instruments.app is outputting anything about the launch? You can do this by filtering for Instruments in Console.app, or by using the log command. E.g. log stream --process "Instruments"

sysdiagnose2020.07.0812-50-06-0400macOSADP3-2_20A5299w.tar.gz
FWIW I am trying to use "Allocations", "Leaks" and "Zombies" when Instruments fails. I am prompted for a password after clicking the record button, but the application icon just bounces. Using "Time Profile" does appear to work.
Can you confirm what architecture slices your binary has? You can do this by running:
$ lipo -info /path/to/your/binary
(The path here is to the binary inside Derived Data).

Also, I assume launching from Xcode works?
The release version logged in previous log stream output is a fat binary (-detailed_info):
Code Block
fat_magic 0xcafebabe
nfat_arch 2
architecture x86_64
cputype CPU_TYPE_X86_64
cpusubtype CPU_SUBTYPE_X86_64_ALL
offset 16384
size 15812624
align 2^14 (16384)
architecture arm64
cputype CPU_TYPE_ARM64
cpusubtype CPU_SUBTYPE_ARM64_ALL
offset 15843328
size 14291424
align 2^14 (16384)

And Running from Xcode (Debug) build works fine. Profiling from Xcode works if "Time Profile" is used; however, "Allocations", "Leaks" and "Zombies" all fail to successfully launch the application and attempts to launch the application and attach to it from Instruments also fail if one of the memory instruments is used.

Oh and FWIW I have also tried profiling the Debug build; however, it to fails with memory instruments.
Ah ok, so since Time Profiler works, this could be something more involved. Could you please file a feedback report with a sysdiagnose ($ sudo sysdiagnose) and post the number here. That should give us the information we need to dig into this further for you. Thanks!
already did that (sysdiagnose2020.07.0812-50-06-0400macOSADP3-2_20A5299w.tar.gz) per the first response from Developer Tools Engineer above.
Hi macvestor.nivek,

It doesn't seem that it's downloadable to us... Maybe it reached some size limit on the forums?
We can download the log stream output, but not the sysdiagnose.

Thanks for your help,

Kacper