Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rare crash in KingfisherWrapper #2011

Open
3 tasks done
pwadowski opened this issue Dec 1, 2022 · 3 comments
Open
3 tasks done

Rare crash in KingfisherWrapper #2011

pwadowski opened this issue Dec 1, 2022 · 3 comments

Comments

@pwadowski
Copy link

Check List

Issue Description

What

Recently we got a crash report on Firebase that KingfisherWrapper.draw have crashed couple of times. It is not common so it is not high priority but still we decided to report it. Crash is Crashed: EXC_BAD_ACCESS KERN_INVALID_ADDRESS on com.onevcat.Kingfisher.ImageDownloader.Process queue. The stack trace is:

Crashed: com.onevcat.Kingfisher.ImageDownloader.Process
0  CoreGraphics                   0xd6c8 img_data_lock + 5492
1  CoreGraphics                   0x58e04 CGSImageDataLock + 1320
2  CoreGraphics                   0x27ee4 ripc_AcquireRIPImageData + 772
3  CoreGraphics                   0x47810 ripc_DrawImage + 804
4  CoreGraphics                   0x3e058 CG::DisplayList::executeEntries(std::__1::__wrap_iter<std::__1::unique_ptr<CG::DisplayListEntry const, std::__1::default_delete<CG::DisplayListEntry const> >*>, std::__1::__wrap_iter<std::__1::unique_ptr<CG::DisplayListEntry const, std::__1::default_delete<CG::DisplayListEntry const> >*>, CGContextDelegate*, CGRenderingState*, CGGStack*, CGRect const*, __CFDictionary const*, bool) + 4948
5  CoreGraphics                   0x322fc CGDisplayListDrawInContextDelegate + 268
6  CoreGraphics                   0x75fa0 rip_auto_context_rasterization_loop + 1924
7  CoreGraphics                   0xa36dc rip_auto_context_create_image + 56
8  UIKitCore                      0x1ba064 -[UIGraphicsImageRendererContext currentImage] + 32
9  UIKitCore                      0x1ba014 __44-[UIGraphicsImageRenderer imageWithActions:]_block_invoke + 28
10 UIKitCore                      0x1ba400 -[UIGraphicsRenderer runDrawingActions:completionActions:format:error:] + 360
11 UIKitCore                      0x1ba270 -[UIGraphicsRenderer runDrawingActions:completionActions:error:] + 92
12 UIKitCore                      0x1ba19c -[UIGraphicsImageRenderer imageWithActions:] + 184
13 Kingfisher                     0x4e384 specialized KingfisherWrapper<A>.draw(to:inverting:scale:refImage:draw:) + 598 (ImageDrawing.swift:598)
14 Kingfisher                     0x50dc0 ResizingImageProcessor.process(item:options:) + 231 (ImageDrawing.swift:231)
15 Kingfisher                     0x50e60 protocol witness for ImageProcessor.process(item:options:) in conformance ResizingImageProcessor + 40 (<compiler-generated>:40)
16 CCCImages                      0x67bc SizeValidatingImageProcessor.process(item:options:) + 41 (SizeValidatingImageProcessor.swift:41)
17 CCCImages                      0x6828 protocol witness for ImageProcessor.process(item:options:) in conformance SizeValidatingImageProcessor + 1064 (<compiler-generated>:1064)
18 Kingfisher                     0x4f438 partial apply for closure #1 in ImageProcessor.append(another:) + 93 (ImageProcessor.swift:93)
19 Kingfisher                     0x4f328 protocol witness for ImageProcessor.process(item:options:) in conformance GeneralProcessor + 20 (<compiler-generated>:20)
20 CCCImages                      0x6764 SizeValidatingImageProcessor.process(item:options:) + 43 (SizeValidatingImageProcessor.swift:43)
21 CCCImages                      0x6828 protocol witness for ImageProcessor.process(item:options:) in conformance SizeValidatingImageProcessor + 1064 (<compiler-generated>:1064)
22 Kingfisher                     0x39344 ImageDataProcessor.doProcess() + 58 (ImageDataProcessor.swift:58)
23 Kingfisher                     0x38fa4 implicit closure #2 in implicit closure #1 in ImageDataProcessor.process() + 20 (<compiler-generated>:20)
24 Kingfisher                     0xeea0 partial apply for closure #1 in CallbackQueue.execute(_:) + 20 (<compiler-generated>:20)
25 Kingfisher                     0xe964 thunk for @escaping @callee_guaranteed () -> () + 28 (<compiler-generated>:28)
26 libdispatch.dylib              0x24b4 _dispatch_call_block_and_release + 32
27 libdispatch.dylib              0x3fdc _dispatch_client_callout + 20
28 libdispatch.dylib              0xb694 _dispatch_lane_serial_drain + 672
29 libdispatch.dylib              0xc1e0 _dispatch_lane_invoke + 384
30 libdispatch.dylib              0x16e10 _dispatch_workloop_worker_thread + 652
31 libsystem_pthread.dylib        0xdf8 _pthread_wqthread + 288
32 libsystem_pthread.dylib        0xb98 start_wqthread + 8

SizeValidatingImageProcessor is our simple wrapper for ResizingImageProcessor and it doesn't configure it in any way.

Reproduce

Unfortunately, we don't have steps of reproduction. The only thing what I can say is that the image was normal jpg, something like this.

Other Comment

Kingfisher version: 7.4.0
iOS version: 16.0.x

@onevcat
Copy link
Owner

onevcat commented Dec 7, 2022

@pwadowski Thanks for reporting this!

May I know what is the signal when the crash happens? Is it a SIGSEGV or a SIGBUS? (it should follow the EXC_BAD_ACCESS segment in your full crash log).

@pwadowski
Copy link
Author

Sorry for late response. As I see it is neither SIGSEGV nor SIGBUS. I see it is KERN_INVALID_ADDRESS
Zrzut ekranu 2023-01-11 o 06 59 20

@pwadowski
Copy link
Author

Hi again
We again get some of these crashes on version 7.6.2. The same message and the same stack trace.
Additionally, we got one new crash, but I'm not sure is it connected to this.
Zrzut ekranu 2023-04-18 o 10 42 55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants