Skip to content

Crash in ImagePipeline #731

@wroluk

Description

@wroluk

Im using a LazyImage with a ImagePipeline.
It is crashing consistently when the image is being fetched.
Im using the latest Nuke release 12.1.6. (crashes as well on 12.0.0)

Here is the code. Below you can find the stacktrace.

@MainActor
public struct MyView: View {
    static let imagePipeline = ImagePipeline(configuration: .withDataCache(sizeLimit: 10 * 1024 * 1024))
    ...
    public var body: some View {
    ...
            LazyImage(url: url) { state in
                if let image = state.image {
                    image.resizable().aspectRatio(contentMode: .fill)
                } else if state.error != nil {
                    Color.clear // indicates an error
                } else {
                    Color.clear // acts as a placeholder
                }
            }.pipeline(Self.imagePipeline)
    ...
    }
}

Stacktrace:

Thread 11 Crashed:: Dispatch queue: com.github.kean.Nuke.ImagePipeline
0 0x110519cdc ???
1 0x10ade5c48 ???
2 libswiftCore.dylib 0x121aea63a Dictionary.subscript.getter + 154
3 DesignSystemFramework 0x1187561ac ImageRequest.scale.getter + 268
4 DesignSystemFramework 0x1187464cb ImageDecoders.Default.init(context:) + 251
5 DesignSystemFramework 0x1187463c4 ImageDecoders.Default.__allocating_init(context:) + 52
6 DesignSystemFramework 0x118744989 implicit closure #1 in ImageDecoderRegistry.init() + 73
7 DesignSystemFramework 0x1187449b3 thunk for @escaping @callee_guaranteed (@guaranteed ImageDecodingContext) -> (@owned ImageDecoders.Default?) + 19
8 DesignSystemFramework 0x11874508a thunk for @escaping @callee_guaranteed (@guaranteed ImageDecodingContext) -> (@out ImageDecoding?) + 42
9 DesignSystemFramework 0x11874504b thunk for @escaping @callee_guaranteed (@in_guaranteed ImageDecodingContext) -> (@out ImageDecoding?) + 75
10 DesignSystemFramework 0x118744e61 ImageDecoderRegistry.decoder(for:) + 721
11 DesignSystemFramework 0x11878dca9 closure #1 in variable initialization expression of ImagePipeline.Configuration.makeImageDecoder + 89
12 DesignSystemFramework 0x118790d9d ImagePipelineDelegate.imageDecoder(for:pipeline:) + 205
13 DesignSystemFramework 0x11879159d protocol witness for ImagePipelineDelegate.imageDecoder(for:pipeline:) in conformance ImagePipelineDefaultDelegate + 13
14 NukeUI_1A7D877EC7EDF7_PackageProduct 0x13ba94454 TaskFetchDecodedImage.getDecoder(for:) + 452
15 NukeUI_1A7D877EC7EDF7_PackageProduct 0x13ba93dce TaskFetchDecodedImage.didReceiveData(:urlResponse:isCompleted:) + 1118
16 NukeUI_1A7D877EC7EDF7_PackageProduct 0x13ba9392f closure #1 in TaskFetchDecodedImage.start() + 287
17 NukeUI_1A7D877EC7EDF7_PackageProduct 0x13ba8d4c9 closure #1 in AsyncTask.Publisher.subscribe(
:onValue:) + 777
18 NukeUI_1A7D877EC7EDF7_PackageProduct 0x13ba8d647 partial apply for closure #1 in AsyncTask.Publisher.subscribe(_:onValue:) + 55
19 NukeUI_1A7D877EC7EDF7_PackageProduct 0x13ba8bdc4 AsyncTask.send(event:) + 724
20 NukeUI_1A7D877EC7EDF7_PackageProduct 0x13ba8b896 AsyncTask.send(value:isCompleted:) + 310
21 NukeUI_1A7D877EC7EDF7_PackageProduct 0x13ba99170 TaskFetchOriginalImageData.dataTaskDidFinish(error:) + 832
22 NukeUI_1A7D877EC7EDF7_PackageProduct 0x13ba98e23 closure #1 in closure #2 in TaskFetchOriginalImageData.loadData(urlRequest:finish:) + 67
23 NukeUI_1A7D877EC7EDF7_PackageProduct 0x13ba10898 thunk for @escaping @callee_guaranteed () -> () + 40
24 libdispatch.dylib 0x11ffd4e40 _dispatch_call_block_and_release + 12
25 libdispatch.dylib 0x11ffd60d9 _dispatch_client_callout + 8
26 libdispatch.dylib 0x11ffddb23 _dispatch_lane_serial_drain + 1008
27 libdispatch.dylib 0x11ffde7ef _dispatch_lane_invoke + 400
28 libdispatch.dylib 0x11ffeb475 _dispatch_workloop_worker_thread + 873
29 libsystem_pthread.dylib 0x120eadc55 _pthread_wqthread + 327
30 libsystem_pthread.dylib 0x120eacbbf start_wqthread + 15

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions