iPhone SDK 3.0和symbolicatecrash不一致? [英] iPhone SDK 3.0 and symbolicatecrash not getting along?

查看:224
本文介绍了iPhone SDK 3.0和symbolicatecrash不一致?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

* UPDATE *
我用Snow Leopard重新安装,干净的安装。彻底擦掉了我现有的Leopard安装。相同的问题仍然存在。



我尝试过数个符号克隆的版本来解决我的崩溃报告中的符号。从苹果提供的版本,到GitHub上发布的Alan的Quatermain版本,最后从 http://openradar.appspot.com/ 6438643



无论什么原因,我可以得到最好的结果是我自己的图书馆上的符号得到解决。通常来说,这是足够的数据来指出我的方向正确 - 其他时候不是。使用2.x我没有问题得到我的代码的符号+苹果提供的库从每个线程的堆栈跟踪。



很可能是一个问题,我的环境在这里我完全不怀疑苹果或艾伦所做的工作。是的我确定我已经被扔掉的dSYM是与产生崩溃报告相同的精确值。



虽然Foo是我,并从中获取符号美妙的是,我需要从堆栈中的其他功能中看到符号才能真正了解我的报告。



注意:对于在iPhone OS 2.2.1上运行应用程序的设备得到所有符号我没有问题。这是一个iPhone OS 3.0出现的问题。



此外,当在详细模式下运行symbolicatecrash时,这里有一些令我失望的事情:

   - 无匹配
不在Spotlight中搜索dsym,其中UUID为/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
##警告:找不到与/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation

版本匹配的任何未分解的二进制文件libobjc.A.dylib - [undef]
搜索[/Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.0(5A345)/Symbols/usr/lib/libobjc.A.dylib / Developer / Platforms / iPhoneOS。 platform / DeviceSupport / 2.0(5A347)/Symbols/usr/lib/libobjc.A.dylib /Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.0.1(5B108)/Symbols/usr/lib/libobjc.A.dylib /开发人员/平台/ iPhoneOS.platform / DeviceSupport / 2.0.2(5C1)/Symbols/usr/lib/libobjc.A.dylib /Developer/Platforms/iPhoneOS.platform/DeviceSupport /2.1.1/Symbols/usr/lib/libobjc.A.dylib /Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.1/Symbols/usr/lib/libobjc.A.dylib /Developer/Platforms/iPhoneOS.platform/DeviceSupport /2.2.1/Symbols/usr/lib/libobjc.A.dylib /Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.2/Symbols/usr/lib/libobjc.A.dylib /Developer/Platforms/iPhoneOS.platform/DeviceSupport /3.0(7A341)/Symbols/usr/lib/libobjc.A.dylib] ... - [/ Developer / Platforms / iPhoneOS.platform / DeviceSupport / 2.0(5A345)/Symbols/usr/lib/libobjc.A。 dylib] - NO MATCH
- [/ Developer / Platforms / iPhoneOS.platform / DeviceSupport / 2.0(5A347)/Symbols/usr/lib/libobjc.A.dylib] - 无MATCH
- - [/ Developer / Platforms / iPhoneOS.platform / DeviceSupport / 2.0.1(5B108)/Symbols/usr/lib/libobjc.A.dylib] - 没有MATCH
- [/ Developer / Platforms / iPhoneOS。 platform / DeviceSupport / 2.0.2(5C1)/Symbols/usr/lib/libobjc.A.dylib] - NO MATCH
- [/ Developer / Platforms / iPhoneOS.platform / DeviceSupport / 2.1.1 / Symbols /usr/lib/libobjc.A.dylib] - NO MATCH
- [/ De veloper / Platforms / iPhoneOS.platform / DeviceSupport / 2.1 / Symbols / usr / lib / libobjc.A.dylib] - NO MATCH
- [/ Developer / Platforms / iPhoneOS.platform / DeviceSupport / 2.2.1 /符号/ usr / lib / libobjc.A.dylib] - NO MATCH
- [/ Developer / Platforms / iPhoneOS.platform / DeviceSupport / 2.2 / Symbols / usr / lib / libobjc.A.dylib] - NO MATCH
- [/ Developer / Platforms / iPhoneOS.platform / DeviceSupport / 3.0(7A341)/Symbols/usr/lib/libobjc.A.dylib] - 无MATCH
不在Spotlight中搜索dsym与UUID的/usr/lib/libobjc.A.dylib
##警告:找不到与/usr/lib/libobjc.A.dylib

以下是通过symbolicatecrash运行崩溃报告的示例:

 线程0崩溃:
