崩溃ERROR_CGDataProvider_BufferIsNotReadable + 12,CGDataProviderRetainBytePtr + 216

时间:2018-01-12 00:26:56

标签: ios objective-c iphone xcode

我的应用中每1000到2000个会话发生一次崩溃,我无法弄清楚该做些什么。

这是Apple iOS崩溃,我无法对此做任何事情吗?

我在我的项目中使用SDWebImage pod,也许就是这样?

这是崩溃日志:

Thread 0 Crashed:
0  CoreGraphics                   0x182cfa59c ERROR_CGDataProvider_BufferIsNotReadable + 12
1   CoreGraphics                  0x000000018582e2c0 CGDataProviderRetainBytePtr + 216
2   QuartzCore                      0x0000000187f00048 CA::Render::(anonymous namespace)::create_image_from_image_data() + 196
3   QuartzCore                      0x0000000187efe1a0 CA::Render::create_image() + 900
4   QuartzCore                      0x0000000187f00e60 CA::Render::copy_image() + 472
5   QuartzCore                      0x0000000187f01228 CA::Render::prepare_image() + 20
6   QuartzCore                      0x00000001880101a8 CA::Layer::prepare_commit() + 332
7   QuartzCore                      0x0000000187f7245c CA::Context::commit_transaction() + 576
8   QuartzCore                      0x0000000187f99b90 CA::Transaction::commit() + 540
9   QuartzCore                      0x0000000187f9a9d0 CA::Transaction::observer_callback() + 92
9
10   CoreFoundation                  0x0000000183f65edc __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
11  CoreFoundation                  0x0000000183f63894 __CFRunLoopDoObservers + 412
12  CoreFoundation                  0x0000000183e83e78 CFRunLoopRunSpecific + 468
13  GraphicsServices                0x0000000185d30f84 GSEventRunModal + 100
14  UIKit                           0x000000018d50367c UIApplicationMain + 236
15  GOTit                           0x0000000100bb8e10 main (main.m:18)
16  libdyld.dylib                   0x00000001839a056c start + 4

- Full crash report:

Thread 1 name:  gputools.smt_poll.0x1c003bba0
Thread 1:
0   libsystem_kernel.dylib          0x00000001826c460c __semwait_signal + 8
1   libsystem_c.dylib               0x00000001825dce90 usleep + 64
2   GPUToolsCore                    0x0000000104b75f0c
3   libsystem_pthread.dylib         0x00000001827d82b4 _pthread_body + 308
4   libsystem_pthread.dylib         0x00000001827d8180 _pthread_body + 0
5   libsystem_pthread.dylib         0x00000001827d6b74 thread_start + 4


Thread 2 name:  gputools.smt_poll.0x1c003fa20
Thread 2:
0   libsystem_kernel.dylib          0x00000001826c460c __semwait_signal + 8
1   libsystem_c.dylib               0x00000001825dce90 usleep + 64
2   GPUToolsCore                    0x0000000104b75f0c
3   libsystem_pthread.dylib         0x00000001827d82b4 _pthread_body + 308
4   libsystem_pthread.dylib         0x00000001827d8180 _pthread_body + 0
5   libsystem_pthread.dylib         0x00000001827d6b74 thread_start + 4


Thread 3 name:  com.apple.uikit.eventfetch-thread
Thread 3:
0   libsystem_kernel.dylib          0x00000001826a3568 mach_msg_trap + 8
1   CoreFoundation                  0x0000000182b5a308 __CFRunLoopServiceMachPort + 196
2   CoreFoundation                  0x0000000182b57ed4 __CFRunLoopRun + 1424
3   CoreFoundation                  0x0000000182a77e58 CFRunLoopRunSpecific + 436
4   Foundation                      0x00000001834ad594 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304
5   Foundation                      0x00000001834cc9ac -[NSRunLoop(NSRunLoop) runUntilDate:] + 96
6   UIKit                           0x000000018cd367b8 -[UIEventFetcher threadMain] + 136
7   Foundation                      0x00000001835af0f4 __NSThread__start__ + 996
8   libsystem_pthread.dylib         0x00000001827d82b4 _pthread_body + 308
9   libsystem_pthread.dylib         0x00000001827d8180 _pthread_body + 0
10  libsystem_pthread.dylib         0x00000001827d6b74 thread_start + 4


