nativescript-community / ui-image

Advanced and efficient image display plugin which uses Fresco (Android) and SDWebImage (iOS) to implement caching, placeholders, image effects, and much more.
Apache License 2.0
36 stars 9 forks source link

EXC_BAD_ACCESS: sd_imageIndicator > Attempted to dereference garbage pointer #32

Closed benediktveith closed 3 years ago

benediktveith commented 3 years ago

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

I have a RadListView containing 20-300 items. Each item can have an individual image, which are downloaded and stored inside the app's documents folder (e.g: /Users/****/Library/Developer/CoreSimulator/Devices/419DBF9D-C909-4AC0-8090-6C5F4B759FA2/data/Containers/Data/Application/ED862927-3742-4C32-911D-62F2D7D8B00C/Documents/projects/11.jpg) before the Controller with the RadListView is presented. As soon as I move to the RadListView and scroll the app crashes (see log below). This does not happen if I use the same image for each item!

Is there any code involved?

This is the image part:

<NSImg
                        :src="thumbnail" 
                        width="45" 
                        height="45"
                        roundAsCircle="true"
                        stretch="aspectFill"
                        class="thumbnail"
                        verticalAlignment="top" 
                        horizontalAlignment="center"
                        placeholderImageUri="res://map_thumbnail_fallback"
                        failureImageUri="res://map_thumbnail_fallback"
                    />

:src

thumbnail() {
                return this.project.thumbnail_url;
},

thumbnail_url is beforehand populated for each item with the following function(also notable to mention the data which each item has is stored inside the Vuex Store, nothing gets populated during rendering of the items / cells):

getProjectThumbnail(baseURL, projectId) {
        const folder = this.getDocumentsProjectsFolder(); // This returns the App documents folder
        const thumbnailUrl = fs.path.join(folder._path, projectId + '.jpg');

        if (!fs.File.exists(thumbnailUrl)) {
            return baseURL + 'projects/map-thumbnail/' + projectId; // Download URL if File for some reason does not exists; not called in this case
        }

        let source = null;
        if (isIOS) {
            source = NSURL.alloc().initFileURLWithPath(thumbnailUrl); // eslint-disable-line
        } else {
            source = thumbnailUrl;
        }

        if (source) {
            return source.toString();
        }

        return null;
    }

Crash Log

Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: BUS_NOOP at 0x000060000016f000
Crashed Thread: 0

Application Specific Information:
Exception 1, Code 0, Subcode 8 >
Attempted to dereference garbage pointer 0x60000016f000.

Thread 0 Crashed:
0   libobjc.A.dylib                 0x112259faa         objc_retain
1   SDWebImage                      0x111b55ebd         -[SDAnimatedImageView(WebCache) sd_setImageWithURL:placeholderImage:options:context:progress:completed:]
2   NativeScript                    0x10e349dcd         ffi_call_unix64

Thread 1 name: V8 DefaultWorke
0   libsystem_kernel.dylib          0x11659e882         __psynch_cvwait
1   NativeScript                    0x10ed337c4         v8::platform::DelayedTaskQueue::GetNext
2   NativeScript                    0x10ed32f50         v8::platform::DefaultWorkerThreadsTaskRunner::WorkerThread::Run
3   NativeScript                    0x10ed2a767         v8::base::ThreadEntry
4   libsystem_pthread.dylib         0x116600109         _pthread_start
5   libsystem_pthread.dylib         0x1165fbb8b         thread_start

Thread 2 name: V8 DefaultWorke
0   libsystem_kernel.dylib          0x11659e882         __psynch_cvwait
1   NativeScript                    0x10ed337c4         v8::platform::DelayedTaskQueue::GetNext
2   NativeScript                    0x10ed32f50         v8::platform::DefaultWorkerThreadsTaskRunner::WorkerThread::Run
3   NativeScript                    0x10ed2a767         v8::base::ThreadEntry
4   libsystem_pthread.dylib         0x116600109         _pthread_start
5   libsystem_pthread.dylib         0x1165fbb8b         thread_start

Thread 3 name: V8 DefaultWorke
0   libsystem_kernel.dylib          0x11659e882         __psynch_cvwait
1   NativeScript                    0x10ed337c4         v8::platform::DelayedTaskQueue::GetNext
2   NativeScript                    0x10ed32f50         v8::platform::DefaultWorkerThreadsTaskRunner::WorkerThread::Run
3   NativeScript                    0x10ed2a767         v8::base::ThreadEntry
4   libsystem_pthread.dylib         0x116600109         _pthread_start
5   libsystem_pthread.dylib         0x1165fbb8b         thread_start

Thread 4 name: V8 DefaultWorke
0   libsystem_kernel.dylib          0x11659e882         __psynch_cvwait
1   NativeScript                    0x10ed337c4         v8::platform::DelayedTaskQueue::GetNext
2   NativeScript                    0x10ed32f50         v8::platform::DefaultWorkerThreadsTaskRunner::WorkerThread::Run
3   NativeScript                    0x10ed2a767         v8::base::ThreadEntry
4   libsystem_pthread.dylib         0x116600109         _pthread_start
5   libsystem_pthread.dylib         0x1165fbb8b         thread_start

