web-dev-qa-db-fra.com

Crash ERROR_CGDataProvider_BufferIsNotReadable + 12, CGDataProviderRetainBytePtr + 216

J'ai un plantage une fois toutes les 1000 à 2000 sessions dans notre application et je ne sais pas quoi faire à ce sujet.

Est-ce un Apple crash iOS où je ne peux rien faire?)

J'utilise le pod SDWebImage dans mon projet, c'est peut-être cela?

voici le journal des plantages:

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
26
Refael.S

@ chris-garrett m'a pointé dans la bonne direction et j'ai pu atténuer considérablement le problème en corrigeant les fuites de mémoire.

Les utilisateurs qui obtiennent maintenant cette erreur sont des personnes qui passent au moins 30 minutes sur l'application, ce qui est assez rare. En outre, le fait qu'il affecte principalement les grands écrans comme l'iPhone 7/6s/8 Plus, l'iPhone X, où davantage de mémoire est nécessaire pour rendre les images corroborerait cette théorie


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

enter image description here

Il existe de nombreuses 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 consiste à utiliser le graphique de la mémoire. J'ai écrit précédemment un article sur l'utilisation du graphe de mémoire ici .

2
streem

Je reçois la même chose. Voici quelques informations supplémentaires.

Ce plantage se produit après que mon application capture une image, la recadre et la redimensionne.

Les informations sur le crash ont montré que l'utilisateur n'avait que 6% de mémoire disponible.

Je soupçonne que quelque chose dans mon pipeline de traitement d'image échoue silencieusement, peut-être en raison d'un manque de mémoire, puis produit un UIImage corrompu. Ensuite, lorsque j'essaie de le dessiner, il se bloque.

Dans mon cas, j'ai ajouté un tas de gardes et de déclarations de journalisation afin que, lorsque le crash se reproduise, j'espère obtenir plus d'informations et pouvoir publier une solution de contournement.

3
Chris Garrett