CALayer dealloc在辅助线程中崩溃

时间:2014-08-21 14:32:53

标签: ios multithreading crash calayer

我收到了以下的崩溃日志,而且我在查看应用程序的哪个部分时遇到了一些麻烦。

Hardware Model:      iPad2,4
Process:         MYAPP [129]
Path:            /var/mobile/Applications/FC5BD37F-838A-4CDD-8158-5A2B6F34C3AB/MYAPP.app/MYAPP
Identifier:      com.myapp
Version:         4.0
Code Type:       ARM
Parent Process:  launchd [1]

Exception Type:  SIGSEGV
Exception Codes: SEGV_ACCERR at 0x8
Crashed Thread:  6

Thread 0:
0   libz.1.dylib                        0x38b9a3c8 _zError + 1159
1   ImageIO                             0x2e9755b9 <redacted> + 308
2   ImageIO                             0x2e973155 <redacted> + 2400
3   ImageIO                             0x2e97227f <redacted> + 542
4   CoreGraphics                        0x2dcaf44d _CGImageProviderCopyImageBlockSetWithOptions + 136
5   QuartzCore                          0x300e9105 <redacted> + 684
6   QuartzCore                          0x300e85af <redacted> + 290
7   QuartzCore                          0x300e8e47 <redacted> + 18
8   QuartzCore                          0x300bd201 <redacted> + 384
9   QuartzCore                          0x300bc6e7 <redacted> + 238
10  QuartzCore                          0x300bc4ef <redacted> + 314
11  QuartzCore                          0x300b621d <redacted> + 56
12  CoreFoundation                      0x2dbf32a5 <redacted> + 20
13  CoreFoundation                      0x2dbf0c49 <redacted> + 284
14  CoreFoundation                      0x2dbf0f8b <redacted> + 730
15  CoreFoundation                      0x2db5bf0f _CFRunLoopRunSpecific + 522
16  CoreFoundation                      0x2db5bcf3 _CFRunLoopRunInMode + 106
17  GraphicsServices                    0x32a55663 _GSEventRunModal + 138
18  UIKit                               0x304a716d _UIApplicationMain + 1136
19  MYAPP                           0x000b7177 __mh_execute_header + 29047
20  libdyld.dylib                       0x38c19ab7 <redacted> + 2

Thread 1:
0   libsystem_kernel.dylib              0x38cbc808 _kevent64 + 24
1   libdispatch.dylib                   0x38bfde03 <redacted> + 38

Thread 2:
0   libsystem_kernel.dylib              0x38ccfc70 ___workq_kernreturn + 8
1   libsystem_pthread.dylib             0x38d36a98 _start_wqthread + 8

Thread 3:
0   libsystem_kernel.dylib              0x38ccfc70 ___workq_kernreturn + 8
1   libsystem_pthread.dylib             0x38d36a98 _start_wqthread + 8

Thread 4:
0   libsystem_kernel.dylib              0x38cbca58 _mach_msg_trap + 20
1   CoreFoundation                      0x2dbf289b <redacted> + 154
2   CoreFoundation                      0x2dbf0fc1 <redacted> + 784
3   CoreFoundation                      0x2db5bf0f _CFRunLoopRunSpecific + 522
4   CoreFoundation                      0x2db5bcf3 _CFRunLoopRunInMode + 106
5   Foundation                          0x2e59b087 +[NSURLConnection _resourceLoadLoop:] + 318
6   Foundation                          0x2e610a5f <redacted> + 1062
7   libsystem_pthread.dylib             0x38d38919 <redacted> + 140
8   libsystem_pthread.dylib             0x38d3888b __pthread_start + 102
9   libsystem_pthread.dylib             0x38d36aa4 _thread_start + 8

Thread 5:
0   libsystem_kernel.dylib              0x38ccfc70 ___workq_kernreturn + 8
1   libsystem_pthread.dylib             0x38d36a98 _start_wqthread + 8