Thread 5 name: V8 DefaultWorke
0   libsystem_kernel.dylib          0x11659e882         __psynch_cvwait
1   NativeScript                    0x10ed337c4         v8::platform::DelayedTaskQueue::GetNext
2   NativeScript                    0x10ed32f50         v8::platform::DefaultWorkerThreadsTaskRunner::WorkerThread::Run
3   NativeScript                    0x10ed2a767         v8::base::ThreadEntry
4   libsystem_pthread.dylib         0x116600109         _pthread_start
5   libsystem_pthread.dylib         0x1165fbb8b         thread_start

Thread 6 name: V8 DefaultWorke
0   libsystem_kernel.dylib          0x11659e882         __psynch_cvwait
1   NativeScript                    0x10ed337c4         v8::platform::DelayedTaskQueue::GetNext
2   NativeScript                    0x10ed32f50         v8::platform::DefaultWorkerThreadsTaskRunner::WorkerThread::Run
3   NativeScript                    0x10ed2a767         v8::base::ThreadEntry
4   libsystem_pthread.dylib         0x116600109         _pthread_start
5   libsystem_pthread.dylib         0x1165fbb8b         thread_start

Thread 7 name: V8 DefaultWorke
0   libsystem_kernel.dylib          0x11659e882         __psynch_cvwait
1   NativeScript                    0x10ed337c4         v8::platform::DelayedTaskQueue::GetNext
2   NativeScript                    0x10ed32f50         v8::platform::DefaultWorkerThreadsTaskRunner::WorkerThread::Run
3   NativeScript                    0x10ed2a767         v8::base::ThreadEntry
4   libsystem_pthread.dylib         0x116600109         _pthread_start
5   libsystem_pthread.dylib         0x1165fbb8b         thread_start

Thread 8
0   libsystem_kernel.dylib          0x11659e756         __semwait_signal
1   libsystem_c.dylib               0x116383c8a         sleep
2   Sentry                          0x111c6a03c         monitorCachedData
3   libsystem_pthread.dylib         0x116600109         _pthread_start
4   libsystem_pthread.dylib         0x1165fbb8b         thread_start

Thread 9 name: SentryCrash Exception Handler (Secondary)
0   libsystem_kernel.dylib          0x11659bdfa         mach_msg_trap
1   Sentry                          0x111c7edc2         handleExceptions
2   libsystem_pthread.dylib         0x116600109         _pthread_start
3   libsystem_pthread.dylib         0x1165fbb8b         thread_start

Thread 11 name: com.apple.uikit.eventfetch-thread
0   libsystem_kernel.dylib          0x11659bdfa         mach_msg_trap
1   CoreFoundation                  0x112c0f5c4         __CFRunLoopServiceMachPort
2   CoreFoundation                  0x112c09bf9         __CFRunLoopRun
3   CoreFoundation                  0x112c09221         CFRunLoopRunSpecific
4   Foundation                      0x10f78c522         -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
5   Foundation                      0x10f78c734         -[NSRunLoop(NSRunLoop) runUntilDate:]
6   UIKitCore                       0x1135e763f         -[UIEventFetcher threadMain]
7   Foundation                      0x10f7a1932         __NSThread__start__
8   libsystem_pthread.dylib         0x116600109         _pthread_start
9   libsystem_pthread.dylib         0x1165fbb8b         thread_start

Thread 12 name: com.apple.NSURLConnectionLoader
0   libsystem_kernel.dylib          0x11659bdfa         mach_msg_trap
1   CoreFoundation                  0x112c0f5c4         __CFRunLoopServiceMachPort
2   CoreFoundation                  0x112c09bf9         __CFRunLoopRun
3   CoreFoundation                  0x112c09221         CFRunLoopRunSpecific
4   CFNetwork                       0x1168d4a2d         -[__CoreSchedulingSetRunnable runForever]
5   Foundation                      0x10f7a1932         __NSThread__start__
6   libsystem_pthread.dylib         0x116600109         _pthread_start
7   libsystem_pthread.dylib         0x1165fbb8b         thread_start

Thread 13
0   libsystem_pthread.dylib         0x1165fbb68         qos_class_main

