iOS崩溃报告:atos无法按预期工作 [英] iOS crash reports: atos not working as expected
问题描述
我正在查看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查找对应的代码行时地址位置 0x0006573a 和 0x0004fb26 我的匹配完全不同。 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一起使用的地址,你不能只使用堆栈跟踪中的地址。
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
-
幻灯片
值是vmaddr的值
inLC_SEGMENT cmd
(大部分是0x1000
)。运行以下命令:
The
slide
value is the value ofvmaddr
inLC_SEGMENT cmd
(Mostly this is0x1000
). Run the following to get it:
otool -arch ARCHITECTURE -l "APP_BUNDLE/APP_EXECUTABLE" | grep -B 3 -A 8 -m 2 "__TEXT"
替换架构
使用崩溃报告显示的实际架构,例如 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.
堆栈地址
是崩溃报告中的十六进制值。
The stack address
is the hex value from the crash report.
加载地址
可以是显示在包含可执行文件的行的最前面的二进制映像
部分中的第一个地址。 (通常是第一个条目)。
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).
因为幻灯片的过去值
等于加载地址的值
这总是有效。但是,自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屋!