Crash ERROR CGDataProvider BufferIsNotReadable + 12, CGDataProviderRetainBytePtr + 216

j'ai un crash une fois tous les 1000 à 2000 sessions dans notre application et je ne peux pas comprendre ce qu'il faut faire à ce sujet.

Est-ce que C'est un crash D'Apple iOS où je ne peux rien y faire?

j'utilise SDWebImage pod dans mon projet, c'est peut-être ça?

voici le crash log:

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
24
demandé sur Refael.S 2018-01-12 03:26:56

2 réponses

@chris-garrett m'a indiqué la bonne direction et j'ai pu grandement atténuer le problème en réparant les fuites de mémoire.

les utilisateurs qui ont maintenant cette erreur sont ceux qui passent au moins 30 minutes sur l'application, ce qui est assez rare. Aussi, le fait qu'elle affecte principalement les grands écrans comme l'iPhone 7/6/8. de Plus, iPhone X, où plus de mémoire est nécessaire pour rendre des images corroborer cette théorie


Ce que vous devez faire pour résoudre ce problème, est de vérifier la mémoire pendant le débogage. Si elle augmente progressivement en répétant les mêmes actions, il y a certainement quelque chose à corriger.

enter image description here

il y a plusieurs façons de trouver des fuites dans votre application, Je ne suis pas un grand fan D'Instruments, mais vous pouvez trouver de nombreux tutoriels en ligne si nécessaire. Une autre option est d'utiliser le graphe de mémoire. J'ai écrit précédemment un article sur l'utilisation de la mémoire graphique ici.

2
répondu streem 2018-01-31 19:29:56

j'obtiens la même chose. Voici quelques informations supplémentaires.

ce crash se produit après que mon application capture une image, la recycle et la restaure.

L'information de crash a montré que l'utilisateur avait seulement 6% de mémoire disponible.

je soupçonne que quelque chose dans mon pipeline de traitement d'image échoue silencieusement, probablement en raison de manquer de mémoire, et produit alors un UIImage corrompu. Quand j'essaie de le dessiner, il s'écrase.

Dans mon cas, j'ai ajouté un tas des gardes et des déclarations de journalisation de sorte que lorsque le crash se produit à nouveau, j'espère obtenir plus d'informations et être en mesure de poster une solution de contournement.

3
répondu Chris Garrett 2018-01-19 13:19:31