Thread 4 name:  GAIThread
Thread 4:
0   libsystem_kernel.dylib          0x00000001826a3568 mach_msg_trap + 8
1   CoreFoundation                  0x0000000182b5a308 __CFRunLoopServiceMachPort + 196
2   CoreFoundation                  0x0000000182b57ed4 __CFRunLoopRun + 1424
3   CoreFoundation                  0x0000000182a77e58 CFRunLoopRunSpecific + 436
4   Foundation                      0x00000001834ad594 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304
5   Foundation                      0x00000001834ff56c -[NSRunLoop(NSRunLoop) run] + 88
6   GOTit                           0x00000001033626fc
7   Foundation                      0x00000001835af0f4 __NSThread__start__ + 996
8   libsystem_pthread.dylib         0x00000001827d82b4 _pthread_body + 308
9   libsystem_pthread.dylib         0x00000001827d8180 _pthread_body + 0
10  libsystem_pthread.dylib         0x00000001827d6b74 thread_start + 4


Thread 5 name:  com.apple.NSURLConnectionLoader
Thread 5:
0   libsystem_kernel.dylib          0x00000001826a3568 mach_msg_trap + 8
1   CoreFoundation                  0x0000000182b5a308 __CFRunLoopServiceMachPort + 196
2   CoreFoundation                  0x0000000182b57ed4 __CFRunLoopRun + 1424
3   CoreFoundation                  0x0000000182a77e58 CFRunLoopRunSpecific + 436
4   CFNetwork                       0x0000000183367128 -[__CoreSchedulingSetRunnable runForever] + 780
5   Foundation                      0x00000001835af0f4 __NSThread__start__ + 996
6   libsystem_pthread.dylib         0x00000001827d82b4 _pthread_body + 308
7   libsystem_pthread.dylib         0x00000001827d8180 _pthread_body + 0
8   libsystem_pthread.dylib         0x00000001827d6b74 thread_start + 4


Thread 6:
0   libsystem_kernel.dylib          0x00000001826a3568 mach_msg_trap + 8
1   CoreFoundation                  0x0000000182b5a308 __CFRunLoopServiceMachPort + 196
2   CoreFoundation                  0x0000000182b57ed4 __CFRunLoopRun + 1424
3   CoreFoundation                  0x0000000182a77e58 CFRunLoopRunSpecific + 436
4   GOTit                           0x00000001031af888
5   Foundation                      0x00000001835af0f4 __NSThread__start__ + 996
6   libsystem_pthread.dylib         0x00000001827d82b4 _pthread_body + 308
7   libsystem_pthread.dylib         0x00000001827d8180 _pthread_body + 0
8   libsystem_pthread.dylib         0x00000001827d6b74 thread_start + 4


Thread 7:
0   libsystem_kernel.dylib          0x00000001826c40f0 __psynch_cvwait + 8
1   libc++.1.dylib                  0x0000000181d7bea4 std::__1::condition_variable::wait() + 24
2   JavaScriptCore                  0x0000000189f1bf2c std::__1::condition_variable_any::wait<std::__1::unique_lock<bmalloc::Mutex> >() + 96
3   JavaScriptCore                  0x0000000189f1be54 bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>::threadRunLoop() + 172
4   JavaScriptCore                  0x0000000189f1c1b8 std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>*), bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>*> >() + 44
5   libsystem_pthread.dylib         0x00000001827d82b4 _pthread_body + 308
6   libsystem_pthread.dylib         0x00000001827d8180 _pthread_body + 0
7   libsystem_pthread.dylib         0x00000001827d6b74 thread_start + 4


Thread 8 name:  WebThread
Thread 8:
0   libsystem_kernel.dylib          0x00000001826a3568 mach_msg_trap + 8
1   CoreFoundation                  0x0000000182b5a308 __CFRunLoopServiceMachPort + 196
2   CoreFoundation                  0x0000000182b57ed4 __CFRunLoopRun + 1424
3   CoreFoundation                  0x0000000182a77e58 CFRunLoopRunSpecific + 436
4   WebCore                         0x000000018a9e8a34 RunWebThread() + 560
5   libsystem_pthread.dylib         0x00000001827d82b4 _pthread_body + 308
6   libsystem_pthread.dylib         0x00000001827d8180 _pthread_body + 0
7   libsystem_pthread.dylib         0x00000001827d6b74 thread_start + 4