Thread 14
0   libsystem_kernel.dylib          0x11659bdfa         mach_msg_trap
1   CoreFoundation                  0x112c0f5c4         __CFRunLoopServiceMachPort
2   CoreFoundation                  0x112c09bf9         __CFRunLoopRun
3   CoreFoundation                  0x112c09221         CFRunLoopRunSpecific
4   CoreFoundation                  0x112c0a1a8         CFRunLoopRun
5   NativeScript                    0x10e2a4c48         tns::WorkerWrapper::BackgroundLooper
6   NativeScript                    0x10e2a4ba0         tns::WorkerWrapper::Start
7   Foundation                      0x10f77619d         __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__
8   Foundation                      0x10f7760a4         -[NSBlockOperation main]
9   Foundation                      0x10f772e13         -[__NSOperationInternal _start:]
10  Foundation                      0x10f778e4a         __NSOQSchedule_f
11  libdispatch.dylib               0x11621051d         _dispatch_call_block_and_release
12  libdispatch.dylib               0x116211587         _dispatch_client_callout
13  libdispatch.dylib               0x116213fac         _dispatch_continuation_pop
14  libdispatch.dylib               0x116213619         _dispatch_async_redirect_invoke
15  libdispatch.dylib               0x1162204af         _dispatch_root_queue_drain
16  libdispatch.dylib               0x116220d19         _dispatch_worker_thread2
17  libsystem_pthread.dylib         0x1165fc9f7         _pthread_wqthread
18  libsystem_pthread.dylib         0x1165fbb77         start_wqthread

Thread 15
0   libsystem_kernel.dylib          0x11659d4ce         __workq_kernreturn
1   libsystem_pthread.dylib         0x1165fbb77         start_wqthread

Thread 16
0   libsystem_kernel.dylib          0x11659d4ce         __workq_kernreturn
1   libsystem_pthread.dylib         0x1165fbb77         start_wqthread

Thread 17
0   libsystem_kernel.dylib          0x11659bdfa         mach_msg_trap
1   CoreFoundation                  0x112c0f5c4         __CFRunLoopServiceMachPort
2   CoreFoundation                  0x112c09bf9         __CFRunLoopRun
3   CoreFoundation                  0x112c09221         CFRunLoopRunSpecific
4   CoreFoundation                  0x112c0a1a8         CFRunLoopRun
5   NativeScript                    0x10e2a4c48         tns::WorkerWrapper::BackgroundLooper
6   NativeScript                    0x10e2a4ba0         tns::WorkerWrapper::Start
7   Foundation                      0x10f77619d         __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__
8   Foundation                      0x10f7760a4         -[NSBlockOperation main]
9   Foundation                      0x10f772e13         -[__NSOperationInternal _start:]
10  Foundation                      0x10f778e4a         __NSOQSchedule_f
11  libdispatch.dylib               0x11621051d         _dispatch_call_block_and_release
12  libdispatch.dylib               0x116211587         _dispatch_client_callout
13  libdispatch.dylib               0x116213fac         _dispatch_continuation_pop
14  libdispatch.dylib               0x116213619         _dispatch_async_redirect_invoke
15  libdispatch.dylib               0x1162204af         _dispatch_root_queue_drain
16  libdispatch.dylib               0x116220d19         _dispatch_worker_thread2
17  libsystem_pthread.dylib         0x1165fc9f7         _pthread_wqthread
18  libsystem_pthread.dylib         0x1165fbb77         start_wqthread

Thread 18
0   libsystem_kernel.dylib          0x11659bdfa         mach_msg_trap
1   CoreFoundation                  0x112c0f5c4         __CFRunLoopServiceMachPort
2   CoreFoundation                  0x112c09bf9         __CFRunLoopRun
3   CoreFoundation                  0x112c09221         CFRunLoopRunSpecific
4   CoreFoundation                  0x112c0a1a8         CFRunLoopRun
5   NativeScript                    0x10e2a4c48         tns::WorkerWrapper::BackgroundLooper
6   NativeScript                    0x10e2a4ba0         tns::WorkerWrapper::Start
7   Foundation                      0x10f77619d         __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__
8   Foundation                      0x10f7760a4         -[NSBlockOperation main]
9   Foundation                      0x10f772e13         -[__NSOperationInternal _start:]
10  Foundation                      0x10f778e4a         __NSOQSchedule_f
11  libdispatch.dylib               0x11621051d         _dispatch_call_block_and_release
12  libdispatch.dylib               0x116211587         _dispatch_client_callout
13  libdispatch.dylib               0x116213fac         _dispatch_continuation_pop
14  libdispatch.dylib               0x116213619         _dispatch_async_redirect_invoke
15  libdispatch.dylib               0x1162204af         _dispatch_root_queue_drain
16  libdispatch.dylib               0x116220d19         _dispatch_worker_thread2
17  libsystem_pthread.dylib         0x1165fc9f7         _pthread_wqthread
18  libsystem_pthread.dylib         0x1165fbb77         start_wqthread

Thread 19
0   libsystem_kernel.dylib          0x11659d4ce         __workq_kernreturn
1   libsystem_pthread.dylib         0x1165fbb77         start_wqthread

Thread 20
0   libsystem_kernel.dylib          0x11659e882         __psynch_cvwait
1   libc++.1.dylib                  0x10f64878a         std::__1::condition_variable::wait
2   JavaScriptCore                  0x11b98a5b2         std::__1::condition_variable_any::wait<T>
3   JavaScriptCore                  0x11b98e8db         bmalloc::Scavenger::threadRunLoop
4   JavaScriptCore                  0x11b98e049         bmalloc::Scavenger::threadEntryPoint
5   JavaScriptCore                  0x11b98faa7         std::__1::__thread_proxy<T>
6   libsystem_pthread.dylib         0x116600109         _pthread_start
7   libsystem_pthread.dylib         0x1165fbb8b         thread_start