Thread 6 Crashed:
0   QuartzCore                          0x300c0376 <redacted> + 5
1   QuartzCore                          0x300bfe63 <redacted> + 142
2   QuartzCore                          0x300bfb13 -[CALayer dealloc] + 142
3   QuartzCore                          0x300bf881 <redacted> + 136
4   QuartzCore                          0x300bc547 <redacted> + 402
5   QuartzCore                          0x3011dfa1 <redacted> + 576
6   libdispatch.dylib                   0x38bfbad7 <redacted> + 222
7   libdispatch.dylib                   0x38bfbd29 <redacted> + 56
8   libsystem_pthread.dylib             0x38d36bd3 __pthread_wqthread + 298
9   libsystem_pthread.dylib             0x38d36a98 _start_wqthread + 8

Thread 7:
0   libsystem_kernel.dylib              0x38cbca58 _mach_msg_trap + 20
1   CoreFoundation                      0x2dbf289b <redacted> + 154
2   CoreFoundation                      0x2dbf0fc1 <redacted> + 784
3   CoreFoundation                      0x2db5bf0f _CFRunLoopRunSpecific + 522
4   CoreFoundation                      0x2db5bcf3 _CFRunLoopRunInMode + 106
5   WebCore                             0x3603011b <redacted> + 418
6   libsystem_pthread.dylib             0x38d38919 <redacted> + 140
7   libsystem_pthread.dylib             0x38d3888b __pthread_start + 102
8   libsystem_pthread.dylib             0x38d36aa4 _thread_start + 8

Thread 8:
0   libsystem_kernel.dylib              0x38cbca58 _mach_msg_trap + 20
1   CoreFoundation                      0x2dbf289b <redacted> + 154
2   CoreFoundation                      0x2dbf0fc1 <redacted> + 784
3   CoreFoundation                      0x2db5bf0f _CFRunLoopRunSpecific + 522
4   CoreFoundation                      0x2db5bcf3 _CFRunLoopRunInMode + 106
5   Foundation                          0x2e54e1eb -[NSRunLoop runMode:beforeDate:] + 254
6   Foundation                          0x2e59f0a1 -[NSRunLoop run] + 80
7   MYAPP                           0x002c533d +[AFURLConnectionOperation networkRequestThreadEntryPoint:] + 80
8   Foundation                          0x2e610a5f <redacted> + 1062
9   libsystem_pthread.dylib             0x38d38919 <redacted> + 140
10  libsystem_pthread.dylib             0x38d3888b __pthread_start + 102
11  libsystem_pthread.dylib             0x38d36aa4 _thread_start + 8

Thread 9:
0   libsystem_kernel.dylib              0x38ccf434 ___select + 20
1   libsystem_pthread.dylib             0x38d38919 <redacted> + 140
2   libsystem_pthread.dylib             0x38d3888b __pthread_start + 102
3   libsystem_pthread.dylib             0x38d36aa4 _thread_start + 8

Thread 10:
0   libsystem_kernel.dylib              0x38ccef2c ___psynch_cvwait + 24
1   libsystem_pthread.dylib             0x38d38d65 _pthread_cond_wait + 40
2   JavaScriptCore                      0x2eb88ee9 <redacted> + 208
3   JavaScriptCore                      0x2eb8653b <redacted> + 14
4   libsystem_pthread.dylib             0x38d38919 <redacted> + 140
5   libsystem_pthread.dylib             0x38d3888b __pthread_start + 102
6   libsystem_pthread.dylib             0x38d36aa4 _thread_start + 8

Thread 11:
0   libsystem_kernel.dylib              0x38ccef2c ___psynch_cvwait + 24
1   libsystem_pthread.dylib             0x38d38d65 _pthread_cond_wait + 40
2   JavaScriptCore                      0x2ed2440b <redacted> + 78
3   JavaScriptCore                      0x2ed24465 <redacted> + 52
4   JavaScriptCore                      0x2eb8653b <redacted> + 14
5   libsystem_pthread.dylib             0x38d38919 <redacted> + 140
6   libsystem_pthread.dylib             0x38d3888b __pthread_start + 102
7   libsystem_pthread.dylib             0x38d36aa4 _thread_start + 8