Thread 9:
0   libsystem_kernel.dylib          0x00000001826c460c __semwait_signal + 8
1   Foundation                      0x00000001835ae2a8 +[NSThread sleepForTimeInterval:] + 136
2   GOTit                           0x000000010316dd2c
3   Foundation                      0x00000001835af0f4 __NSThread__start__ + 996
4   libsystem_pthread.dylib         0x00000001827d82b4 _pthread_body + 308
5   libsystem_pthread.dylib         0x00000001827d8180 _pthread_body + 0
6   libsystem_pthread.dylib         0x00000001827d6b74 thread_start + 4


Thread 10:
0   libsystem_kernel.dylib          0x00000001826a35a4 semaphore_wait_trap + 8
1   libdispatch.dylib               0x0000000104a9dc0c
2   GOTit                           0x0000000102ba8290
3   GOTit                           0x0000000102ba8810
4   GOTit                           0x0000000102b135c8
5   GOTit                           0x00000001028c4888
6   libsystem_blocks.dylib          0x00000001825cfa60 _Block_release + 160
7   GOTit                           0x0000000102b13b8c
8   libsystem_blocks.dylib          0x00000001825cfa60 _Block_release + 160
9   GOTit                           0x0000000102b14be8
10  libsystem_blocks.dylib          0x00000001825cfa60 _Block_release + 160
11  GOTit                           0x0000000102a785c8
12  libsystem_blocks.dylib          0x00000001825cfa60 _Block_release + 160
13  GOTit                           0x0000000102a7cdbc
14  libsystem_blocks.dylib          0x00000001825cfa60 _Block_release + 160
15  GOTit                           0x0000000102b81444
16  libsystem_blocks.dylib          0x00000001825cfa60 _Block_release + 160
17  GOTit                           0x0000000102ba5354
18  libobjc.A.dylib                 0x0000000181df6ef4 object_cxxDestructFromClass() + 148
19  libobjc.A.dylib                 0x0000000181e04638 objc_destructInstance + 88
20  libobjc.A.dylib                 0x0000000181e04690 object_dispose + 16
21  GOTit                           0x0000000102bac7e8
22  CFNetwork                       0x00000001832edff4 __51-[NSURLSession delegate_task:didCompleteWithError:]_block_invoke.207 + 76
23  Foundation                      0x0000000183589ba0 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
24  Foundation                      0x00000001834c9894 -[NSBlockOperation main] + 72
25  Foundation                      0x00000001834b94c4 -[__NSOperationInternal _start:] + 848
26  libdispatch.dylib               0x0000000104a9528c
27  libdispatch.dylib               0x0000000104aa19e4
28  libdispatch.dylib               0x0000000104a9528c
29  libdispatch.dylib               0x0000000104aa19e4
30  libdispatch.dylib               0x0000000104aa18a4
31  Foundation                      0x000000018358b878 __NSOQSchedule_f + 376
32  libdispatch.dylib               0x0000000104a9528c
33  libdispatch.dylib               0x0000000104aa2678
34  libdispatch.dylib               0x0000000104aa0f08
35  libdispatch.dylib               0x0000000104aa69d0
36  libdispatch.dylib               0x0000000104aa66f4
37  libsystem_pthread.dylib         0x00000001827d706c _pthread_wqthread + 1268
38  libsystem_pthread.dylib         0x00000001827d6b6c start_wqthread + 4


