gpt4 book ai didi

ios - 符号化 iPhone KSCrash JSON 报告

转载 作者:塔克拉玛干 更新时间:2023-11-02 10:00:26 61 4
gpt4 key购买 nike

我从我的应用程序的用户那里收到了一些崩溃报告;然而,它们是 KSCrash 的 JSON 格式。我可以说出问题是什么,但我可以准确地找到问题所在!我能找到的所有象征崩溃报告的东西似乎都处理 Apple 风格的报告,而不是 KSCrash 的 JSON 格式。

Symbolicating iPhone App Crash Reports 好像不支持JSON格式。

我也尝试过 atos(即来自 Using atos to determine crashed method name with dSYM,但不确定我是否正确计算了地址。

请帮忙!

JSON 崩溃报告:

{
"binary_images": [
{
"cpu_subtype": 0,
"cpu_type": 16777228,
"image_addr": 4295196672,
"image_size": 524288,
"image_vmaddr": 4294967296,
"name": "/var/mobile/Containers/Bundle/Application/5CEB5AA5-797A-4656-8E41-E3898243DD2C/MYAPP.app/MYAPP",
"uuid": "C34AC6E9-4A70-3909-89E3-B7621BAC1855"
},
...
{
"cpu_subtype": 0,
"cpu_type": 16777228,
"image_addr": 6627819520,
"image_size": 151552,
"image_vmaddr": 6625312768,
"name": "/System/Library/PrivateFrameworks/CoreServicesInternal.framework/CoreServicesInternal",
"uuid": "69F0DA76-836A-3F05-BCF8-A561EC6C467A"
}
],
"crash": {
"diagnosis": "Application threw exception NSInvalidArgumentException: (null)\nOriginated at or in a subcall of _mh_execute_header",
"error": {
"address": 0,
"mach": {
"code": 0,
"exception": 10,
"exception_name": "EXC_CRASH",
"subcode": 0
},
"nsexception": {
"name": "NSInvalidArgumentException",
"referenced_object": {
"address": 5896109504,
"type": "unknown"
}
},
"reason": "-[NSKnownKeysDictionary1 floatValue]: unrecognized selector sent to instance 0x15f6f7dc0",
"signal": {
"code": 0,
"name": "SIGABRT",
"signal": 6
},
"type": "nsexception"
},
"threads": [
{
"backtrace": {
"contents": [
{
"instruction_addr": 6480478100,
"object_addr": 6479265792,
"object_name": "CoreFoundation",
"symbol_addr": 6480477976,
"symbol_name": "<redacted>"
},
{
"instruction_addr": 6826131244,
"object_addr": 6826098688,
"object_name": "libobjc.A.dylib",
"symbol_addr": 6826131188,
"symbol_name": "objc_exception_throw"
},
{
"instruction_addr": 6480506028,
"object_addr": 6479265792,
"object_name": "CoreFoundation",
"symbol_addr": 6480505816,
"symbol_name": "<redacted>"
},
{
"instruction_addr": 6480493644,
"object_addr": 6479265792,
"object_name": "CoreFoundation",
"symbol_addr": 6480492772,
"symbol_name": "<redacted>"
},
{
"instruction_addr": 6479458908,
"object_addr": 6479265792,
"object_name": "CoreFoundation",
"symbol_addr": 6479458816,
"symbol_name": "_CF_forwarding_prep_0"
},
{
"instruction_addr": 4295494968,
"object_addr": 4295196672,
"object_name": "MYAPP",
"symbol_addr": 4295196672,
"symbol_name": "_mh_execute_header"
},
{
"instruction_addr": 4295426364,
"object_addr": 4295196672,
"object_name": "MYAPP",
"symbol_addr": 4295196672,
"symbol_name": "_mh_execute_header"
},
{
"instruction_addr": 4295392188,
"object_addr": 4295196672,
"object_name": "MYAPP",
"symbol_addr": 4295196672,
"symbol_name": "_mh_execute_header"
},
{
"instruction_addr": 4295384932,
"object_addr": 4295196672,
"object_name": "MYAPP",
"symbol_addr": 4295196672,
"symbol_name": "_mh_execute_header"
},
{
"instruction_addr": 4295385280,
"object_addr": 4295196672,
"object_name": "MYAPP",
"symbol_addr": 4295196672,
"symbol_name": "_mh_execute_header"
},
{
"instruction_addr": 6570714364,
"object_addr": 6570655744,
"object_name": "UIKit",
"symbol_addr": 6570713740,
"symbol_name": "<redacted>"
},
{
"instruction_addr": 6562573572,
"object_addr": 6562512896,
"object_name": "QuartzCore",
"symbol_addr": 6562573424,
"symbol_name": "<redacted>"
},
{
"instruction_addr": 6562552096,
"object_addr": 6562512896,
"object_name": "QuartzCore",
"symbol_addr": 6562551804,
"symbol_name": "<redacted>"
},
{
"instruction_addr": 6562551776,
"object_addr": 6562512896,
"object_name": "QuartzCore",
"symbol_addr": 6562551744,
"symbol_name": "<redacted>"
},
{
"instruction_addr": 6562549376,
"object_addr": 6562512896,
"object_name": "QuartzCore",
"symbol_addr": 6562549124,
"symbol_name": "<redacted>"
},
{
"instruction_addr": 6562548692,
"object_addr": 6562512896,
"object_name": "QuartzCore",
"symbol_addr": 6562548176,
"symbol_name": "<redacted>"
},
{
"instruction_addr": 6562521932,
"object_addr": 6562512896,
"object_name": "QuartzCore",
"symbol_addr": 6562521852,
"symbol_name": "<redacted>"
},
{
"instruction_addr": 6480179012,
"object_addr": 6479265792,
"object_name": "CoreFoundation",
"symbol_addr": 6480178980,
"symbol_name": "<redacted>"
},
{
"instruction_addr": 6480170172,
"object_addr": 6479265792,
"object_name": "CoreFoundation",
"symbol_addr": 6480169800,
"symbol_name": "<redacted>"
},
{
"instruction_addr": 6480171244,
"object_addr": 6479265792,
"object_name": "CoreFoundation",
"symbol_addr": 6480170316,
"symbol_name": "<redacted>"
},
{
"instruction_addr": 6479304704,
"object_addr": 6479265792,
"object_name": "CoreFoundation",
"symbol_addr": 6479304320,
"symbol_name": "CFRunLoopRunSpecific"
},
{
"instruction_addr": 6664434032,
"object_addr": 6664388608,
"object_name": "GraphicsServices",
"symbol_addr": 6664433852,
"symbol_name": "GSEventRunModal"
},
{
"instruction_addr": 6571156968,
"object_addr": 6570655744,
"object_name": "UIKit",
"symbol_addr": 6571156764,
"symbol_name": "UIApplicationMain"
},
{
"instruction_addr": 4295322808,
"object_addr": 4295196672,
"object_name": "MYAPP",
"symbol_addr": 4295196672,
"symbol_name": "_mh_execute_header"
},
{
"instruction_addr": 6834759864,
"object_addr": 6834749440,
"object_name": "libdyld.dylib",
"symbol_addr": 6834759860,
"symbol_name": "<redacted>"
}
],
"skipped": 0
},
"crashed": true,
"current_thread": true,
"index": 0
},
{
"backtrace": {
"contents": [
{
"instruction_addr": 6835930524,
"object_addr": 6835814400,
"object_name": "libsystem_kernel.dylib",
"symbol_addr": 6835930516,
"symbol_name": "kevent_qos"
},
{
"instruction_addr": 6834634084,
"object_addr": 6834552832,
"object_name": "libdispatch.dylib",
"symbol_addr": 6834633852,
"symbol_name": "<redacted>"
},
{
"instruction_addr": 6834566092,
"object_addr": 6834552832,
"object_name": "libdispatch.dylib",
"symbol_addr": 6834566040,
"symbol_name": "<redacted>"
}
],
"skipped": 0
},
"crashed": false,
"current_thread": false,
"index": 1,
"registers": {
"basic": {
"cpsr": 0,
"fp": 6140552752,
"lr": 6834634084,
"pc": 6835930524,
"sp": 6140552608,
"x0": 3,
"x1": 6944956928,
"x10": 0,
"x11": 0,
"x12": 24,
"x13": 33554431,
"x14": 0,
"x15": 5895038864,
"x16": 374,
"x17": 0,
"x18": 0,
"x19": 6944821248,
"x2": 1,
"x20": 6944821248,
"x21": 6944821248,
"x22": 6944956800,
"x23": 6944960512,
"x24": 6944960512,
"x25": 0,
"x26": 6140555520,
"x27": 6140555520,
"x28": 0,
"x29": 6140552752,
"x3": 6140552616,
"x4": 1,
"x5": 0,
"x6": 0,
"x7": 0,
"x8": 6944956864,
"x9": 0
}
}
},
...
]
},
"process": {},
"report": {
"id": "93239236-359A-44AC-8AAA-9AB2ACCE30DA",
"process_name": "MYAPP",
"timestamp": "2015-07-17T23:35:51Z",
"type": "standard",
"version": {
"major": 3,
"minor": 0
}
},
"system": {
"CFBundleExecutable": "MYAPP",
"CFBundleExecutablePath": "/var/mobile/Containers/Bundle/Application/5CEB5AA5-797A-4656-8E41-E3898243DD2C/MYAPP.app/MYAPP",
"CFBundleIdentifier": "ca.mymojo.CJ-Stats",
"CFBundleName": "MYAPP",
"CFBundleShortVersionString": "1.1.2",
"CFBundleVersion": "1.1.2",
"app_start_time": "2015-07-17T23:35:47Z",
"app_uuid": "C34AC6E9-4A70-3909-89E3-B7621BAC1855",
"application_stats": {
"active_time_since_last_crash": 3.93054,
"active_time_since_launch": 3.93054,
"application_active": true,
"application_in_foreground": true,
"background_time_since_last_crash": 0,
"background_time_since_launch": 0,
"launches_since_last_crash": 1,
"sessions_since_last_crash": 1,
"sessions_since_launch": 1
},
"binary_cpu_subtype": 0,
"binary_cpu_type": 16777228,
"boot_time": "2015-07-17T12:07:09Z",
"cpu_arch": "arm64",
"cpu_subtype": 1,
"cpu_type": 16777228,
"device_app_hash": "58ebd0a220c47528a58b7d2426b69ce4b5491e14",
"jailbroken": false,
"kernel_version": "Darwin Kernel Version 15.0.0: Mon Jun 29 00:33:05 PDT 2015; root:xnu-3247.1.36.0.1~9/RELEASE_ARM64_T7000",
"machine": "iPhone7,2",
"memory": {
"free": 27996160,
"size": 1035993088,
"usable": 825868288
},
"model": "N61AP",
"os_version": "13A4293g",
"parent_process_id": 1,
"parent_process_name": "unknown",
"process_id": 4791,
"process_name": "MYAPP",
"system_name": "iPhone OS",
"system_version": "9.0",
"time_zone": "CDT"
},
"user": {}

最佳答案

终于明白了!

我需要使用 KSCrashReportFilterAppleFmt 将文件转换为 .crash 文件,然后我可以将其加载到 Xcode 中,Xcode 很乐意为我符号化它。我用来转换的代码在下面,如果其他人觉得这有用的话。

NSString *srcFilePath = @"crash-report.json";
NSString *destFilePath = @"crash-report.crash";

NSData *myJSON = [NSData dataWithContentsOfFile:srcFilePath];

NSError* localError = nil;

NSDictionary *parsedJSON = [NSJSONSerialization JSONObjectWithData:myJSON options:0 error:&localError];

if(localError != nil)
{
return ;
}

id filter = [KSCrashReportFilterAppleFmt filterWithReportStyle:KSAppleReportStyleSymbolicatedSideBySide];

NSArray *reports = @[parsedJSON];
[filter filterReports:reports
onCompletion:^(NSArray *filteredReports, BOOL completed, NSError *error) {
if(error != nil) {
return;
}

if(completed) {
NSString *contents = [filteredReports objectAtIndex:0];
[contents writeToFile:destFilePath
atomically:YES
encoding:NSStringEncodingConversionAllowLossy
error:nil];
}
}];

关于ios - 符号化 iPhone KSCrash JSON 报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31500561/

61 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com