Thread 12:
0   libsystem_kernel.dylib              0x38cbca58 _mach_msg_trap + 20
1   CoreFoundation                      0x2dbf289b <redacted> + 154
2   CoreFoundation                      0x2dbf0fc1 <redacted> + 784
3   CoreFoundation                      0x2db5bf0f _CFRunLoopRunSpecific + 522
4   CoreFoundation                      0x2db5bcf3 _CFRunLoopRunInMode + 106
5   WebCore                             0x36078b17 <redacted> + 254
6   JavaScriptCore                      0x2eb8653b <redacted> + 14
7   libsystem_pthread.dylib             0x38d38919 <redacted> + 140
8   libsystem_pthread.dylib             0x38d3888b __pthread_start + 102
9   libsystem_pthread.dylib             0x38d36aa4 _thread_start + 8

Thread 13:
0   libsystem_kernel.dylib              0x38ccef2c ___psynch_cvwait + 24
1   libsystem_pthread.dylib             0x38d38d65 _pthread_cond_wait + 40
2   JavaScriptCore                      0x2eb88ee9 <redacted> + 208
3   JavaScriptCore                      0x2eb8653b <redacted> + 14
4   libsystem_pthread.dylib             0x38d38919 <redacted> + 140
5   libsystem_pthread.dylib             0x38d3888b __pthread_start + 102
6   libsystem_pthread.dylib             0x38d36aa4 _thread_start + 8

Thread 14:
0   libsystem_kernel.dylib              0x38ccef2c ___psynch_cvwait + 24
1   libsystem_pthread.dylib             0x38d38d65 _pthread_cond_wait + 40
2   JavaScriptCore                      0x2ed2440b <redacted> + 78
3   JavaScriptCore                      0x2ed24465 <redacted> + 52
4   JavaScriptCore                      0x2eb8653b <redacted> + 14
5   libsystem_pthread.dylib             0x38d38919 <redacted> + 140
6   libsystem_pthread.dylib             0x38d3888b __pthread_start + 102
7   libsystem_pthread.dylib             0x38d36aa4 _thread_start + 8

Thread 15:
0   libsystem_kernel.dylib              0x38ccfc70 ___workq_kernreturn + 8
1   libsystem_pthread.dylib             0x38d36a98 _start_wqthread + 8

Thread 16:
0   libsystem_kernel.dylib              0x38cbca58 _mach_msg_trap + 20
1   CoreFoundation                      0x2dbf289b <redacted> + 154
2   CoreFoundation                      0x2dbf0fc1 <redacted> + 784
3   CoreFoundation                      0x2db5bf0f _CFRunLoopRunSpecific + 522
4   CoreFoundation                      0x2db9fa03 _CFRunLoopRun + 98
5   CoreMotion                          0x2e2193ad _CLSF_thorntonUpdate_6x6 + 56957
6   libsystem_pthread.dylib             0x38d38919 <redacted> + 140
7   libsystem_pthread.dylib             0x38d3888b __pthread_start + 102
8   libsystem_pthread.dylib             0x38d36aa4 _thread_start + 8

Thread 6 crashed with ARM Thread State:
    pc: 0x300c0376     r7: 0x03389d68     sp: 0x03389d0c     r0: 0x00000000 
    r1: 0x16b1d800     r2: 0x00000002     r3: 0x300c435d     r4: 0x16b1d800 
    r5: 0x00000000     r6: 0x17a3e820     r8: 0x03389d20     r9: 0x17200020 
   r10: 0x39202310    r11: 0x00000000     ip: 0x3ac7ebc8     lr: 0x300c02ab 
  cpsr: 0x60000030 

我注意到在崩溃的线程上有一个-[CALayer dealloc]调用,所以我猜我不小心从一个辅助线程调用了一些UI更新。

所以这是我的问题:我是否正确地认为问题是从辅助线程更新UI?如果是这样,这个崩溃日志能否帮助我弄清楚我的代码中的错误在哪里?

0 个答案:

没有答案