Thread 11:
0   libsystem_kernel.dylib          0x00000001826a35a4 semaphore_wait_trap + 8
1   libdispatch.dylib               0x0000000104a9dc0c
2   GOTit                           0x0000000102ba8290
3   GOTit                           0x0000000102ba8810
4   GOTit                           0x0000000102b135c8
5   GOTit                           0x00000001028c4888
6   libsystem_blocks.dylib          0x00000001825cfa60 _Block_release + 160
7   GOTit                           0x0000000102b13b8c
8   libsystem_blocks.dylib          0x00000001825cfa60 _Block_release + 160
9   GOTit                           0x0000000102b14be8
10  libsystem_blocks.dylib          0x00000001825cfa60 _Block_release + 160
11  GOTit                           0x0000000102a785c8
12  libsystem_blocks.dylib          0x00000001825cfa60 _Block_release + 160
13  GOTit                           0x0000000102a7cdbc
14  libsystem_blocks.dylib          0x00000001825cfa60 _Block_release + 160
15  GOTit                           0x0000000102b81444
16  libsystem_blocks.dylib          0x00000001825cfa60 _Block_release + 160
17  GOTit                           0x0000000102ba5354
18  libobjc.A.dylib                 0x0000000181df6ef4 object_cxxDestructFromClass() + 148
19  libobjc.A.dylib                 0x0000000181e04638 objc_destructInstance + 88
20  libobjc.A.dylib                 0x0000000181e04690 object_dispose + 16
21  GOTit                           0x0000000102bac7e8
22  CFNetwork                       0x00000001832edff4 __51-[NSURLSession delegate_task:didCompleteWithError:]_block_invoke.207 + 76
23  Foundation                      0x0000000183589ba0 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
24  Foundation                      0x00000001834c9894 -[NSBlockOperation main] + 72
25  Foundation                      0x00000001834b94c4 -[__NSOperationInternal _start:] + 848
26  libdispatch.dylib               0x0000000104a9528c
27  libdispatch.dylib               0x0000000104aa19e4
28  libdispatch.dylib               0x0000000104a9528c
29  libdispatch.dylib               0x0000000104aa19e4
30  libdispatch.dylib               0x0000000104aa18a4
31  Foundation                      0x000000018358b878 __NSOQSchedule_f + 376
32  libdispatch.dylib               0x0000000104a9528c
33  libdispatch.dylib               0x0000000104aa2678
34  libdispatch.dylib               0x0000000104aa0f08
35  libdispatch.dylib               0x0000000104aa69d0
36  libdispatch.dylib               0x0000000104aa66f4
37  libsystem_pthread.dylib         0x00000001827d706c _pthread_wqthread + 1268
38  libsystem_pthread.dylib         0x00000001827d6b6c start_wqthread + 4


Thread 12:
0   libsystem_pthread.dylib         0x00000001827d6b68 start_wqthread + 0


Thread 13:
0   libsystem_pthread.dylib         0x00000001827d6b68 start_wqthread + 0


Thread 14:
0   libobjc.A.dylib                 0x0000000181e04614 objc_destructInstance + 52
1   libdispatch.dylib               0x0000000104a98f04
2   libdispatch.dylib               0x0000000104a972a0
3   libdispatch.dylib               0x0000000104aa3d9c
4   libdispatch.dylib               0x0000000104a987ec
5   libdispatch.dylib               0x0000000104aa4f6c
6   libdispatch.dylib               0x0000000104aac020
7   libsystem_pthread.dylib         0x00000001827d6f1c _pthread_wqthread + 932
8   libsystem_pthread.dylib         0x00000001827d6b6c start_wqthread + 4


Thread 15:
0   libsystem_kernel.dylib          0x00000001826c4d80 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x00000001827d6b6c start_wqthread + 4


Thread 16:
0   libsystem_kernel.dylib          0x00000001826c460c __semwait_signal + 8
1   libsystem_c.dylib               0x0000000182645f34 sleep + 44
2   GOTit                           0x00000001028c21f4
3   libdispatch.dylib               0x0000000104a952cc
4   libdispatch.dylib               0x0000000104a9528c
5   libdispatch.dylib               0x0000000104aa3f80
6   libdispatch.dylib               0x0000000104a987ec
7   libdispatch.dylib               0x0000000104aa4f6c
8   libdispatch.dylib               0x0000000104aac020
9   libsystem_pthread.dylib         0x00000001827d6f1c _pthread_wqthread + 932
10  libsystem_pthread.dylib         0x00000001827d6b6c start_wqthread + 4


Thread 17:
0   libsystem_kernel.dylib          0x00000001826c4d80 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x00000001827d6b6c start_wqthread + 4


Thread 18:
0   libsystem_kernel.dylib          0x00000001826c460c __semwait_signal + 8
1   libsystem_c.dylib               0x0000000182645f34 sleep + 44
2   GOTit                           0x00000001028c21f4
3   libdispatch.dylib               0x0000000104a952cc
4   libdispatch.dylib               0x0000000104a9528c
5   libdispatch.dylib               0x0000000104aa3f80
6   libdispatch.dylib               0x0000000104a987ec
7   libdispatch.dylib               0x0000000104aa4f6c
8   libdispatch.dylib               0x0000000104aac020
9   libsystem_pthread.dylib         0x00000001827d6f1c _pthread_wqthread + 932
10  libsystem_pthread.dylib         0x00000001827d6b6c start_wqthread + 4


Thread 19:
0   libsystem_pthread.dylib         0x00000001827d6b68 start_wqthread + 0