Thread 21
0   libsystem_kernel.dylib          0x11659d4ce         __workq_kernreturn
1   libsystem_pthread.dylib         0x1165fbb77         start_wqthread

Thread 22
0   libsystem_kernel.dylib          0x11659d4ce         __workq_kernreturn
1   libsystem_pthread.dylib         0x1165fbb77         start_wqthread

Thread 23
0   libsystem_kernel.dylib          0x11659bdfa         mach_msg_trap
1   CoreFoundation                  0x112c0f5c4         __CFRunLoopServiceMachPort
2   CoreFoundation                  0x112c09bf9         __CFRunLoopRun
3   CoreFoundation                  0x112c09221         CFRunLoopRunSpecific
4   CoreFoundation                  0x112c0a1a8         CFRunLoopRun
5   NativeScript                    0x10e2a4c48         tns::WorkerWrapper::BackgroundLooper
6   NativeScript                    0x10e2a4ba0         tns::WorkerWrapper::Start
7   Foundation                      0x10f77619d         __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__
8   Foundation                      0x10f7760a4         -[NSBlockOperation main]
9   Foundation                      0x10f772e13         -[__NSOperationInternal _start:]
10  Foundation                      0x10f778e4a         __NSOQSchedule_f
11  libdispatch.dylib               0x11621051d         _dispatch_call_block_and_release
12  libdispatch.dylib               0x116211587         _dispatch_client_callout
13  libdispatch.dylib               0x116213fac         _dispatch_continuation_pop
14  libdispatch.dylib               0x116213619         _dispatch_async_redirect_invoke
15  libdispatch.dylib               0x1162204af         _dispatch_root_queue_drain
16  libdispatch.dylib               0x116220d19         _dispatch_worker_thread2
17  libsystem_pthread.dylib         0x1165fc9f7         _pthread_wqthread
18  libsystem_pthread.dylib         0x1165fbb77         start_wqthread

Thread 24
0   libsystem_kernel.dylib          0x11659d4ce         __workq_kernreturn
1   libsystem_pthread.dylib         0x1165fbb77         start_wqthread

EOF
OS Version: iOS 14.0 (19G2021)
Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: BUS_NOOP at 0x0000000000000012
Crashed Thread: 0

Application Specific Information:
Exception 1, Code 18, Subcode 8 >
Attempted to dereference garbage pointer 0x12.

Thread 0 Crashed:
0   libsystem_blocks.dylib          0xfffe400fd2fb      _Block_copy
1   libsystem_blocks.dylib          0xfffe400fd5c0      _Block_object_assign
2   SDWebImage                      0x80002cb8f2a3      __copy_helper_block_e8_32b
3   libsystem_blocks.dylib          0xfffe400fd390      _Block_copy
4   libsystem_blocks.dylib          0xfffe400fd5c0      _Block_object_assign
5   SDWebImage                      0x80002cbce9fe      __copy_helper_block_e8_32s40b48s56s64b72w
6   libsystem_blocks.dylib          0xfffe400fd390      _Block_copy
7   libsystem_blocks.dylib          0xfffe400fd5c0      _Block_object_assign
8   SDWebImage                      0x80002cbce9fe      __copy_helper_block_e8_32s40b48s56s64b72w
9   libsystem_blocks.dylib          0xfffe400fd390      _Block_copy
10  libsystem_blocks.dylib          0xfffe400fd5c0      _Block_object_assign
11  SDWebImage                      0x80002cb9f5af      __copy_helper_block_e8_32s40b48s56s64s72s
12  libsystem_blocks.dylib          0xfffe400fd390      _Block_copy
13  SDWebImage                      0x80002cb9ee5c      -[SDImageCache queryCacheOperationForKey:options:context:cacheType:done:]
14  SDWebImage                      0x80002cba163a      -[SDImageCache(SDImageCache) queryImageForKey:options:context:cacheType:completion:]
15  SDWebImage                      0x80002cbce381      -[SDWebImageManager callCacheProcessForOperation:url:options:context:progress:completed:]
16  SDWebImage                      0x80002cbcda50      -[SDWebImageManager loadImageWithURL:options:context:progress:completed:]
17  SDWebImage                      0x80002cbe42cf      -[UIView(WebCache) sd_internalSetImageWithURL:placeholderImage:options:context:setImageBlock:progress:completed:]
18  SDWebImage                      0x80002cb8f085      -[SDAnimatedImageView(WebCache) sd_setImageWithURL:placeholderImage:options:context:progress:completed:]
19  NativeScript                    0x10a7addcd         ffi_call_unix64

Thread 1
0   libsystem_kernel.dylib          0x7fff5dca14ce      __workq_kernreturn
1   libsystem_pthread.dylib         0x7fff5dcd7b77      start_wqthread

