我从我的应用程序的用户那里收到了一些崩溃报告;然而,它们是 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/
这里有一个很好的答案解释了如何在Ruby中下载文件而不将其加载到内存中:https://stackoverflow.com/a/29743394/4852737require'open-uri'download=open('http://example.com/image.png')IO.copy_stream(download,'~/image.png')我如何验证下载文件的IO.copy_stream调用是否真的成功——这意味着下载的文件与我打算下载的文件完全相同,而不是下载一半的损坏文件?documentation说IO.copy_stream返回它复制的字节数,但是当我还没有下
我正在尝试解析一个文本文件,该文件每行包含可变数量的单词和数字,如下所示:foo4.500bar3.001.33foobar如何读取由空格而不是换行符分隔的文件?有什么方法可以设置File("file.txt").foreach方法以使用空格而不是换行符作为分隔符? 最佳答案 接受的答案将slurp文件,这可能是大文本文件的问题。更好的解决方案是IO.foreach.它是惯用的,将按字符流式传输文件:File.foreach(filename,""){|string|putsstring}包含“thisisanexample”结果的
导读语言模型给我们的生产生活带来了极大便利,但同时不少人也利用他们从事作弊工作。如何规避这些难辨真伪的文字所产生的负面影响也成为一大难题。在3月9日智源Live第33期活动「DetectGPT:判断文本是否为机器生成的工具」中,主讲人Eric为我们讲解了DetectGPT工作背后的思路——一种基于概率曲率检测的用于检测模型生成文本的工具,它可以帮助我们更好地分辨文章的来源和可信度,对保护信息真实、防止欺诈等方面具有重要意义。本次报告主要围绕其功能,实现和效果等展开。(文末点击“阅读原文”,查看活动回放。)Ericmitchell斯坦福大学计算机系四年级博士生,由ChelseaFinn和Chri
1.错误信息:Errorresponsefromdaemon:Gethttps://registry-1.docker.io/v2/:net/http:requestcanceledwhilewaitingforconnection(Client.Timeoutexceededwhileawaitingheaders)或者:Errorresponsefromdaemon:Gethttps://registry-1.docker.io/v2/:net/http:TLShandshaketimeout2.报错原因:docker使用的镜像网址默认为国外,下载容易超时,需要修改成国内镜像地址(首先阿里
我正在尝试在Rails上安装ruby,到目前为止一切都已安装,但是当我尝试使用rakedb:create创建数据库时,我收到一个奇怪的错误:dyld:lazysymbolbindingfailed:Symbolnotfound:_mysql_get_client_infoReferencedfrom:/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundleExpectedin:flatnamespacedyld:Symbolnotfound:_mysql_get_client_infoReferencedf
这是针对我无法破坏的现有公共(public)API,但我确实希望对其进行扩展。目前,该方法采用字符串或符号或任何其他在作为第一个参数传递给send时有意义的内容我想添加发送字符串、符号等列表的功能。我可以只使用is_a吗?数组,但还有其他发送列表的方法,这不是很像ruby。我将调用列表中的map,所以第一个倾向是使用respond_to?:map。但是字符串也会响应:map,所以这行不通。 最佳答案 如何将它们全部视为数组?String的行为与仅包含String的Array相同:deffoo(obj,arg)[*arg].eac
啊,正则表达式有点困惑。我正在尝试删除字符串末尾所有可能的标点符号:ifstr[str.length-1]=='?'||str[str.length-1]=='.'||str[str.length-1]=='!'orstr[str.length-1]==','||str[str.length-1]==';'str.chomp!end我相信有更好的方法来做到这一点。有什么指点吗? 最佳答案 str.sub!(/[?.!,;]?$/,'')[?.!,;]-字符类。匹配这5个字符中的任何一个(注意,。在字符类中并不特殊)?-前一个字符或组
print"Enteryourpassword:"pass=STDIN.noecho(&:gets)puts"Yourpasswordis#{pass}!"输出:Enteryourpassword:input.rb:2:in`':undefinedmethod`noecho'for#>(NoMethodError) 最佳答案 一开始require'io/console'后来的Ruby1.9.3 关于ruby-为什么不能使用类IO的实例方法noecho?,我们在StackOverflow上
我正在尝试创建一个带有项目符号字符的Ruby1.9.3字符串。str="•"+"helloworld"但是,当我输入它时,我收到有关非ASCII字符的语法错误。我该怎么做? 最佳答案 你可以把Unicode字符放在那里。str="\u2022"+"helloworld" 关于ruby-如何在Ruby字符串中插入项目符号字符?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/1195
我想将“US”之类的国家代码转换为表情符号标志,即将“US”字符串转换为Ruby中适当的Unicode。Here'sanequivalentexampleforJava 最佳答案 使用tr将字母字符转换为其区域指示符号:'US'.tr('A-Z',"\u{1F1E6}-\u{1F1FF}")#=>"??"当然你也可以直接使用Unicode字符:'US'.tr('A-Z','?-?')#=>"??" 关于ruby-从Ruby中的国家代码获取表情符号标志,我们在StackOverflow上找