facebookarchive / AsyncDisplayKit

Smooth asynchronous user interfaces for iOS apps.
http://asyncdisplaykit.org
Other
13.4k stars 2.2k forks source link

[ASTextNode] Crash when accessing renderer.visibleRanges[0] 1.9.73 #1638

Closed DulMephistos closed 8 years ago

DulMephistos commented 8 years ago

After trying to update to 1.9.73 my app started to crash in several places due to ASTextNode nodes calling the method placeholderImage then inside it crashes when it tries to access renderer.visibleRanges[0]. The index does not exist, visibleRanges is empty and it crashes with EXC_BAD_ACCESS

Here is a screenshot of the stack trace. I can't paste as text because Xcode will crash together with this problem and simply close on me, making it super hard to debug. So I managed to take a screenshot and also to put some log messages to make sure my guess on this issue was right.

asdk-crash-and-invalid-context

Any ideas of what's happening here?

Looking at the screenshot you can also spot another problem, Core Graphics is throwing invalid context here because the CGSize is {0, 0} but this is another open issue here: 1601

levi commented 8 years ago

Fabio, try and pull this down and see if it fixes your issue: https://github.com/facebook/AsyncDisplayKit/pull/1648

DulMephistos commented 8 years ago

@levi it does fix it. It's funny though because when I was returning nil in case the visibleRanges were empty and logging the size I was seeing some a lot of non-zero sizes coming up so I thought this was not going to fix it because of that but it did...

I'm probably gonna wait until the next release to update ASDK but thanks for taking a look into it.

maicki commented 8 years ago

@pixel4 This should be fixed with version 1.9.8 that was released last night. Can you please verify

cc @appleguy

DulMephistos commented 8 years ago

@maicki just tested it man! It's fixed now, thanks ; )