Thread 2
0   libsystem_kernel.dylib          0x7fff5dca14ce      __workq_kernreturn
1   libsystem_pthread.dylib         0x7fff5dcd7b77      start_wqthread

Thread 3 name: V8 DefaultWorke
0   libsystem_kernel.dylib          0x7fff5dca2882      __psynch_cvwait
1   NativeScript                    0x10b1977c4         v8::platform::DelayedTaskQueue::GetNext
2   NativeScript                    0x10b196f50         v8::platform::DefaultWorkerThreadsTaskRunner::WorkerThread::Run
3   NativeScript                    0x10b18e767         v8::base::ThreadEntry
4   libsystem_pthread.dylib         0x7fff5dcdc109      _pthread_start
5   libsystem_pthread.dylib         0x7fff5dcd7b8b      thread_start

Thread 4 name: V8 DefaultWorke
0   libsystem_kernel.dylib          0x7fff5dca2882      __psynch_cvwait
1   NativeScript                    0x10b1977c4         v8::platform::DelayedTaskQueue::GetNext
2   NativeScript                    0x10b196f50         v8::platform::DefaultWorkerThreadsTaskRunner::WorkerThread::Run
3   NativeScript                    0x10b18e767         v8::base::ThreadEntry
4   libsystem_pthread.dylib         0x7fff5dcdc109      _pthread_start
5   libsystem_pthread.dylib         0x7fff5dcd7b8b      thread_start

Thread 5 name: V8 DefaultWorke
0   libsystem_kernel.dylib          0x7fff5dca2882      __psynch_cvwait
1   NativeScript                    0x10b1977c4         v8::platform::DelayedTaskQueue::GetNext
2   NativeScript                    0x10b196f50         v8::platform::DefaultWorkerThreadsTaskRunner::WorkerThread::Run
3   NativeScript                    0x10b18e767         v8::base::ThreadEntry
4   libsystem_pthread.dylib         0x7fff5dcdc109      _pthread_start
5   libsystem_pthread.dylib         0x7fff5dcd7b8b      thread_start

Thread 6 name: V8 DefaultWorke
0   libsystem_kernel.dylib          0x7fff5dca2882      __psynch_cvwait
1   NativeScript                    0x10b1977c4         v8::platform::DelayedTaskQueue::GetNext
2   NativeScript                    0x10b196f50         v8::platform::DefaultWorkerThreadsTaskRunner::WorkerThread::Run
3   NativeScript                    0x10b18e767         v8::base::ThreadEntry
4   libsystem_pthread.dylib         0x7fff5dcdc109      _pthread_start
5   libsystem_pthread.dylib         0x7fff5dcd7b8b      thread_start

Thread 7 name: V8 DefaultWorke
0   libsystem_kernel.dylib          0x7fff5dca2882      __psynch_cvwait
1   NativeScript                    0x10b1977c4         v8::platform::DelayedTaskQueue::GetNext
2   NativeScript                    0x10b196f50         v8::platform::DefaultWorkerThreadsTaskRunner::WorkerThread::Run
3   NativeScript                    0x10b18e767         v8::base::ThreadEntry
4   libsystem_pthread.dylib         0x7fff5dcdc109      _pthread_start
5   libsystem_pthread.dylib         0x7fff5dcd7b8b      thread_start

Thread 8 name: V8 DefaultWorke
0   libsystem_kernel.dylib          0x7fff5dca2882      __psynch_cvwait
1   NativeScript                    0x10b1977c4         v8::platform::DelayedTaskQueue::GetNext
2   NativeScript                    0x10b196f50         v8::platform::DefaultWorkerThreadsTaskRunner::WorkerThread::Run
3   NativeScript                    0x10b18e767         v8::base::ThreadEntry
4   libsystem_pthread.dylib         0x7fff5dcdc109      _pthread_start
5   libsystem_pthread.dylib         0x7fff5dcd7b8b      thread_start

Thread 9 name: V8 DefaultWorke
0   libsystem_kernel.dylib          0x7fff5dca2882      __psynch_cvwait
1   NativeScript                    0x10b1977c4         v8::platform::DelayedTaskQueue::GetNext
2   NativeScript                    0x10b196f50         v8::platform::DefaultWorkerThreadsTaskRunner::WorkerThread::Run
3   NativeScript                    0x10b18e767         v8::base::ThreadEntry
4   libsystem_pthread.dylib         0x7fff5dcdc109      _pthread_start
5   libsystem_pthread.dylib         0x7fff5dcd7b8b      thread_start

