分析 crash 报告的方法

劳昊明
2023-12-01

最近上传的一个app,被苹果打回来了,原因是在下载完成之前会挂掉。 还带有4个crash报告。

Incident Identifier: 926328CE-927A-4D1B-940C-B17A0CD1A5DB
CrashReporter Key:   3af694acc56eb48927bd9022990ac1238a192d06
Hardware Model:      iPad2,2
Process:         LiBai [6180]
Path:            /var/mobile/Applications/321E7CC8-5D97-4739-B388-1E49E6A7E2BD/LiBai.app/LiBai
Identifier:      LiBai
Version:         ??? (???)
Code Type:       ARM (Native)
Parent Process:  launchd [1]

Date/Time:       2011-12-30 10:37:35.221 -0800
OS Version:      iPhone OS 5.0.1 (9A405)
Report Version:  104

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

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_c.dylib             	0x32ed2c28 0x32e5d000 + 482344
1   libsystem_c.dylib             	0x32ea9bac 0x32e5d000 + 314284
2   libsystem_c.dylib             	0x32e73844 0x32e5d000 + 92228
3   LiBai                         	0x00119028 0x100000 + 102440
4   LiBai                         	0x00119f04 0x100000 + 106244
5   LiBai                         	0x0011bd02 0x100000 + 113922
6   LiBai                         	0x00117de6 0x100000 + 97766
7   LiBai                         	0x0011818a 0x100000 + 98698
8   CoreFoundation                	0x34229224 0x34211000 + 98852
9   LiBai                         	0x00118c82 0x100000 + 101506
10  Foundation                    	0x32d51c32 0x32c8b000 + 814130
11  Foundation                    	0x32ca96e2 0x32c8b000 + 124642
12  Foundation                    	0x32ca96ac 0x32c8b000 + 124588
13  Foundation                    	0x32ca95ce 0x32c8b000 + 124366
14  CFNetwork                     	0x3795989e 0x3794a000 + 63646
15  CFNetwork                     	0x3794e53e 0x3794a000 + 17726
16  CFNetwork                     	0x3794e23c 0x3794a000 + 16956
17  CFNetwork                     	0x3794e172 0x3794a000 + 16754
18  CoreFoundation                	0x3429eafc 0x34211000 + 580348
19  CoreFoundation                	0x3429e2c8 0x34211000 + 578248
20  CoreFoundation                	0x3429d06e 0x34211000 + 573550
21  CoreFoundation                	0x342204d6 0x34211000 + 62678
22  CoreFoundation                	0x3422039e 0x34211000 + 62366
23  GraphicsServices              	0x30b0bfc6 0x30b08000 + 16326
24  UIKit                         	0x327e873c 0x327b7000 + 202556
25  LiBai                         	0x00101820 0x100000 + 6176
26  LiBai                         	0x001017d8 0x100000 + 6104

从这里只能初步判断是因为访问了空的内存。但是具体的就不知道了。因为下面的进程调用都是堆栈信息,在网上找了很久终于找到了解决的办法。


分析crash报告:

1、首先我们需要一个XXXXX.app.dSYM  这个在 Archive 中的 release 版本的 应用程序.xcarchive可以找到,只要在对应的文件上面 右键 显示包内荣,可以看到有一个 dSYMs的文件夹,里面就有我们要的  XXXXX.app.dSYM 文件。

2、下面我们需要 找到  symbolicatecrash

/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash)

    3、用终端进入 这个目录 然后 用   symbolicatecrash  crash 文件   dSYM 文件 > 输出的文件 这样的命令就可以导出。

Incident Identifier: 9B4E1CA2-CEB5-4777-BD93-FFFD3AC10E0F
CrashReporter Key:   3af694acc56eb48927bd9022990ac1238a192d06
Hardware Model:      iPad2,2
Process:         LiBai [6166]
Path:            /var/mobile/Applications/321E7CC8-5D97-4739-B388-1E49E6A7E2BD/LiBai.app/LiBai
Identifier:      LiBai
Version:         ??? (???)
Code Type:       ARM (Native)
Parent Process:  launchd [1]

Date/Time:       2011-12-30 10:36:22.049 -0800
OS Version:      iPhone OS 5.0.1 (9A405)
Report Version:  104

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

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_c.dylib             	0x32ed2c28 0x32e5d000 + 482344
1   libsystem_c.dylib             	0x32ea9bac 0x32e5d000 + 314284
2   libsystem_c.dylib             	0x32e73844 0x32e5d000 + 92228
3   LiBai                         	0x000a6028 fread_file_func (ioapi.c:97)
4   LiBai                         	0x000a6f04 unzReadCurrentFile (unzip.c:1279)
5   LiBai                         	0x000a8d02 -[ZipArchive UnzipFileTo:overWrite:] (ZipArchive.mm:238)
6   LiBai                         	0x000a4de6 -[booklistViewController OnUnZip] (booklistViewController.m:68)
7   LiBai                         	0x000a518a -[booklistViewController downloadManagerDataDownloadFinished:] (booklistViewController.m:146)
8   CoreFoundation                	0x34229224 0x34211000 + 98852
9   LiBai                         	0x000a5c82 -[DownloadManager connectionDidFinishLoading:] (DownloadManager.m:138)
10  Foundation                    	0x32d51c32 0x32c8b000 + 814130
11  Foundation                    	0x32ca96e2 0x32c8b000 + 124642
12  Foundation                    	0x32ca96ac 0x32c8b000 + 124588
13  Foundation                    	0x32ca95ce 0x32c8b000 + 124366
14  CFNetwork                     	0x3795989e 0x3794a000 + 63646
15  CFNetwork                     	0x3794e53e 0x3794a000 + 17726
16  CFNetwork                     	0x3794e23c 0x3794a000 + 16956
17  CFNetwork                     	0x3794e172 0x3794a000 + 16754
18  CoreFoundation                	0x3429eafc 0x34211000 + 580348
19  CoreFoundation                	0x3429e2c8 0x34211000 + 578248
20  CoreFoundation                	0x3429d06e 0x34211000 + 573550
21  CoreFoundation                	0x342204d6 0x34211000 + 62678
22  CoreFoundation                	0x3422039e 0x34211000 + 62366
23  GraphicsServices              	0x30b0bfc6 0x30b08000 + 16326
24  UIKit                         	0x327e873c 0x327b7000 + 202556
25  LiBai                         	0x0008e820 main (main.m:14)
26  LiBai                         	0x0008e7d8 0x8d000 + 6104

 类似资料: