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

startImageTask causing memory issue and crashing the app #798

Open
jcbriones opened this issue Jul 24, 2024 · 6 comments
Open

startImageTask causing memory issue and crashing the app #798

jcbriones opened this issue Jul 24, 2024 · 6 comments

Comments

@jcbriones
Copy link

This function is crashing the app. Not sure what has changed but there's a lot of crashes from time to time with the following function

   private func makeStartedImageTask(with request: ImageRequest, isDataTask: Bool = false, onEvent: ((ImageTask.Event, ImageTask) -> Void)? = nil) -> ImageTask {
        let task = ImageTask(taskId: nextTaskId, request: request, isDataTask: isDataTask, pipeline: self, onEvent: onEvent)
        // Important to call it before `imageTaskStartCalled`
        if !isDataTask {
            delegate.imageTaskCreated(task, pipeline: self)
        }
        task._task = Task {
            try await withUnsafeThrowingContinuation { continuation in
                self.queue.async {
                    task._continuation = continuation
                    self.startImageTask(task, isDataTask: isDataTask)
                }
            }
        }
        return task
    }
@kean
Copy link
Owner

kean commented Jul 25, 2024

Hey, could you please share a bit more details, including a crash log and the OS version.

@jcbriones
Copy link
Author

I'll send it over once I got more details as well.

@jcbriones
Copy link
Author

This is running on a simulator and debug mode. iOS 17.5 | iPhone Simulator 15 Pro Max.