Thread 10
0   libsystem_kernel.dylib          0x7fff5dc9fdfa      mach_msg_trap
1   CoreFoundation                  0xfffe404eee77      __CFRunLoopServiceMachPort
2   CoreFoundation                  0xfffe404e958d      __CFRunLoopRun
3   CoreFoundation                  0xfffe404e8b9e      CFRunLoopRunSpecific
4   CoreFoundation                  0xfffe404e9cf1      CFRunLoopRun
5   NativeScript                    0x10a708c48         tns::WorkerWrapper::BackgroundLooper
6   NativeScript                    0x10a708ba0         tns::WorkerWrapper::Start
7   Foundation                      0xfffe7e4e2348      __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__
8   Foundation                      0xfffe7e4e2240      -[NSBlockOperation main]
9   Foundation                      0xfffe7e4e525e      __NSOPERATION_IS_INVOKING_MAIN__
10  Foundation                      0xfffe7e4e1465      -[NSOperation start]
11  Foundation                      0xfffe7e4e5be3      __NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION__
12  Foundation                      0xfffe7e4e56f6      __NSOQSchedule_f
13  libdispatch.dylib               0xfffe7ddaf6bb      _dispatch_block_async_invoke2
14  libdispatch.dylib               0xfffe7dda2534      _dispatch_client_callout
15  libdispatch.dylib               0xfffe7dda4a27      _dispatch_continuation_pop
16  libdispatch.dylib               0xfffe7dda40e7      _dispatch_async_redirect_invoke
17  libdispatch.dylib               0xfffe7ddb208e      _dispatch_root_queue_drain
18  libdispatch.dylib               0xfffe7ddb288b      _dispatch_worker_thread2
19  libsystem_pthread.dylib         0x7fff5dcd89f7      _pthread_wqthread
20  libsystem_pthread.dylib         0x7fff5dcd7b77      start_wqthread

Thread 11
0   libsystem_kernel.dylib          0x7fff5dca2756      __semwait_signal
1   libsystem_c.dylib               0xfffe401774ae      sleep
2   Sentry                          0x80002d72803c      monitorCachedData
3   libsystem_pthread.dylib         0x7fff5dcdc109      _pthread_start
4   libsystem_pthread.dylib         0x7fff5dcd7b8b      thread_start

Thread 12 name: SentryCrash Exception Handler (Secondary)
0   libsystem_kernel.dylib          0x7fff5dc9fdfa      mach_msg_trap
1   Sentry                          0x80002d73cdc2      handleExceptions
2   libsystem_pthread.dylib         0x7fff5dcdc109      _pthread_start
3   libsystem_pthread.dylib         0x7fff5dcd7b8b      thread_start

Thread 14 name: com.apple.uikit.eventfetch-thread
0   libsystem_kernel.dylib          0x7fff5dc9fdfa      mach_msg_trap
1   CoreFoundation                  0xfffe404eee77      __CFRunLoopServiceMachPort
2   CoreFoundation                  0xfffe404e958d      __CFRunLoopRun
3   CoreFoundation                  0xfffe404e8b9e      CFRunLoopRunSpecific
4   Foundation                      0xfffe7e51be61      -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
5   Foundation                      0xfffe7e51c0d0      -[NSRunLoop(NSRunLoop) runUntilDate:]
6   UIKitCore                       0xfffe72fe1a45      -[UIEventFetcher threadMain]
7   Foundation                      0xfffe7e544521      __NSThread__start__
8   libsystem_pthread.dylib         0x7fff5dcdc109      _pthread_start
9   libsystem_pthread.dylib         0x7fff5dcd7b8b      thread_start

Thread 15
0   libsystem_kernel.dylib          0x7fff5dca14ce      __workq_kernreturn
1   libsystem_pthread.dylib         0x7fff5dcd7b77      start_wqthread

Thread 16
0   libsystem_kernel.dylib          0x7fff5dc9fdfa      mach_msg_trap
1   CoreFoundation                  0xfffe404eee77      __CFRunLoopServiceMachPort
2   CoreFoundation                  0xfffe404e958d      __CFRunLoopRun
3   CoreFoundation                  0xfffe404e8b9e      CFRunLoopRunSpecific
4   CoreFoundation                  0xfffe404e9cf1      CFRunLoopRun
5   NativeScript                    0x10a708c48         tns::WorkerWrapper::BackgroundLooper
6   NativeScript                    0x10a708ba0         tns::WorkerWrapper::Start
7   Foundation                      0xfffe7e4e2348      __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__
8   Foundation                      0xfffe7e4e2240      -[NSBlockOperation main]
9   Foundation                      0xfffe7e4e525e      __NSOPERATION_IS_INVOKING_MAIN__
10  Foundation                      0xfffe7e4e1465      -[NSOperation start]
11  Foundation                      0xfffe7e4e5be3      __NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION__
12  Foundation                      0xfffe7e4e56f6      __NSOQSchedule_f
13  libdispatch.dylib               0xfffe7ddaf6bb      _dispatch_block_async_invoke2
14  libdispatch.dylib               0xfffe7dda2534      _dispatch_client_callout
15  libdispatch.dylib               0xfffe7dda4a27      _dispatch_continuation_pop
16  libdispatch.dylib               0xfffe7dda40e7      _dispatch_async_redirect_invoke
17  libdispatch.dylib               0xfffe7ddb208e      _dispatch_root_queue_drain
18  libdispatch.dylib               0xfffe7ddb288b      _dispatch_worker_thread2
19  libsystem_pthread.dylib         0x7fff5dcd89f7      _pthread_wqthread
20  libsystem_pthread.dylib         0x7fff5dcd7b77      start_wqthread

