Kingfisher
Kingfisher copied to clipboard
Crash when loading gif (Use the specified commit: 229f637beeb7b4ef81006e951a17a7cf2c52ccf0)
Check List
Thanks for considering to open an issue. Before you submit your issue, please confirm these boxes are checked.
- [x] I have read the wiki page and cheat sheet, but there is no information I need.
- [x] I have searched in existing issues, but did not find a same one.
- [x] I want to report a problem instead of asking a question. It'd better to use kingfisher tag in Stack Overflow to ask a question.
Issue Description
What
Crash when loading gif, use the specified commit: 229f637beeb7b4ef81006e951a17a7cf2c52ccf0 (A rare crash from _UIImageCGImageContent when loading GIF files on iOS 15 or later. https://github.com/onevcat/Kingfisher/pull/2004)
Reproduce
Hard to reproduce. I reproduced it on the first installation.
Other Comment
Here is the crash log:
Thread 2 name: Dispatch queue: com.onevcat.Kingfisher.Animator.preloadQueue
Thread 2 Crashed:
0 libsystem_platform.dylib 0x1e2524a74 _platform_memmove + 420
1 CoreFoundation 0x195d66b74 CFDataGetBytes + 380
2 ImageIO 0x19ae2f888 CGImageGetImageSource + 156
3 UIKitCore 0x197fd9dc4 -[_UIImageCGImageContent initWithCGImage:scale:] + 40
4 UIKitCore 0x197fd9d5c -[UIImage initWithCGImage:scale:orientation:] + 68
5 Rolls-Royce Whispers Live 0x10331a3a0 AnimatedImageView.Animator.loadFrame(at:) + 7316384 (AnimatedImageView.swift:558)
6 Rolls-Royce Whispers Live 0x10331a75c AnimatedImageView.Animator.updatePreloadedFrames() + 7317340 (AnimatedImageView.swift:591)
7 Rolls-Royce Whispers Live 0x102f9fbb8 thunk for @escaping @callee_guaranteed () -> () + 3668920 (
I got similar crash:
@xinyzhao
It seems that you are using an older version. Can you verify and get the same with the latest Kingfisher version 7.4.1?
@onevcat Sorry, I can't reproduce this problem on the new version.
We reproduced the problem:
Thread 14 name: Dispatch queue: com.onevcat.Kingfisher.Animator.preloadQueue
Thread 14 Crashed:
0 CoreFoundation 0x18ef16a8c CFDataGetBytes + 148
1 ImageIO 0x193fbf964 CGImageGetImageSource + 156
2 ImageIO 0x193fbf964 CGImageGetImageSource + 156
3 UIKitCore 0x19118acec -[_UIImageCGImageContent initWithCGImage:scale:] + 40
4 UIKitCore 0x19118ac84 -[UIImage initWithCGImage:scale:orientation:] + 68
5 Rolls-Royce Whispers Stage 0x102a103ac AnimatedImageView.Animator.loadFrame(at:) + 6931372 (AnimatedImageView.swift:558)
6 Rolls-Royce Whispers Stage 0x102a10770 AnimatedImageView.Animator.updatePreloadedFrames() + 6932336 (AnimatedImageView.swift:591)
7 Rolls-Royce Whispers Stage 0x1023f00f8 thunk for @escaping @callee_guaranteed () -> () + 508152 (<compiler-generated>:0)
8 libdispatch.dylib 0x1962904b4 _dispatch_call_block_and_release + 32
9 libdispatch.dylib 0x196291fdc _dispatch_client_callout + 20
10 libdispatch.dylib 0x196299694 _dispatch_lane_serial_drain + 672
11 libdispatch.dylib 0x19629a1e0 _dispatch_lane_invoke + 384
12 libdispatch.dylib 0x1962a4e10 _dispatch_workloop_worker_thread + 652
13 libsystem_pthread.dylib 0x1db489df8 _pthread_wqthread + 288
14 libsystem_pthread.dylib 0x1db489b98 start_wqthread + 8
Hi, @onevcat ,We reproduced the problem again

same problem version: 7.4.1 any ideas?
same error
version: 7.6.1