YYImage icon indicating copy to clipboard operation
YYImage copied to clipboard

YYImageCoder crash in iOS 10 beta3

Open phoenixxyang opened this issue 8 years ago • 4 comments

We've encountered frequent crash while using YYWebImage in iOS 10 beta3.

Reproduce background:

  1. We have a UICollectionView to present lots of images(include jpeg and gif), and it is able to load more images in pages.
  2. All the presented images are loaded with URLs. Reproduce procedure: Just swipe the UICollectionView rapidly to load more images.

Here are two stack frame of crashed thread:

Stack Frame One: // the relevant image is http://img04.sogoucdn.com/app/a/200678/146711412524012.gif

Thread 10 name: com.ibireme.webimage.request Thread 10 Crashed: 0 vImage 0x0000000182b10dc0 0x182b07000 + 40384 1 vImage 0x0000000182b095a0 0x182b07000 + 9632 2 CoreGraphics 0x0000000182ea12e8 0x182e6e000 + 209640 3 CoreGraphics 0x00000001830816c4 0x182e6e000 + 2176708 4 CoreGraphics 0x000000018310d484 0x182e6e000 + 2749572 5 CoreGraphics 0x000000018310a094 0x182e6e000 + 2736276 6 CoreGraphics 0x000000018306ace4 0x182e6e000 + 2084068 7 CoreGraphics 0x000000018305ac74 0x182e6e000 + 2018420 8 MyApp 0x00000001003072e8 YYCGImageCreateDecodedCopy (YYImageCoder.m:890) 9 MyApp 0x000000010030a7f0 -YYImageDecoder _newUnblendedImageAtIndex:extendToCanvas:decoded: 10 MyApp 0x0000000100308fcc -YYImageDecoder _frameAtIndex:decodeForDisplay: 11 MyApp 0x0000000100308bb4 -YYImageDecoder frameAtIndex:decodeForDisplay: 12 MyApp 0x000000010031d6b8 -YYWebImageOperation connection:didReceiveData: 13 CFNetwork 0x00000001822e33e0 0x1820d5000 + 2155488 14 CFNetwork 0x00000001822e3370 0x1820d5000 + 2155376 15 CFNetwork 0x00000001822e34e4 0x1820d5000 + 2155748 16 CFNetwork 0x00000001822a2c5c 0x1820d5000 + 1891420 17 CFNetwork 0x000000018220b4c4 0x1820d5000 + 1270980 18 CFNetwork 0x000000018220a638 0x1820d5000 + 1267256 19 libdispatch.dylib 0x0000000181529784 0x181528000 + 6020 20 libdispatch.dylib 0x0000000181534f80 0x181528000 + 53120 21 CFNetwork 0x00000001822c154c 0x1820d5000 + 2016588 22 CoreFoundation 0x00000001819bb238 0x1819b3000 + 33336 23 CFNetwork 0x00000001822c1430 0x1820d5000 + 2016304 24 CFNetwork 0x00000001822c2758 0x1820d5000 + 2021208 25 CFNetwork 0x00000001822c24c4 0x1820d5000 + 2020548 26 CoreFoundation 0x0000000181a8e418 0x1819b3000 + 898072 27 CoreFoundation 0x0000000181a8dd60 0x1819b3000 + 896352 28 CoreFoundation 0x0000000181a8b960 0x1819b3000 + 887136 29 CoreFoundation 0x00000001819bb8d8 0x1819b3000 + 35032 30 Foundation 0x0000000182458e3c 0x18244c000 + 52796 31 Foundation 0x00000001824ad584 0x18244c000 + 398724 32 MyApp 0x000000010031b290 +YYWebImageOperation _networkThreadMain: 33 Foundation 0x00000001825553ac 0x18244c000 + 1086380 34 libsystem_pthread.dylib 0x00000001817339ec 0x181730000 + 14828 35 libsystem_pthread.dylib 0x00000001817338fc 0x181730000 + 14588 36 libsystem_pthread.dylib 0x0000000181730ef8 0x181730000 + 3832

Stack Frame Two:

<NSThread: 0x17447bc00>{number = 9, name = com.ibireme.webimage.request} <_NSCallStackArray 0x1704493c0>( 0 ??? 0x000000010d048a74 0x0 + 4513368692, 1 MyApp 0x0000000100479d44 main + 0, 2 ImageIO 0x000000018379b174 + 32, 3 ImageIO 0x00000001838d2d1c + 1252, 4 ImageIO 0x00000001838d4fe4 + 88, 5 ImageIO 0x00000001836e0aec + 1084, 6 ImageIO 0x00000001836e1c38 + 68, 7 ImageIO 0x00000001836e1bb8 + 100, 8 ImageIO 0x00000001836e4764 CGImageSourceCopyPropertiesAtIndex + 188, 9 MyApp 0x000000010058cf04 -[YYImageDecoder _updateSourceImageIO] + 1320, 10 MyApp 0x000000010058b8a8 -[YYImageDecoder _updateSource] + 160, 11 MyApp 0x000000010058ac80 -[YYImageDecoder _updateData:final:] + 524, 12 MyApp 0x000000010058a6c4 -[YYImageDecoder updateData:final:] + 128, 13 MyApp 0x00000001005aff20 -[YYWebImageOperation connection:didReceiveData:] + 1284, 14 CFNetwork 0x00000001822e33e0 + 80, 15 CFNetwork 0x00000001822e3370 + 200, 16 CFNetwork 0x00000001822e34e4 + 56, 17 CFNetwork 0x00000001822a2c5c + 76, 18 CFNetwork 0x000000018220b4c4 + 272, 19 CFNetwork 0x000000018220a638 + 108, 20 libdispatch.dylib 0x0000000100e21954 _dispatch_client_callout + 16, 21 libdispatch.dylib 0x0000000100e2c26c _dispatch_block_invoke_direct + 400, 22 CFNetwork 0x00000001822c154c + 36, 23 CoreFoundation 0x00000001819bb238 CFArrayApplyFunction + 68, 24 CFNetwork 0x00000001822c1430 + 136, 25 CFNetwork 0x00000001822c2758 + 312, 26 CFNetwork 0x00000001822c24c4 + 64, 27 CoreFoundation 0x0000000181a8e418 + 24, 28 CoreFoundation 0x0000000181a8dd60 + 524, 29 CoreFoundation 0x0000000181a8b960 + 804, 30 CoreFoundation 0x00000001819bb8d8 CFRunLoopRunSpecific + 444, 31 Foundation 0x0000000182458e3c + 304, 32 Foundation 0x00000001824ad584 + 88, 33 MyApp 0x00000001005ac3f8 +[YYWebImageOperation _networkThreadMain:] + 308, 34 Foundation 0x00000001825553ac + 1024, 35 libsystem_pthread.dylib 0x00000001817339ec + 240, 36 libsystem_pthread.dylib 0x00000001817338fc + 0, 37 libsystem_pthread.dylib 0x0000000181730ef8 thread_start + 4 )

phoenixxyang avatar Jul 28 '16 03:07 phoenixxyang

Attached two full crash stack frames.

MyApp 7-28-16, 12-13.crash.txt

MyApp 7-28-16, 12-12.crash.txt

phoenixxyang avatar Jul 28 '16 04:07 phoenixxyang

Workaround: Replace YYWebImageOptionProgressive with other available option while setImageWithURL, however this might delay your images displaying.

phoenixxyang avatar Jul 28 '16 08:07 phoenixxyang

hi! How did you solve this problem later?

achuge2008 avatar Oct 11 '19 02:10 achuge2008

How did you solve this problem later?

DMDavid avatar Jul 12 '21 11:07 DMDavid