Thread 17
0   libsystem_kernel.dylib          0x7fff5dca14ce      __workq_kernreturn
1   libsystem_pthread.dylib         0x7fff5dcd7b77      start_wqthread

Thread 18 name: com.apple.NSURLConnectionLoader
0   libsystem_kernel.dylib          0x7fff5dc9fdfa      mach_msg_trap
1   CoreFoundation                  0xfffe404eee77      __CFRunLoopServiceMachPort
2   CoreFoundation                  0xfffe404e958d      __CFRunLoopRun
3   CoreFoundation                  0xfffe404e8b9e      CFRunLoopRunSpecific
4   CFNetwork                       0xfffe4aec7b52      _CFURLStorageSessionCopyCache
5   Foundation                      0xfffe7e544521      __NSThread__start__
6   libsystem_pthread.dylib         0x7fff5dcdc109      _pthread_start
7   libsystem_pthread.dylib         0x7fff5dcd7b8b      thread_start

Thread 19 name: JavaScriptCore bmalloc scavenger
0   libsystem_kernel.dylib          0x7fff5dca2882      __psynch_cvwait
1   libc++.1.dylib                  0xfffe40585e02      std::__1::condition_variable::wait
2   JavaScriptCore                  0xfffe58f2ed84      std::__1::condition_variable_any::wait<T>
3   JavaScriptCore                  0xfffe58f339cb      bmalloc::Scavenger::threadRunLoop
4   JavaScriptCore                  0xfffe58f33359      bmalloc::Scavenger::threadEntryPoint
5   JavaScriptCore                  0xfffe58f34bc7      std::__1::__thread_proxy<T>
6   libsystem_pthread.dylib         0x7fff5dcdc109      _pthread_start
7   libsystem_pthread.dylib         0x7fff5dcd7b8b      thread_start

Thread 20
0   libsystem_kernel.dylib          0x7fff5dca14ce      __workq_kernreturn
1   libsystem_pthread.dylib         0x7fff5dcd7b77      start_wqthread

EOF

The crash differs from time to time...

farfromrefug commented 3 years ago

Could you create a simple repro project ? Would make it easier to fix. Thanks

benediktveith commented 3 years ago

I will try to create a sample project later today.

Error is maybe linked to: https://github.com/NativeScript/NativeScript/issues/8869#issuecomment-696418668 ?

farfromrefug commented 3 years ago

@benediktveith dont think so. I think it is related to the place holder native image not being retained.

romandrahan commented 3 years ago

Have literally the same issue with latest SDWebImage and this plugin on iOS as well.

benediktveith commented 3 years ago

@benediktveith dont think so. I think it is related to the place holder native image not being retained.

Hmm, I debugged my project via XCode with Zombie Objects active and the reason for crashing is *** -[OS_xpc_uuid retain]: message sent to deallocated instance 0x600007a1c930 (see image where the crash happens) Screenshot 2020-09-25 at 12 45 11

@farfromrefug

farfromrefug commented 3 years ago

@romandragan using placeholder too?

benediktveith commented 3 years ago

@farfromrefug The crash also happens if no placeholder / failure image is used

romandrahan commented 3 years ago

@farfromrefug, nope, just regular NSImg with src property.

farfromrefug commented 3 years ago

@romandragan @benediktveith using the v8 runtime? If so can you try with tns-ios ?

romandrahan commented 3 years ago

@farfromrefug, with latest nativescript-ios V8 runtime, yes. Can't try unfortunately on my side :( We already switched to V8 in our production app, so had to disable images caching temporarily.

farfromrefug commented 3 years ago

@romandragan ok you can try locally if you have time. It is as simple as changing the devDep, removing platforms and runing npm i

benediktveith commented 3 years ago

@farfromrefug

Test Repo: https://github.com/benediktveith/ui-image-crash-radlistview

Just build the project and scroll down fast as soon as the images appear. (works best directly in XCode .workspace). After crashing you have to reinstall the app, otherwise it won't crash anymore (strangely this happens in my real project too, as soon as all images were loaded once from the plugin they work as expected without any further crashes). Btw. I think adding more images and decreasing the cell height will increase the crash occurrences.

And yes V8 runtime. A week ago this plugin worked fine (v3.0.3 it was I think), but since upgrading to the latest NativeScript the crash occurs. I did not change any logic inside my project.

benediktveith commented 3 years ago

@farfromrefug Any updates?

farfromrefug commented 3 years ago

@benediktveith sorry guys had a lot of work. running it right now

farfromrefug commented 3 years ago

@romandragan @benediktveith for now i cant reproduce it. Are you seeing it too on sim? I dont have a device in 14. And why are downloading images on the side and not let the plugin handle it?

romandrahan commented 3 years ago

@romandragan @benediktveith for now i cant reproduce it. Are you seeing it too on sim? I dont have a device in 14