0 libSystem.B.dylib 0x31dc476c 0x31d46000 + 517996
1 libSystem.B.dylib 0x31dc4755 0x31d46000 + 517973
2 Foo 0x00053075 uncaught_excepti on_handler + 21
3 CoreFoundation 0x3028f65f 0x301fd000 + 599647
4 libobjc.A.dylib 0x30013693 0x3000c000 + 30355
5 libstdc ++。6.dylib 0x374ccc2d 0x3748a000 + 273453
6 libstdc ++。 dylib 0x374ccc81 0x3748a000 + 273537
7 libstdc ++。6.dylib 0x374ccd4d 0x3748a000 + 273741
8 libobjc.A.dylib 0x300135ff 0x3000c000 + 30207
9 CoreFoundation 0x30222f2d 0x301fd000 + 155437
10 CoreFoundation 0x30222ecb 0x301fd000 + 155339
11基础0x30521e33 0x30501000 + 134707
12基础0x30570d47 0x30501000 + 458055
13 Foo 0x0000a1db - [Bar barfoo](Bar.m:1617)
14 Foo 0x00032f73 - [MyViewController foobar](MyViewController.m:727)
15 Foo 0x000 329b9 - [MyViewController foobar](MyViewController.m:666)
16 Foo 0x00031fab - [MyViewController tabBar:tabSelected:](MyViewController.m:440)
17 Foo 0x00068d41 - [TTTabBar setSelectedTabIndex:](TTTabBar .m:160)
18 Foo 0x00068ca3 - [TTTabBar setSelectedTabView:](TTTabBar.m:142)
19 Foo 0x000689cf - [TTTabBar tabTouchedUp:](TTTabBar.m:83)
20 CoreFoundation 0x302552f9 0x301fd000 + 361209
21 UIKit 0x3094d101 0x308ed000 + 393473
22 UIKit 0x3094d0a1 0x308ed000 + 393377
23 UIKit 0x3094d073 0x308ed000 + 393331
24 UIKit 0x3094cdcd 0x308ed000 + 392653
25 UIKit 0x309779c1 0x308ed000 + 567745
26 UIKit 0x30977011 0x308ed000 + 565265
27 UIKit 0x309767d9 0x308ed000 + 563161
28 UIKit 0x30923613 0x308ed000 + 222739
29 UIKit 0x30923163 0x308ed000 + 221539
30 GraphicsServices 0x32045a4d 0x32041000 + 19021
31 CoreFoundation 0x30253041 0x301fd000 + 352321
32 CoreFoundation 0x30252771 0x301fd000 + 350065
33 GraphicsServices 0x32044b0f 0x32041000 + 15119
34 GraphicsServices 0x32044bbb 0x32041000 + 15291
35 UIKit 0x308f0363 0x308ed000 + 13155
36 UIKit 0x308ef121 0x308ed000 + 8481
37 Foo 0x00002097 main(main.m:13)


解决方案

Greg的建议对我来说没有帮助,但是帮助指出了正确的方向
来获得plcrashreport呃记录(记者版本103)再次用sdk 4.0来表示。



BTW:这是一个问题,你将明确地在新设备上创建报告(armv7)
因为符号假设报告版本103是armv6。



所以这是我做的...



1)



从最新的symbolicatecrash脚本(sdk 4.0)中创建一份用于您所做更改的副本。
注意:根据您使用的编辑器,您可能必须在编辑后设置可执行位。
chmod 755 symbolicatecrash






2)问题:找到符号 - NO MATCH



这是因为默认设置为armv6。



分辨率: code> sub parse_images 设置默认架构 my $ default_arch ='armv7';


$ b $

3)问题:使用未初始化的值$ bundle ...



解决方法:(hack:取消一些限制,似乎不适用于103份报告)



替换:

 code> $ app = $ bundlename if(!defined $ app&& define $ image {plus}&& length $ image {plus}); 

by:

 code> $ app = $ bundlename if(!defined $ app); 






4)问题:无法理解输出来自otool



解决方案:Greg对 sub matchesUUID 的修复。



替换:

 } else {die无法理解otool的输出($ TEST_uuid); 

by:

 } else {if($ arch eqarmv7){return matchesUUID($ path,$ uuid,armv6); } else {die无法理解otool的输出($ TEST_uuid); }} 






5)问题:atos不能找到符号



