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?
offsetIntoBinaryTextSegmentfield instead ofaddress.MXCallStackTreeexplain the meaning of each field. It tells usoffsetIntoBinaryTextSegmentis the address of symbol.addressis the address of stack frame in memory.atosonly accepts Hex address.atos --helpwould tell you that two address arguments are needed.loadAddressafter-lis your Binary Image load address.addressis symbol offset(offsetIntoBinaryTextSegment) + loadAddress. See crash report symbolication. In MXCallStackTree, we do not know Binary Image load address like crash report. But it is not necessary.atosonly caresaddress - loadAddress == offsetIntoBinaryTextSegment. A trick in your situation isloadAddress=0x1andaddress=hex(offsetIntoBinaryTextSegment + 1). Therefore, the command line would be,0x102160000 = hex(4329963520):This discussion might help you too: https://developer.apple.com/forums/thread/681967