iOS 崩溃报告:atos 未按预期工作 [英] iOS crash reports: atos not working as expected

查看:29
本文介绍了iOS 崩溃报告:atos 未按预期工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看 Apple 提供的崩溃报告

I'm looking at a crash report provided by Apple

Hardware Model:      iPhone4,1
Version:         ??? (???)
Code Type:       ARM (Native)
Parent Process:  launchd [1]

Date/Time:       2012-11-18 16:03:44.951 -0600
OS Version:      iOS 6.0.1 (10A523)
Report Version:  104

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x51fe5264
Crashed Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libobjc.A.dylib                 0x352925b0 objc_msgSend + 16
1   MYAPP                           0x0006573a -[MyViewController(Images) didReceiveImage:context:etag:expires:] + 42
2   MYAPP                           0x0004fb26 -[MyImageTask didReceiveImage:] + 98
3   Foundation                      0x361ac8e8 __NSThreadPerformPerform
4   CoreFoundation                  0x3b37d680 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
5   CoreFoundation                  0x3b37cee4 __CFRunLoopDoSources0
6   CoreFoundation                  0x3b37bcb2 __CFRunLoopRun
7   CoreFoundation                  0x3b2eeeb8 CFRunLoopRunSpecific
8   CoreFoundation                  0x3b2eed44 CFRunLoopRunInMode
9   GraphicsServices                0x396bc2e6 GSEventRunModal
10  UIKit                           0x3452e2f4 UIApplicationMain
11  MYAPP                           0x0004934a main + 70
12  MYAPP                           0x000492fc start + 36

有趣的是,当我使用 atos 查找对应于地址位置 0x0006573a0x0004fb26 的代码行时,我得到了完全不同的匹配.atos 输出甚至不是来自崩溃日志中提到的同一个类(MyViewController、MyImageTask).相反,atos 指出我在一个完全不相关的类中完全良性的代码行.我再次确认我正在使用我提交给 Apple 的确切 dSYM 和 IPA.

The funny thing is when I use atos to lookup the line of code that corresponds to address locations 0x0006573a and 0x0004fb26 I get completely different match. The atos output is not even from the same class that's mentioned in the crash log (MyViewController, MyImageTask). Instead atos points me to totally benign lines of code in a completely unrelated class. I verified again that I'm working with the exact dSYM and IPA that I submitted to Apple.

我的atos命令

/Applications/Xcode.app/Contents/Developer/usr/bin/atos -arch armv7 -o MYAPP.app/MYAPP 0x0004fb26

与/usr/bin/atos 和 armv7s 的结果相同.

Same result with /usr/bin/atos and for armv7s.

有没有其他人遇到过这个问题?你能给些建议么?谢谢.

Has anyone else experienced this issue? Can you please advise? Thanks.

推荐答案

你必须计算要与 atos 一起使用的地址,你不能只使用 stacktrace 中的那个.

You have to calculate the address to use with atos, you can't just use the one in the stacktrace.

symbol address = slide + stack address - load address

  1. slide 值是 LC_SEGMENT cmdvmaddr 的值(主要是 0x1000).运行以下命令以获取它:

  1. The slide value is the value of vmaddr in LC_SEGMENT cmd (Mostly this is 0x1000). Run the following to get it:

otool -arch ARCHITECTURE -l "APP_BUNDLE/APP_EXECUTABLE" | grep -B 3 -A 8 -m 2 "__TEXT"

用崩溃报告显示的实际架构替换ARCHITECTURE,例如armv7.将 APP_BUNDLE/APP_EXECUTABLE 替换为实际可执行文件的路径.

Replace ARCHITECTURE with the actual architecture the crash report shows, e.g. armv7. Replace APP_BUNDLE/APP_EXECUTABLE with the path to the actual executable.

stack address 是崩溃报告中的十六进制值.

The stack address is the hex value from the crash report.

load address 可以是在包含可执行文件的行的最前面的 Binary Images 部分中显示的第一个地址.(通常是第一个条目).

The load address can be is the first address showing in the Binary Images section at the very front of the line which contains your executable. (Usually the first entry).

因为过去 slide 的值等于 load address 的值,所以这总是有效的.但是由于 Apple 从 iOS 4.3(不同版本)开始引入了地址空间布局随机化,为了安全起见,应用加载地址是随机的原因.

Since in the past value of the slide was equal to value of the load address this always worked. But since Apple introduced Address space layout randomization beginning with iOS 4.3 (in different variations), the apps loading address is randomized for security reasons.

这篇关于iOS 崩溃报告:atos 未按预期工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