这里Gregs脚本更改无效,




  • rindex()在代码突出显示中失去了< $ ph>

  • atos无法加载符号没有被传递到脚本中 - 所以检查不起作用

  • < $ ph> rindex(检查读取第一行...所以一帧丢失,万一它是成功的
    作为一个黑客我只是伪装一个框架,在atos检查过程中使用了code1 ...



所以这是我在 sub symbolize_frames 中更改的内容:



替换:我的$ cmd =$ atos -arch $ arch -o'$ escapedSymbol'@ {[keys%$ frames]} |$$$ ;

by:

  my $ cmd =$ atos -arch $ arch -o'$ escapedSymbol'1 @ {[keys%$ frames]} 2>& 1 | ; 

替换:

 打开我的$($ ph)$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $通过:

 打开我的($ ph),$ cmd或死$ !; 
if(rindex(< $ ph>atos无法加载符号)!= -1&& $ arch eqarmv7){
my $ arch =armv6;我的$ cmd =$ atos -arch $ arch -o'$ escapedSymbol'@ {[keys%$ frames]} 2>& 1 | ;
打印STDERR运行$ cmd\\\
如果$ opt {v};
打开$ ph,$ cmd或死$ $;
}

* UPDATE * I've reinstalled with Snow Leopard, clean install. Completely wiped my existing Leopard install. Same problem persists.

I've tried numbers of versions of symbolicatecrash to resolve symbols in my crash reports. From the version provided by Apple, to Alan's Quatermain's version posted on GitHub and finally from http://openradar.appspot.com/6438643.

For whatever reason, the best results I can get is for symbols on my own libraries to get resolved. Normally, this is enough data to point me in the right direction -- other times it is not. With 2.x I had no problems getting the symbols for my code + Apple provided libraries from within the stack traces in each thread.

Most likely an issue with my environment here, I'm not at all doubting the work that Apple or Alan have done. Yes I'm certain the dSYM I have stashed away is the same exact one that's generating the crash report.

Although 'Foo' is me, and getting symbols from it is wonderful, I need to see symbols from the other functions in the stack to truly understand my reports.

Note: For devices that crash running the app on iPhone OS 2.2.1, I have no problem getting all symbols. This is an iPhone OS 3.0 issue it appears.

Also, while running symbolicatecrash in verbose mode here's a few of the things that struck me as wrong:

- NO MATCH
NOT searching in Spotlight for dsym with UUID of /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
## Warning: Can't find any unstripped binary that matches version of /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation

..........fetching symbol file for libobjc.A.dylib--[undef] 
Searching [/Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.0 (5A345)/Symbols/usr/lib/libobjc.A.dylib /Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.0 (5A347)/Symbols/usr/lib/libobjc.A.dylib /Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.0.1 (5B108)/Symbols/usr/lib/libobjc.A.dylib /Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.0.2 (5C1)/Symbols/usr/lib/libobjc.A.dylib /Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.1.1/Symbols/usr/lib/libobjc.A.dylib /Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.1/Symbols/usr/lib/libobjc.A.dylib /Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.2.1/Symbols/usr/lib/libobjc.A.dylib /Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.2/Symbols/usr/lib/libobjc.A.dylib /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0 (7A341)/Symbols/usr/lib/libobjc.A.dylib]...--[/Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.0 (5A345)/Symbols/usr/lib/libobjc.A.dylib] -- NO MATCH
--[/Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.0 (5A347)/Symbols/usr/lib/libobjc.A.dylib] -- NO MATCH
--[/Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.0.1 (5B108)/Symbols/usr/lib/libobjc.A.dylib] -- NO MATCH
--[/Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.0.2 (5C1)/Symbols/usr/lib/libobjc.A.dylib] -- NO MATCH
--[/Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.1.1/Symbols/usr/lib/libobjc.A.dylib] -- NO MATCH
--[/Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.1/Symbols/usr/lib/libobjc.A.dylib] -- NO MATCH
--[/Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.2.1/Symbols/usr/lib/libobjc.A.dylib] -- NO MATCH
--[/Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.2/Symbols/usr/lib/libobjc.A.dylib] -- NO MATCH
--[/Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0 (7A341)/Symbols/usr/lib/libobjc.A.dylib] -- NO MATCH
NOT searching in Spotlight for dsym with UUID of /usr/lib/libobjc.A.dylib
## Warning: Can't find any unstripped binary that matches version of /usr/lib/libobjc.A.dylib

Here's an example of the crash report after running it through symbolicatecrash:

Thread 0 Crashed:
0   libSystem.B.dylib                   0x31dc476c 0x31d46000 + 517996
1   libSystem.B.dylib                   0x31dc4755 0x31d46000 + 517973
2   Foo                            0x00053075 uncaught_exception_handler + 21
3   CoreFoundation                      0x3028f65f 0x301fd000 + 599647
4   libobjc.A.dylib                     0x30013693 0x3000c000 + 30355
5   libstdc++.6.dylib                   0x374ccc2d 0x3748a000 + 273453
6   libstdc++.6.dylib                   0x374ccc81 0x3748a000 + 273537
7   libstdc++.6.dylib                   0x374ccd4d 0x3748a000 + 273741
8   libobjc.A.dylib                     0x300135ff 0x3000c000 + 30207
9   CoreFoundation                      0x30222f2d 0x301fd000 + 155437
10  CoreFoundation                      0x30222ecb 0x301fd000 + 155339
11  Foundation                          0x30521e33 0x30501000 + 134707
12  Foundation                          0x30570d47 0x30501000 + 458055
13  Foo                            0x0000a1db -[Bar barfoo] (Bar.m:1617)
14  Foo                            0x00032f73 -[MyViewController foobar] (MyViewController.m:727)
15  Foo                            0x000329b9 -[MyViewController foobar] (MyViewController.m:666)
16  Foo                            0x00031fab -[MyViewController tabBar:tabSelected:] (MyViewController.m:440)
17  Foo                            0x00068d41 -[TTTabBar setSelectedTabIndex:] (TTTabBar.m:160)
18  Foo                            0x00068ca3 -[TTTabBar setSelectedTabView:] (TTTabBar.m:142)
19  Foo                            0x000689cf -[TTTabBar tabTouchedUp:] (TTTabBar.m:83)
20  CoreFoundation                      0x302552f9 0x301fd000 + 361209
21  UIKit                               0x3094d101 0x308ed000 + 393473
22  UIKit                               0x3094d0a1 0x308ed000 + 393377
23  UIKit                               0x3094d073 0x308ed000 + 393331
24  UIKit                               0x3094cdcd 0x308ed000 + 392653
25  UIKit                               0x309779c1 0x308ed000 + 567745
26  UIKit                               0x30977011 0x308ed000 + 565265
27  UIKit                               0x309767d9 0x308ed000 + 563161
28  UIKit                               0x30923613 0x308ed000 + 222739
29  UIKit                               0x30923163 0x308ed000 + 221539
30  GraphicsServices                    0x32045a4d 0x32041000 + 19021
31  CoreFoundation                      0x30253041 0x301fd000 + 352321
32  CoreFoundation                      0x30252771 0x301fd000 + 350065
33  GraphicsServices                    0x32044b0f 0x32041000 + 15119
34  GraphicsServices                    0x32044bbb 0x32041000 + 15291
35  UIKit                               0x308f0363 0x308ed000 + 13155
36  UIKit                               0x308ef121 0x308ed000 + 8481
37  Foo                            0x00002097 main (main.m:13)  

解决方案

Greg's suggestions, didn't work for me but helped to point the right direction to get plcrashreporter logs (reporter version 103) to symbolize again with sdk 4.0.

BTW: this is an issue you will definitly have with reports created on newer devices (armv7) because symbolicate assumes reports version 103 are armv6.

So this is what i did ...

1)