Thread 20:
0   libsystem_kernel.dylib          0x00000001826c460c __semwait_signal + 8
1   libsystem_c.dylib               0x0000000182645f34 sleep + 44
2   GOTit                           0x00000001028c21f4
3   libdispatch.dylib               0x0000000104a952cc
4   libdispatch.dylib               0x0000000104a9528c
5   libdispatch.dylib               0x0000000104aa3f80
6   libdispatch.dylib               0x0000000104a987ec
7   libdispatch.dylib               0x0000000104aa4f6c
8   libdispatch.dylib               0x0000000104aac020
9   libsystem_pthread.dylib         0x00000001827d6f1c _pthread_wqthread + 932
10  libsystem_pthread.dylib         0x00000001827d6b6c start_wqthread + 4


Thread 21:
0   libsystem_kernel.dylib          0x00000001826c4d80 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x00000001827d6b6c start_wqthread + 4


Thread 22:
0   libsystem_kernel.dylib          0x00000001826c3e5c __open + 8
1   Foundation                      0x00000001834c6be8 _NSReadBytesFromFileWithExtendedAttributes + 132
2   Foundation                      0x00000001835405a8 -[NSData(NSData) initWithContentsOfFile:options:maxLength:error:] + 184
3   Foundation                      0x00000001834cb6ec +[NSData(NSData) dataWithContentsOfFile:options:error:] + 68
4   GOTit                           0x0000000102f181dc
5   GOTit                           0x0000000102f18780
6   GOTit                           0x0000000102f18eb0
7   libdispatch.dylib               0x0000000104a952cc
8   libdispatch.dylib               0x0000000104a9528c
9   libdispatch.dylib               0x0000000104aa3f80
10  libdispatch.dylib               0x0000000104a987ec
11  libdispatch.dylib               0x0000000104aa4f6c
12  libdispatch.dylib               0x0000000104aac020
13  libsystem_pthread.dylib         0x00000001827d6f1c _pthread_wqthread + 932
14  libsystem_pthread.dylib         0x00000001827d6b6c start_wqthread + 4


Thread 23:
0   libsystem_kernel.dylib          0x00000001826c4d80 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x00000001827d6b6c start_wqthread + 4


Thread 24:
0   libsystem_pthread.dylib         0x00000001827d6b68 start_wqthread + 0


Thread 25:
0   libsystem_kernel.dylib          0x00000001826c4d80 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x00000001827d6b6c start_wqthread + 4


Thread 26:
0   libsystem_kernel.dylib          0x00000001826c4d80 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x00000001827d6b6c start_wqthread + 4


Thread 27:
0   libsystem_pthread.dylib         0x00000001827d6b68 start_wqthread + 0


Thread 28:
0   libsystem_pthread.dylib         0x00000001827d6b68 start_wqthread + 0


Thread 29:
0   libsystem_kernel.dylib          0x00000001826c4d80 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x00000001827d6b6c start_wqthread + 4


Thread 30:
0   libsystem_kernel.dylib          0x00000001826c4d80 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x00000001827d6b6c start_wqthread + 4

2 个答案:

答案 0 :(得分:3)

我得到了同样的东西。这是一些额外的信息。

我的应用程序捕获图像,裁剪图像并重新调整图像后发生此崩溃。

崩溃信息显示用户只有6%的可用内存。

我怀疑我的图像处理管道中的某些东西无声地失败,可能是由于内存不足,然后产生了损坏的UIImage。然后,当我试图绘制它时,它会崩溃。

在我的情况下,我添加了一堆警卫和日志记录语句,以便在崩溃再次发生时我希望获得更多信息并能够发布解决方法。

答案 1 :(得分:2)

@ chris-garrett指出我正确的方向,我能够通过修复内存泄漏来大大缓解这个问题。

现在收到此错误的用户是在应用上花费至少30分钟的人,这种情况非常罕见。此外,它影响大多数大屏幕,如iPhone 7 / 6s / 8 Plus,iPhone X,需要更多内存来渲染图像,这将证实这一理论

解决这个问题应该做的是在调试时检查内存。如果在重复相同的动作时它会逐渐增加,那么你肯定可以解决这个问题。

enter image description here

有很多方法可以在您的应用中找到泄漏,我不是乐器的忠实粉丝,但如果需要,您可以在线找到许多教程。另一种选择是使用内存图。我之前写过一篇关于如何使用记忆图here的文章。