react-native: RCTImageView / RCTImageLoader crash

Issue Description

Few days ago we’ve release our application to AppStore and stared to receive quite a significant amount of crashes on Crashlytic related to RCTImageView, this is few of the crashes we getting, i can attach more if it is required:

Crashed: com.apple.NSURLSession-work
Crashed: com.apple.main-thread
0  libsystem_platform.dylib       0x181ad2888 OSAtomicOr32Barrier + 34
1  AppMobile                    0x1002ec2d0 __102-[RCTImageLoader loadImageWithURLRequest:size:scale:clipped:resizeMode:progressBlock:completionBlock:]_block_invoke.253 + 4297802448
2  AppMobile                    0x1002eec8c -[RCTImageView cancelImageLoad] + 4297813132
3  AppMobile                    0x1002ef06c -[RCTImageView reloadImage] + 4297814124
4  AppMobile                    0x1002eff70 -[RCTImageView didMoveToWindow] + 4297817968
5  UIKit                          0x186fd3ac8 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1556
6  UIKit                          0x18738e428 -[UIImageView _didMoveFromWindow:toWindow:] + 80
7  UIKit                          0x186fd37ac -[UIView(Internal) _didMoveFromWindow:toWindow:] + 760
8  UIKit                          0x186fd37ac -[UIView(Internal) _didMoveFromWindow:toWindow:] + 760
9  UIKit                          0x186fd37ac -[UIView(Internal) _didMoveFromWindow:toWindow:] + 760
10 UIKit                          0x186fd2d40 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 152
11 Foundation                     0x1827a8cc0 -[NSISEngine withBehaviors:performModifications:] + 168
12 UIKit                          0x186fd2bc4 -[UIView(Hierarchy) _postMovedFromSuperview:] + 532
13 UIKit                          0x186fe0678 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1784
14 AppMobile                    0x1002b119c -[UIView(React) didUpdateReactSubviews] + 4297560476
15 AppMobile                    0x1002b83d0 -[RCTView didUpdateReactSubviews] + 4297589712
16 AppMobile                    0x1002cacd8 __59-[RCTShadowView processUpdatedProperties:parentProperties:]_block_invoke + 4297665752
17 AppMobile                    0x1002d8188 __77-[RCTUIManager _amendPendingUIBlocksWithStylePropagationUpdateForShadowView:]_block_invoke + 4297720200
18 AppMobile                    0x1002db7d4 __29-[RCTUIManager flushUIBlocks]_block_invoke + 4297734100
19 libdispatch.dylib              0x1818c14bc _dispatch_call_block_and_release + 24
20 libdispatch.dylib              0x1818c147c _dispatch_client_callout + 16
21 libdispatch.dylib              0x1818c6b84 _dispatch_main_queue_callback_4CF + 1844
22 CoreFoundation                 0x181e2cd50 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
23 CoreFoundation                 0x181e2abb8 __CFRunLoopRun + 1628
24 CoreFoundation                 0x181d54c50 CFRunLoopRunSpecific + 384
25 GraphicsServices               0x18363c088 GSEventRunModal + 180
26 UIKit                          0x187042088 UIApplicationMain + 204
27 AppMobile                    0x1000b3da4 main (main.m:16)
28 libdispatch.dylib              0x1818f28b8 (Missing)
Crashed: com.facebook.react.ImageLoaderURLRequestQueue
0  libobjc.A.dylib                0x182a25b90 objc_msgSend + 16
1  AppMobile                    0x100242354 __30-[RCTImageLoader dequeueTasks]_block_invoke + 4297745236
2  libdispatch.dylib              0x182df94bc _dispatch_call_block_and_release + 24
3  libdispatch.dylib              0x182df947c _dispatch_client_callout + 16
4  libdispatch.dylib              0x182e054c0 _dispatch_queue_drain + 864
5  libdispatch.dylib              0x182dfcf80 _dispatch_queue_invoke + 464
6  libdispatch.dylib              0x182df947c _dispatch_client_callout + 16
7  libdispatch.dylib              0x182e07914 _dispatch_root_queue_drain + 2140
8  libdispatch.dylib              0x182e070b0 _dispatch_worker_thread3 + 112
9  libsystem_pthread.dylib        0x183011470 _pthread_wqthread + 1092
10 libsystem_pthread.dylib        0x183011020 start_wqthread + 4

We was not able to reproduce this issue on our side yet. But we loading a lot of images in our application (up to 300), can such amount affect it somehow? It would be great if we cat get at least a hint where is the source of the issue =)

Additional Information

  • React Native version: [0.32]
  • Platform(s) (iOS, Android, or both?): [iOS]
  • Operating System (macOS, Linux, or Windows?): [Mac]

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 35 (11 by maintainers)

Most upvoted comments

I can confirm that the [RCTNetworkTask cancel] crash, that was introduced with 0.34.0 for us, is fixed with the 0.36.0.rc.1 update. 👍

But, I can also confirm that the [RCTImageLoader _loadImageOrDataWithURLRequest...] crash is not fixed with 0.36.rc.1, even though the crash rate got much better after upgrading to this version.

We upgraded our production app from 0.28.0 to 0.34.0 two weeks ago. After that, we experienced an enormous increase of crashes, so we decided to release a new app update with 0.36.0.rc.1 as soon as possible (hence the release candidate and not the stable version) as there were two promising commits in 0.35.0. and 0.36.0,rc.1 to fix this.

After evaluating the crash rate of this crash after a week on production, we saw that the crash rate was reduced by 88% again, so it really helped. But still, a proper fix would be amazing.

@davidgruebl same on 0.36.0-rc.1 custom Component from https://github.com/wix/list-view-experiments image screen shot 2016-10-18 at 6 40 54

@davidgruebl 0.36RC1 has solved the error 😄 , thank you very much, the bug appeared when displaying a list of big pictures like this and slid down very fast

img_0093

same same same here 😦 http://crashes.to/s/c55a4e38ab1