make a copy from the newest symbolicatecrash script (sdk 4.0) for the changes you make. Note: depending on the editor u use you might have to set the executable bit after editing. chmod 755 symbolicatecrash


2) issue: finding symbols -- NO MATCH

this is because the default is set to armv6.

Resolution: in sub parse_images set the default architecture my $default_arch = 'armv7';


3) issue: "Use of uninitialized value $bundle ..."

Resolution: (hack: removing some restrictions that don't seem to work on 103 reports)

replace:

$app = $bundlename if (!defined $app && defined $image{plus} && length $image{plus});

by:

$app = $bundlename if (!defined $app);


4) issue: "can't understand output from otool"

Resolution: Greg's fix for sub matchesUUID.

replace:

} else { die "Can't understand the output from otool ($TEST_uuid)"; }

by:

} else { if ($arch eq "armv7") { return matchesUUID($path, $uuid, "armv6"); } else { die "Can't understand the output from otool ($TEST_uuid)"; } }


5) issue: "atos can not find symbols"

here Gregs script changes didn't work,

  • it seems that <$ph> in rindex( got lost in the code highlighting.
  • the "atos cannot load symbols" wasn't beeing passed into the script - so the check wouldn't work
  • the <$ph> in rindex( check reads the first line ... so one frame gets lost in case it was successfull. As a "hack" i simply faked a frame with adreass 1... which is "used" during the atos check.

So this is what i changed in sub symbolize_frames:

replace:

my $cmd = "$atos -arch $arch -o '$escapedSymbol' @{[ keys %$frames ]} | ";

by:

my $cmd = "$atos -arch $arch -o '$escapedSymbol' 1 @{[ keys %$frames ]}  2>&1 | ";

replace:

open my($ph),$cmd or die $!;

by:

open my($ph),$cmd or die $!;
if (rindex(<$ph>, "atos cannot load symbols") != -1 && $arch eq "armv7") {
    my $arch = "armv6"; my $cmd = "$atos -arch $arch -o '$escapedSymbol' @{[ keys %$frames ]}  2>&1 | ";
    print STDERR "Running $cmd\n" if $opt{v};
    open $ph,$cmd or die $!;
}


Note: with this changes the script runs fine for me - the "fixes" are probably not very elegant but i'm not fluent in perl :) ...

这篇关于iPhone SDK 3.0和symbolicatecrash不一致?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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