@farfromrefug, I do can reproduce it on simulator (iOS 14) and real device (iOS 14).

Don't quite remember if the same was on iOS 13, but it's more likely it was.

farfromrefug commented 3 years ago

OK so first thing is the app is crazy slow doing it the way you do it. SDWebImage comes with cache feature. So you should put those images directly as src and not download them on created. The app is 10 times smoother, animations on image load....

benediktveith commented 3 years ago

@farfromrefug

Hmm weird. I retested it right now. iPhone 6 (iOS 12) Simulator. As soon as the first image appears I scroll down. App crashes. If I rebuild the project (ns run ios) I can reproduce this procedure.

OK so first thing is the app is crazy slow doing it the way you do it. SDWebImage comes with cache feature. So you should put those images directly as src and not download them on created.

I know but this is just an example way of how I am doing it. In my production app I have following steps:

  1. Login - Screen
  2. (After login) Download Screen (downloads all data and images and stores them inside the app document folder)
  3. Home Screen (RadListView containing items with thumbnail images).

I do not have the possibility to download the images when they are shown, since we support offline network access and the images need to be present nevertheless.

FYI: I can reproduce the same crash with URLs as src in my production app. (Without downloading any images beforehand)

farfromrefug commented 3 years ago

@benediktveith really weird then, I dont know why it works here. One thing i see is that in the package.json versions are not "fixed" so we might not have the same version :s. As i just installed it i might have newer packages versions. Maybe you can try to upgrade? YOu can find me on slack if you want to discuss that issue

romandrahan commented 3 years ago

@farfromrefug, could you please share your package-lock.json?

farfromrefug commented 3 years ago

@romandragan i dont use npm but pnpm. Here is my lock file pnpm-lock.yaml.txt

benediktveith commented 3 years ago

@farfromrefug So you can not reproduce this error inside the test project?

farfromrefug commented 3 years ago

@benediktveith yes i am really sorry i want to fix it but it does not crash here. tried on sim 14 and 12. Also tried with XCode. We can chat on slack if you want will be easier

romandrahan commented 3 years ago

@farfromrefug, here is my package-lock.json. If I'm not mistaken, the versions are the same as in yours pnpm one. package-lock.json.txt

But it still crashing for me.

farfromrefug commented 3 years ago

@romandragan crashing for you with the sample app from @benediktveith ? I am fighting to reproduce it

romandrahan commented 3 years ago

@farfromrefug, well I was not able to reproduce the issue in @benediktveith's repo, but I just made a fork of it with some adjustments and I do can reproduce it now.

https://github.com/romandragan/ui-image-crash-radlistview

Note v-if="loaded" condition for ListView. If you remove it – all fine, if you keep it – the app crashes: https://github.com/romandragan/ui-image-crash-radlistview/blob/master/app/components/Home.vue#L9

Crash:

image
farfromrefug commented 3 years ago

@romandragan it does not crash either here :s Really i dont get it. Can you do me a favor and look at platforms/ios/Podfile.lock and give me the version of your SDWebImage pod? Thanks

romandrahan commented 3 years ago

@farfromrefug, here it is: Podfile.lock.txt

pod --version: 1.9.3

And ns doctor output as well:

✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 12.0.0 satisfies minimum required version 10.
✔ Getting NativeScript components versions information...
⚠ Update available for component nativescript. Your current version is 7.0.9-rc.2 and the latest available version is 7.0.8.
✔ Component @nativescript/core has 7.0.9 version and is up to date.
✔ Component @nativescript/ios has 7.0.0 version and is up to date.
✔ Component @nativescript/android has 7.0.0 version and is up to date.
farfromrefug commented 3 years ago

@romandragan we are not using the same version! this must be it! I am using SDWebImage 5.9.1 (because my cocoa pod repo is not up to date). can you try to modify @nativescript-community/ui-image/platforms/ios/Podfile to force version 5.9.1? Almost sure it wont crash anymore.

romandrahan commented 3 years ago

@farfromrefug, still crashing for me with this Podfile.lock.txt

iPhone 11 (iOS 14) simulator.

romandrahan commented 3 years ago

@farfromrefug, BTW are you using Xcode 12 right?

farfromrefug commented 3 years ago

@romandragan yes i am :s Really dont get this. I am pushing kind of a big update with important bug fixes (image auto measurement within layouts). It should not make a difference wiht your issue. BTW looking at the xcode screenshot i start to think it could be SDWebImage

romandrahan commented 3 years ago

@farfromrefug, @benediktveith, just wondering what Node version do you have? Mine is 10.19.0, maybe that's related...

Very strange @farfromrefug can't reproduce the issue even with https://github.com/romandragan/ui-image-crash-radlistview, so trying the more dumb thoughts here :)

romandrahan commented 3 years ago

Works fine with @nativescript/ios@7.0.6.

farfromrefug commented 3 years ago

@benediktveith could you try so that i know that we can close that issue?

benediktveith commented 3 years ago

@farfromrefug Can be closed. Seems to be working for me