Stack trace:
#0 0x000000018005f014 in objc_msgSend ()
#1 0x0000000180442a38 in CFStringCreateByCombiningStrings ()
#2 0x00000001844decd4 in ___lldb_unnamed_symbol12097 ()
#3 0x00000001803c8ee0 in __CFDictionaryApplyFunction_block_invoke ()
#4 0x00000001804dd528 in CFBasicHashApply ()
#5 0x00000001803c8e98 in CFDictionaryApplyFunction ()
#6 0x00000001844dec6c in ___lldb_unnamed_symbol12096 ()
#7 0x00000001843d7278 in ___lldb_unnamed_symbol6198 ()
#8 0x00000001843bb3a8 in ___lldb_unnamed_symbol5761 ()
#9 0x0000000184377168 in ___lldb_unnamed_symbol4305 ()
#10 0x000000010aaa9e4c in _dispatch_block_async_invoke2 ()
#11 0x000000010aa9973c in _dispatch_client_callout ()
#12 0x000000010aaa1a30 in _dispatch_lane_serial_drain ()
#13 0x000000010aaa2774 in _dispatch_lane_invoke ()
#14 0x000000010aaaf1a8 in _dispatch_root_queue_drain_deferred_wlh ()
#15 0x000000010aaae604 in _dispatch_workloop_worker_thread ()
#16 0x000000010a9f3814 in _pthread_wqthread ()
Enqueued from com.apple.NSURLSession-work (Thread 21) Queue : com.apple.NSURLSession-work (serial)
#0 0x000000010aa9eaa4 in dispatch_async ()
#1 0x0000000184375c94 in ___lldb_unnamed_symbol4293 ()
#2 0x000000018437b118 in ___lldb_unnamed_symbol4341 ()
#3 0x00000001845024d0 in ___lldb_unnamed_symbol12885 ()
#4 0x000000018453ab54 in ___lldb_unnamed_symbol14224 ()
#5 0x000000018439f580 in ___lldb_unnamed_symbol5223 ()
#6 0x000000018439f508 in ___lldb_unnamed_symbol5222 ()
#7 0x000000010aaa9e4c in _dispatch_block_async_invoke2 ()
#8 0x000000010aa9973c in _dispatch_client_callout ()
#9 0x000000010aaa1a30 in _dispatch_lane_serial_drain ()
#10 0x000000010aaa2774 in _dispatch_lane_invoke ()
#11 0x000000010aaaf1a8 in _dispatch_root_queue_drain_deferred_wlh ()
#12 0x000000010aaae604 in _dispatch_workloop_worker_thread ()
#13 0x000000010a9f3814 in _pthread_wqthread ()
#14 0x000000010a9f25d4 in start_wqthread ()
Enqueued from com.apple.NSURLSession-work (Thread 21) Queue : com.apple.NSURLSession-work (serial)
#0 0x000000010aa9eaa4 in dispatch_async ()
#1 0x000000018439f2d4 in ___lldb_unnamed_symbol5217 ()
#2 0x000000018439f4b8 in ___lldb_unnamed_symbol5220 ()
#3 0x000000010aa97ec4 in _dispatch_call_block_and_release ()
#4 0x000000010aa9973c in _dispatch_client_callout ()
#5 0x000000010aaa1a30 in _dispatch_lane_serial_drain ()
#6 0x000000010aaa2774 in _dispatch_lane_invoke ()
#7 0x000000010aaaf1a8 in _dispatch_root_queue_drain_deferred_wlh ()
#8 0x000000010aaae604 in _dispatch_workloop_worker_thread ()
#9 0x000000010a9f3814 in _pthread_wqthread ()
#10 0x000000010a9f25d4 in start_wqthread ()
Enqueued from (Thread 24) Queue : (serial)
#0 0x000000010aa9eaa4 in dispatch_async ()
#1 0x000000018431e8e4 in ___lldb_unnamed_symbol2850 ()
#2 0x0000000105566638 in thunk for @escaping @callee_unowned @convention(block) @sendable (@unowned NSCachedURLResponse?) -> () ()
#3 0x00000001055663e0 in DataLoader.urlSession(:dataTask:willCacheResponse:completionHandler:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Loading/DataLoader.swift:217
#4 0x00000001055665e0 in @objc DataLoader.urlSession(:dataTask:willCacheResponse:completionHandler:) ()
#5 0x000000018431e818 in ___lldb_unnamed_symbol2849 ()
#6 0x0000000180d9ec04 in NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK ()
#7 0x0000000180d9eaf8 in -[NSBlockOperation main] ()
#8 0x0000000180da17ec in NSOPERATION_IS_INVOKING_MAIN ()
#9 0x0000000180d9dd58 in -[NSOperation start] ()
#10 0x0000000180da1f58 in NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION ()
#11 0x0000000180da1c68 in __NSOQSchedule_f ()
#12 0x000000010aaa9e4c in _dispatch_block_async_invoke2 ()
#13 0x000000010aa9973c in _dispatch_client_callout ()
#14 0x000000010aa9cc14 in _dispatch_continuation_pop ()
#15 0x000000010aa9bba0 in _dispatch_async_redirect_invoke ()
#16 0x000000010aaad36c in _dispatch_root_queue_drain ()
#17 0x000000010aaadf18 in _dispatch_worker_thread2 ()
#18 0x000000010a9f37d8 in _pthread_wqthread ()
#19 0x000000010a9f25d4 in start_wqthread ()
Enqueued from com.apple.NSURLSession-work (Thread 21) Queue : com.apple.NSURLSession-work (serial)
#0 0x000000010aa9eaa4 in dispatch_async ()
#1 0x0000000180d9be2c in __NSOQSchedule ()
#2 0x0000000180d9fa78 in __addOperations ()
#3 0x000000018431e664 in ___lldb_unnamed_symbol2848 ()
#4 0x000000018431e6cc in ___lldb_unnamed_symbol2848 ()
#5 0x000000018439f11c in ___lldb_unnamed_symbol5214 ()
#6 0x000000018439ec78 in ___lldb_unnamed_symbol5210 ()
#7 0x000000018439ef8c in ___lldb_unnamed_symbol5211 ()
#8 0x000000018439eec8 in ___lldb_unnamed_symbol5211 ()
#9 0x000000010aaa9e4c in _dispatch_block_async_invoke2 ()
#10 0x000000010aa9973c in _dispatch_client_callout ()
#11 0x000000010aaa1a30 in _dispatch_lane_serial_drain ()
#12 0x000000010aaa2774 in _dispatch_lane_invoke ()
#13 0x000000010aaaf1a8 in _dispatch_root_queue_drain_deferred_wlh ()
#14 0x000000010aaae604 in _dispatch_workloop_worker_thread ()
#15 0x000000010a9f3814 in _pthread_wqthread ()
#16 0x000000010a9f25d4 in start_wqthread ()
Enqueued from com.apple.NSURLSession-work (Thread 21) Queue : com.apple.NSURLSession-work (serial)
#0 0x000000010aa9eaa4 in dispatch_async ()
#1 0x000000018439f2d4 in ___lldb_unnamed_symbol5217 ()
#2 0x000000018439f90c in ___lldb_unnamed_symbol5228 ()
#3 0x000000010aa97ec4 in _dispatch_call_block_and_release ()
#4 0x000000010aa9973c in _dispatch_client_callout ()
#5 0x000000010aaa1a30 in _dispatch_lane_serial_drain ()
#6 0x000000010aaa2774 in _dispatch_lane_invoke ()
#7 0x000000010aaaf1a8 in _dispatch_root_queue_drain_deferred_wlh ()
#8 0x000000010aaae604 in _dispatch_workloop_worker_thread ()
#9 0x000000010a9f3814 in _pthread_wqthread ()
#10 0x000000010a9f25d4 in start_wqthread ()
Enqueued from (Thread 16) Queue : (serial)
#0 0x000000010aa9eaa4 in dispatch_async ()
#1 0x0000000180d9ec04 in NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK ()
#2 0x0000000180d9eaf8 in -[NSBlockOperation main] ()
#3 0x0000000180da17ec in NSOPERATION_IS_INVOKING_MAIN ()
#4 0x0000000180d9dd58 in -[NSOperation start] ()
#5 0x0000000180da1f58 in NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION ()
#6 0x0000000180da1c68 in __NSOQSchedule_f ()
#7 0x000000010aaa9e4c in _dispatch_block_async_invoke2 ()
#8 0x000000010aa9973c in _dispatch_client_callout ()
#9 0x000000010aa9cc14 in _dispatch_continuation_pop ()
#10 0x000000010aa9bba0 in _dispatch_async_redirect_invoke ()
#11 0x000000010aaad36c in _dispatch_root_queue_drain ()
#12 0x000000010aaadf18 in _dispatch_worker_thread2 ()
#13 0x000000010a9f37d8 in _pthread_wqthread ()
#14 0x000000010a9f25d4 in start_wqthread ()
Enqueued from com.apple.NSURLSession-work (Thread 24) Queue : com.apple.NSURLSession-work (serial)
#0 0x000000010aa9eaa4 in dispatch_async ()
#1 0x0000000180d9be2c in __NSOQSchedule ()
#2 0x0000000180d9fa78 in __addOperations ()
#3 0x000000018431e288 in ___lldb_unnamed_symbol2844 ()
#4 0x000000018431e208 in ___lldb_unnamed_symbol2844 ()
#5 0x000000018439f828 in ___lldb_unnamed_symbol5227 ()
#6 0x000000018439ec78 in ___lldb_unnamed_symbol5210 ()
#7 0x000000018439ef8c in ___lldb_unnamed_symbol5211 ()
#8 0x000000010aaa9e4c in _dispatch_block_async_invoke2 ()
#9 0x000000010aa9973c in _dispatch_client_callout ()
#10 0x000000010aaa1a30 in _dispatch_lane_serial_drain ()
#11 0x000000010aaa2774 in _dispatch_lane_invoke ()
#12 0x000000010aaaf1a8 in _dispatch_root_queue_drain_deferred_wlh ()
#13 0x000000010aaae604 in _dispatch_workloop_worker_thread ()
#14 0x000000010a9f3814 in _pthread_wqthread ()
#15 0x000000010a9f25d4 in start_wqthread ()
Enqueued from com.apple.NSURLSession-work (Thread 24) Queue : com.apple.NSURLSession-work (serial)
#0 0x000000010aa9eaa4 in dispatch_async ()
#1 0x000000018439f2d4 in ___lldb_unnamed_symbol5217 ()
#2 0x00000001843a0a08 in ___lldb_unnamed_symbol5264 ()
#3 0x0000000184332090 in ___lldb_unnamed_symbol3249 ()
#4 0x000000018432ff20 in ___lldb_unnamed_symbol3171 ()
#5 0x000000010aa97ec4 in _dispatch_call_block_and_release ()
#6 0x000000010aa9973c in _dispatch_client_callout ()
#7 0x000000010aaa1a30 in _dispatch_lane_serial_drain ()
#8 0x000000010aaa2774 in _dispatch_lane_invoke ()
#9 0x000000010aaaf1a8 in _dispatch_root_queue_drain_deferred_wlh ()
#10 0x000000010aaae604 in _dispatch_workloop_worker_thread ()
#11 0x000000010a9f3814 in _pthread_wqthread ()
#12 0x000000010a9f25d4 in start_wqthread ()
Enqueued from (Thread 16) Queue : (serial)
#0 0x000000010aa9eaa4 in dispatch_async ()
#1 0x000000018431dbbc in ___lldb_unnamed_symbol2838 ()
#2 0x00000001055637c0 in thunk for @escaping @callee_unowned @convention(block) (@unowned NSURLSessionResponseDisposition) -> () ()
#3 0x0000000105563530 in DataLoader.urlSession(:dataTask:didReceive:completionHandler:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Loading/DataLoader.swift:169
#4 0x0000000105563768 in @objc DataLoader.urlSession(:dataTask:didReceive:completionHandler:) ()
#5 0x000000010c404498 in -[NRURLSessionTaskDelegateBase URLSession:dataTask:didReceiveResponse:completionHandler:] ()
#6 0x000000018431dafc in ___lldb_unnamed_symbol2837 ()
#7 0x0000000180d9ec04 in NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK ()
#8 0x0000000180d9eaf8 in -[NSBlockOperation main] ()
#9 0x0000000180da17ec in NSOPERATION_IS_INVOKING_MAIN ()
#10 0x0000000180d9dd58 in -[NSOperation start] ()
#11 0x0000000180da1f58 in NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION ()
#12 0x0000000180da1c68 in __NSOQSchedule_f ()
#13 0x000000010aaa9e4c in _dispatch_block_async_invoke2 ()
#14 0x000000010aa9973c in _dispatch_client_callout ()
#15 0x000000010aa9cc14 in _dispatch_continuation_pop ()
#16 0x000000010aa9bba0 in _dispatch_async_redirect_invoke ()
#17 0x000000010aaad36c in _dispatch_root_queue_drain ()
#18 0x000000010aaadf18 in _dispatch_worker_thread2 ()
#19 0x000000010a9f37d8 in _pthread_wqthread ()
#20 0x000000010a9f25d4 in start_wqthread ()
Enqueued from com.apple.NSURLSession-work (Thread 24) Queue : com.apple.NSURLSession-work (serial)
#0 0x000000010aa9eaa4 in dispatch_async ()
#1 0x0000000180d9be2c in __NSOQSchedule ()
#2 0x0000000180d9fa78 in __addOperations ()
#3 0x000000018431d950 in ___lldb_unnamed_symbol2836 ()
#4 0x000000018431d9b0 in ___lldb_unnamed_symbol2836 ()
#5 0x000000018432f5b4 in ___lldb_unnamed_symbol3164 ()
#6 0x00000001843313f8 in ___lldb_unnamed_symbol3210 ()
#7 0x00000001843a0928 in ___lldb_unnamed_symbol5263 ()
#8 0x000000018439ec78 in ___lldb_unnamed_symbol5210 ()
#9 0x000000018439e210 in ___lldb_unnamed_symbol5192 ()
#10 0x00000001843a12ac in ___lldb_unnamed_symbol5299 ()
#11 0x000000018448ad4c in ___lldb_unnamed_symbol9903 ()
#12 0x00000001843a1978 in ___lldb_unnamed_symbol5337 ()
#13 0x000000010aaa9e4c in _dispatch_block_async_invoke2 ()
#14 0x000000010aa9973c in _dispatch_client_callout ()
#15 0x000000010aaa1a30 in _dispatch_lane_serial_drain ()
#16 0x000000010aaa2774 in _dispatch_lane_invoke ()
#17 0x000000010aaaf1a8 in _dispatch_root_queue_drain_deferred_wlh ()
#18 0x000000010aaae604 in _dispatch_workloop_worker_thread ()
#19 0x000000010a9f3814 in _pthread_wqthread ()
#20 0x000000010a9f25d4 in start_wqthread ()
Enqueued from com.apple.CFNetwork.LoaderQ (Thread 24) Queue : com.apple.CFNetwork.LoaderQ (serial)
#0 0x000000010aa9eaa4 in dispatch_async ()
#1 0x000000018439f2d4 in ___lldb_unnamed_symbol5217 ()
#2 0x00000001843a103c in ___lldb_unnamed_symbol5285 ()
#3 0x000000018448a0a0 in ___lldb_unnamed_symbol9890 ()
#4 0x000000018448a658 in ___lldb_unnamed_symbol9895 ()
#5 0x0000000184487a7c in ___lldb_unnamed_symbol9767 ()
#6 0x00000001845279a0 in ___lldb_unnamed_symbol13812 ()
#7 0x000000010aa97ec4 in _dispatch_call_block_and_release ()
#8 0x000000010aa9973c in _dispatch_client_callout ()
#9 0x000000010aaa1a30 in _dispatch_lane_serial_drain ()
#10 0x000000010aaa2774 in _dispatch_lane_invoke ()
#11 0x000000010aaa36e4 in _dispatch_workloop_invoke ()
#12 0x000000010aaaf1a8 in _dispatch_root_queue_drain_deferred_wlh ()
#13 0x000000010aaae604 in _dispatch_workloop_worker_thread ()
#14 0x000000010a9f3814 in _pthread_wqthread ()
#15 0x000000010a9f25d4 in start_wqthread ()
Enqueued from com.apple.NSURLSession-work (Thread 24) Queue : com.apple.NSURLSession-work (serial)
#0 0x000000010aa9eaa4 in dispatch_async ()
#1 0x00000001845278a0 in ___lldb_unnamed_symbol13809 ()
#2 0x0000000184487a08 in ___lldb_unnamed_symbol9766 ()
#3 0x000000018448a51c in ___lldb_unnamed_symbol9893 ()
#4 0x000000010aa97ec4 in _dispatch_call_block_and_release ()
#5 0x000000010aa9973c in _dispatch_client_callout ()
#6 0x000000010aaa1a30 in _dispatch_lane_serial_drain ()
#7 0x000000010aaa2774 in _dispatch_lane_invoke ()
#8 0x000000010aaaf1a8 in _dispatch_root_queue_drain_deferred_wlh ()
#9 0x000000010aaae604 in _dispatch_workloop_worker_thread ()
#10 0x000000010a9f3814 in _pthread_wqthread ()
#11 0x000000010a9f25d4 in start_wqthread ()
Enqueued from com.apple.NSURLSession-work (Thread 24) Queue : com.apple.NSURLSession-work (serial)
#0 0x000000010aa9eaa4 in dispatch_async ()
#1 0x000000018448a338 in ___lldb_unnamed_symbol9892 ()
#2 0x000000018437a190 in ___lldb_unnamed_symbol4325 ()
#3 0x0000000184379e4c in ___lldb_unnamed_symbol4322 ()
#4 0x0000000184502538 in ___lldb_unnamed_symbol12887 ()
#5 0x000000018448a2ac in ___lldb_unnamed_symbol9891 ()
#6 0x000000018453ab54 in ___lldb_unnamed_symbol14224 ()
#7 0x0000000184484cb0 in ___lldb_unnamed_symbol9686 ()
#8 0x000000018439ed6c in ___lldb_unnamed_symbol5211 ()
#9 0x00000001843a0f40 in ___lldb_unnamed_symbol5279 ()
#10 0x000000010aaa9e4c in _dispatch_block_async_invoke2 ()
#11 0x000000010aa9973c in _dispatch_client_callout ()
#12 0x000000010aaa1a30 in _dispatch_lane_serial_drain ()
#13 0x000000010aaa2774 in _dispatch_lane_invoke ()
#14 0x000000010aaaf1a8 in _dispatch_root_queue_drain_deferred_wlh ()
#15 0x000000010aaae604 in _dispatch_workloop_worker_thread ()
#16 0x000000010a9f3814 in _pthread_wqthread ()
#17 0x000000010a9f25d4 in start_wqthread ()
Enqueued from com.apple.NSURLSession-work (Thread 24) Queue : com.apple.NSURLSession-work (serial)
#0 0x000000010aa9eaa4 in dispatch_async ()
#1 0x000000018439f2d4 in ___lldb_unnamed_symbol5217 ()
#2 0x000000018439dcc8 in ___lldb_unnamed_symbol5178 ()
#3 0x0000000184315dc4 in ___lldb_unnamed_symbol2660 ()
#4 0x000000018431d298 in ___lldb_unnamed_symbol2827 ()
#5 0x000000018431d154 in ___lldb_unnamed_symbol2827 ()
#6 0x000000018432ffe4 in ___lldb_unnamed_symbol3172 ()
#7 0x0000000184315d0c in ___lldb_unnamed_symbol2658 ()
#8 0x0000000184330e54 in ___lldb_unnamed_symbol3198 ()
#9 0x000000018453ccec in ___lldb_unnamed_symbol14481 ()
#10 0x000000010aa97ec4 in _dispatch_call_block_and_release ()
#11 0x000000010aa9973c in _dispatch_client_callout ()
#12 0x000000010aaa1a30 in _dispatch_lane_serial_drain ()
#13 0x000000010aaa2774 in _dispatch_lane_invoke ()
#14 0x000000010aaaf1a8 in _dispatch_root_queue_drain_deferred_wlh ()
#15 0x000000010aaae604 in _dispatch_workloop_worker_thread ()
#16 0x000000010a9f3814 in _pthread_wqthread ()
#17 0x000000010a9f25d4 in start_wqthread ()
Enqueued from com.github.kean.Nuke.ImagePipeline (Thread 24) Queue : com.github.kean.Nuke.ImagePipeline (serial)
#0 0x000000010aa9eaa4 in dispatch_async ()
#1 0x00000001845382fc in ___lldb_unnamed_symbol14171 ()
#2 0x000000010c3ed800 in NRMAOverride__resume ()
#3 0x00000001055627e8 in _DataLoader.loadData(with:session:didReceiveData:completion:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Loading/DataLoader.swift:138
#4 0x00000001055625f8 in DataLoader.loadData(with:didReceiveData:completion:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Loading/DataLoader.swift:100
#5 0x0000000105562a5c in protocol witness for DataLoading.loadData(with:didReceiveData:completion:) in conformance DataLoader ()
#6 0x000000010559885c in TaskFetchOriginalData.loadData(urlRequest:finish:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Tasks/TaskFetchOriginalData.swift:84
#7 0x0000000105598e4c in closure #1 in closure #2 in TaskFetchOriginalData.loadData(urlRequest:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Tasks/TaskFetchOriginalData.swift:58
#8 0x000000010551bd54 in thunk for @escaping @callee_guaranteed @sendable () -> () ()
#9 0x000000010aa97ec4 in _dispatch_call_block_and_release ()
#10 0x000000010aa9973c in _dispatch_client_callout ()
#11 0x000000010aaa1a30 in _dispatch_lane_serial_drain ()
#12 0x000000010aaa2774 in _dispatch_lane_invoke ()
#13 0x000000010aaaf1a8 in dispatch_root_queue_drain_deferred_wlh ()
#14 0x000000010aaae604 in dispatch_workloop_worker_thread ()
#15 0x000000010a9f3814 in pthread_wqthread ()
#16 0x000000010a9f25d4 in start_wqthread ()
Enqueued from (Thread 24) Queue : (serial)
#0 0x000000010aa9eaa4 in dispatch_async ()
#1 0x00000001c5bfc264 in swift_dispatch_async ()
#2 0x00000001c5bfa94c in OS_dispatch_queue.asyncHelper(group:qos:flags:execute:) ()
#3 0x00000001c5bfaac0 in OS_dispatch_queue.asyncUnsafe(group:qos:flags:execute:) ()
#4 0x0000000105598d68 in closure #2 in TaskFetchOriginalData.loadData(urlRequest:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Tasks/TaskFetchOriginalData.swift:57
#5 0x000000010555afa4 in Operation.start() at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Internal/Operation.swift:66
#6 0x000000010555b268 in @objc Operation.start() ()
#7 0x0000000180da1f58 in NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION ()
#8 0x0000000180da1c68 in __NSOQSchedule_f ()
#9 0x000000010aaa9e4c in dispatch_block_async_invoke2 ()
#10 0x000000010aa9973c in dispatch_client_callout ()
#11 0x000000010aa9cc14 in dispatch_continuation_pop ()
#12 0x000000010aa9bba0 in dispatch_async_redirect_invoke ()
#13 0x000000010aaad36c in dispatch_root_queue_drain ()
#14 0x000000010aaadf18 in dispatch_worker_thread2 ()
#15 0x000000010a9f37d8 in pthread_wqthread ()
#16 0x000000010a9f25d4 in start_wqthread ()
Enqueued from com.github.kean.Nuke.ImagePipeline (Thread 24) Queue : com.github.kean.Nuke.ImagePipeline (serial)
#0 0x000000010aa9eaa4 in dispatch_async ()
#1 0x0000000180d9be2c in __NSOQSchedule ()
#2 0x0000000180d9fa78 in __addOperations ()
#3 0x000000010555b5d4 in NSOperationQueue.add(
:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Internal/Operation.swift:95
#4 0x00000001055980d4 in TaskFetchOriginalData.loadData(urlRequest:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Tasks/TaskFetchOriginalData.swift:53
#5 0x0000000105597d40 in closure #1 in TaskFetchOriginalData.start() at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Tasks/TaskFetchOriginalData.swift:39
#6 0x000000010555cf6c in TokenBucket.execute(
:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Internal/RateLimiter.swift:94
#7 0x000000010555cd90 in RateLimiter.execute(
:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Internal/RateLimiter.swift:41
#8 0x0000000105597a40 in TaskFetchOriginalData.start() at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Tasks/TaskFetchOriginalData.swift:35
#9 0x00000001055909ec in AsyncTask.subscribe(priority:subscriber:
:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Tasks/AsyncTask.swift:100
#10 0x00000001055929b0 in AsyncTask.Publisher.subscribe(priority:subscriber:
:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Tasks/AsyncTask.swift:227
#11 0x0000000105592b38 in AsyncTask.Publisher.subscribe<τ_0_0>(
:onValue:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Tasks/AsyncTask.swift:234
#12 0x000000010559cefc in TaskFetchOriginalImage.start() at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Tasks/TaskFetchOriginalImage.swift:12
#13 0x00000001055909ec in AsyncTask.subscribe(priority:subscriber:
:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Tasks/AsyncTask.swift:100
#14 0x00000001055929b0 in AsyncTask.Publisher.subscribe(priority:subscriber:
:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Tasks/AsyncTask.swift:227
#15 0x0000000105592b38 in AsyncTask.Publisher.subscribe<τ_0_0>(
:onValue:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Tasks/AsyncTask.swift:234
#16 0x00000001055a1030 in TaskLoadImage.fetchImage() at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Tasks/TaskLoadImage.swift:58
#17 0x00000001055a0950 in TaskLoadImage.start() at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Tasks/TaskLoadImage.swift:24
#18 0x00000001055909ec in AsyncTask.subscribe(priority:subscriber:
:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Tasks/AsyncTask.swift:100
#19 0x00000001055929b0 in AsyncTask.Publisher.subscribe(priority:subscriber:
:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Tasks/AsyncTask.swift:227
#20 0x0000000105576974 in ImagePipeline.startImageTask(
:isDataTask:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Pipeline/ImagePipeline.swift:336
#21 0x0000000105576704 in closure #1 in closure #1 in closure #1 in ImagePipeline.makeStartedImageTask(with:isDataTask:onEvent:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Pipeline/ImagePipeline.swift:317
#22 0x000000010551bd54 in thunk for @escaping @callee_guaranteed @sendable () -> () ()
#23 0x000000010aa97ec4 in _dispatch_call_block_and_release ()
#24 0x000000010aa9973c in _dispatch_client_callout ()
#25 0x000000010aaa1a30 in _dispatch_lane_serial_drain ()
#26 0x000000010aaa2774 in _dispatch_lane_invoke ()
#27 0x000000010aaaf1a8 in _dispatch_root_queue_drain_deferred_wlh ()
#28 0x000000010aaae604 in _dispatch_workloop_worker_thread ()
#29 0x000000010a9f3814 in _pthread_wqthread ()
#30 0x000000010a9f25d4 in start_wqthread ()
Enqueued from com.apple.root.user-initiated-qos.cooperative (Thread 23) Queue : com.apple.root.user-initiated-qos.cooperative (serial)
#0 0x000000010aa9eaa4 in dispatch_async ()
#1 0x00000001c5bfc264 in swift_dispatch_async ()
#2 0x00000001c5bfa94c in OS_dispatch_queue.asyncHelper(group:qos:flags:execute:) ()
#3 0x00000001c5bfaac0 in OS_dispatch_queue.asyncUnsafe(group:qos:flags:execute:) ()
#4 0x0000000105576614 in closure #1 in closure #1 in ImagePipeline.makeStartedImageTask(with:isDataTask:onEvent:) at /Users/jc/Library/Developer/Xcode/DerivedData/App-eimxxbdvgfukfegmhzeroefcntsk/SourcePackages/checkouts/Nuke/Sources/Nuke/Pipeline/ImagePipeline.swift:315
#5 0x00000001055792bc in closure #1 in withUnsafeThrowingContinuation<τ_0_0>(
:) ()
#6 0x0000000105576c74 in withUnsafeThrowingContinuation<τ_0_0>(
:) ()
#7 0x000000020a8b410c in swift::runJobInEstablishedExecutorContext(swift::Job*) ()
#8 0x000000020a8b4fd4 in swift_job_runImpl(swift::Job*, swift::ExecutorRef) ()
#9 0x000000010aaad36c in _dispatch_root_queue_drain ()
#10 0x000000010aaadf18 in _dispatch_worker_thread2 ()
#11 0x000000010a9f37d8 in _pthread_wqthread ()
#12 0x000000010a9f25d4 in start_wqthread ()

Screenshot 2024-08-01 at 8 54 38 PM Screenshot 2024-08-01 at 8 54 28 PM Screenshot 2024-08-01 at 8 54 07 PM Screenshot 2024-08-01 at 8 53 59 PM

@hfabisiak
Copy link

I've also encountered the same issue

@jcbriones
Copy link
Author

I don't know what else I can share about this but it looks like it's happening mostly on when an image begins to load and either the view that was loading the image change let's say the view got removed then it crashes. But not always though. Seems like a race condition issue as well

@kean
Copy link
Owner

kean commented Oct 23, 2024

I hope this will be addressed by #802. It now fully switches to actors, so there won't be any opportunities for race conditions in the pipeline. I plan to ship a beta soon.

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

3 participants