Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MetricKit MXCallStackTree symbolication

I am trying to implement MetricKit so later I could analyze MXCrashDiagnostic and MXHangDiagnostic reports. However when I am triggering a test crash, Here is an example of what I get for MXCrashDiagnostic:

ente  "timeStampEnd": "2021-06-07 15:59:00 +0000",
"crashDiagnostics": [
  {
    "version": "1.0.0",
    "callStackTree": {
      "callStacks": [
        {
          "threadAttributed": true,
          "callStackRootFrames": [
            {
              "binaryUUID": "DC2EACEA-3D9C-3409-96C2-2DF9C89AD19D",
              "offsetIntoBinaryTextSegment": 6917586944,
              "sampleCount": 1,
              "subFrames": [
                {
                  "binaryUUID": "DC2EACEA-3D9C-3409-96C2-2DF9C89AD19D",
                  "offsetIntoBinaryTextSegment": 6917586944,
                  "sampleCount": 1,
                  "subFrames": [
                    {
                      "binaryUUID": "DC2EACEA-3D9C-3409-96C2-2DF9C89AD19D",
                      "offsetIntoBinaryTextSegment": 6917586944,
                      "sampleCount": 1,
                      "subFrames": [
                        {
                          "binaryUUID": "35463E49-9534-3644-B993-2A73C287A143",
                          "offsetIntoBinaryTextSegment": 4329963520,
                          "sampleCount": 1,
                          "binaryName": "demo",
                          "address": 4333717704
                          }]

I tried to symbolicate the the data, by executing commands:

atos -arch arm64e -o /Users/xxx/Downloads/\!dsym-4/demo.app.dSYM/Contents/Resources/DWARF/demo 4333717704

But I can't find the crash stack and the result returned is4333717704

the DSYM file uuid isUUID: 35463E49-9534-3644-B993-2A73C287A143 (arm64) /Users/xxx/Downloads/!dsym-3/demo.app.dSYM/Contents/Resources/DWARF/demo

How should the stack returned by MetricKit be symbolicated?

like image 413
czm Avatar asked Oct 28 '25 01:10

czm


1 Answers

Ok, so I'm not at all surprised you're having issues. I think everyone that tries to symbolicate MetricKit data runs into problems.

The reason is the offsetIntoBinaryTextSegment field is incorrectly named. It's actually the binary load address! It took me forever to figure this out. I've filed a bug with Apple, and I suggest you do this same. (though I don't have high hopes, as this JSON structure is effectively an API)

What you want to do is:

atos -arch ARCH -i -l <offsetIntoBinaryTextSegment> /path/to/dsym <address>
like image 65
Mattie Avatar answered Oct 30 '25 16:10

Mattie