{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/244","labels_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/244/labels{/name}","comments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/244/comments","events_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/244/events","html_url":"https://github.com/facebook/AsyncDisplayKit/issues/244","id":55319917,"number":244,"title":"Out of order operations in ASTableView and ASCollectionView when rasterizing subnode","user":{"login":"cfcommando","id":8451005,"avatar_url":"https://avatars.githubusercontent.com/u/8451005?v=3","gravatar_id":"","url":"https://api.github.com/users/cfcommando","html_url":"https://github.com/cfcommando","followers_url":"https://api.github.com/users/cfcommando/followers","following_url":"https://api.github.com/users/cfcommando/following{/other_user}","gists_url":"https://api.github.com/users/cfcommando/gists{/gist_id}","starred_url":"https://api.github.com/users/cfcommando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfcommando/subscriptions","organizations_url":"https://api.github.com/users/cfcommando/orgs","repos_url":"https://api.github.com/users/cfcommando/repos","events_url":"https://api.github.com/users/cfcommando/events{/privacy}","received_events_url":"https://api.github.com/users/cfcommando/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"rnystrom","id":739696,"avatar_url":"https://avatars.githubusercontent.com/u/739696?v=3","gravatar_id":"","url":"https://api.github.com/users/rnystrom","html_url":"https://github.com/rnystrom","followers_url":"https://api.github.com/users/rnystrom/followers","following_url":"https://api.github.com/users/rnystrom/following{/other_user}","gists_url":"https://api.github.com/users/rnystrom/gists{/gist_id}","starred_url":"https://api.github.com/users/rnystrom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnystrom/subscriptions","organizations_url":"https://api.github.com/users/rnystrom/orgs","repos_url":"https://api.github.com/users/rnystrom/repos","events_url":"https://api.github.com/users/rnystrom/events{/privacy}","received_events_url":"https://api.github.com/users/rnystrom/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-01-23T19:12:09Z","updated_at":"2015-01-27T17:57:15Z","closed_at":null,"body":"Minimal reproduction case here: https://s3.amazonaws.com/redcfc/asdk-crash.tar.gz\r\n\r\nUsed layer-backed rasterized subnodes in ASTableView or ASCollectionViews, crashed both ways.\r\n\r\nerror:\r\n```objc\r\n2015-01-23 10:57:13.919 Example[30314:512476] *** Assertion failure in -[ASDisplayNode display], /Users/toulouse/code/archive/Example/Pods/AsyncDisplayKit/AsyncDisplayKit/Details/ASRangeController.mm:30\r\n2015-01-23 10:57:13.921 Example[30314:512476] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'backing store must be loaded before calling -display'\r\n*** First throw call stack:\r\n(\r\n\t0   CoreFoundation                      0x000000010665cf35 __exceptionPreprocess + 165\r\n\t1   libobjc.A.dylib                     0x0000000108889bb7 objc_exception_throw + 45\r\n\t2   CoreFoundation                      0x000000010665cd9a +[NSException raise:format:arguments:] + 106\r\n\t3   Foundation                          0x0000000106f335df -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195\r\n\t4   Example                             0x0000000105d9f166 -[ASDisplayNode(ASRangeController) display] + 582\r\n\t5   Example                             0x0000000105d9f57a -[ASDisplayNode(ASRangeController) recursivelyDisplay] + 602\r\n\t6   Example                             0x0000000105d9f4ad -[ASDisplayNode(ASRangeController) recursivelyDisplay] + 397\r\n\t7   Example                             0x0000000105d9f4ad -[ASDisplayNode(ASRangeController) recursivelyDisplay] + 397\r\n\t8   Example                             0x0000000105da01e8 -[ASRangeController addNodeToWorkingRange:] + 856\r\n\t9   Example                             0x0000000105da151d __48-[ASRangeController updateVisibleNodeIndexPaths]_block_invoke92 + 93\r\n\t10  CoreFoundation                      0x0000000106595042 __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 114\r\n\t11  CoreFoundation                      0x000000010659479c -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 300\r\n\t12  Example                             0x0000000105da1013 -[ASRangeController updateVisibleNodeIndexPaths] + 2131\r\n\t13  Foundation                          0x0000000106ecfd55 __NSFireDelayedPerform + 387\r\n\t14  CoreFoundation                      0x00000001065c4f64 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20\r\n\t15  CoreFoundation                      0x00000001065c4b25 __CFRunLoopDoTimer + 1045\r\n\t16  CoreFoundation                      0x0000000106587e5d __CFRunLoopRun + 1901\r\n\t17  CoreFoundation                      0x0000000106587486 CFRunLoopRunSpecific + 470\r\n\t18  GraphicsServices                    0x000000010b3539f0 GSEventRunModal + 161\r\n\t19  UIKit                               0x0000000107595420 UIApplicationMain + 1282\r\n\t20  Example                             0x0000000105d3b4fe top_level_code + 78\r\n\t21  Example                             0x0000000105d3b53a main + 42\r\n\t22  libdyld.dylib                       0x0000000109063145 start + 1\r\n\t23  ???                                 0x0000000000000001 0x0 + 1\r\n)\r\nlibc++abi.dylib: terminating with uncaught exception of type NSException\r\n(lldb) \r\n```\r\nessential code:\r\n\r\n```swift\r\nclass CrashyNode: ASDisplayNode {\r\n    var circleNode : ASDisplayNode\r\n\r\n    override init() {\r\n        self.circleNode = ASDisplayNode()\r\n        circleNode.backgroundColor = UIColor.redColor()\r\n        circleNode.layerBacked = true;\r\n\r\n        super.init();\r\n        self.layerBacked = true;\r\n        self.shouldRasterizeDescendants = true;\r\n\r\n        self.addSubnode(circleNode);\r\n    }\r\n\r\n    override func calculateSizeThatFits(constrainedSize: CGSize) -> CGSize {\r\n        return CGSizeMake(100, 100);\r\n    }\r\n\r\n    override func layout() {\r\n        circleNode.cornerRadius = CGRectGetHeight(self.bounds) / 2;\r\n        circleNode.frame = self.bounds;\r\n    }\r\n}\r\n```\r\n\r\n```swift\r\nclass ReproCellNode: ASCellNode {\r\n    var crashyNode : CrashyNode\r\n\r\n    override init() {\r\n        self.crashyNode = CrashyNode()\r\n\r\n        super.init()\r\n\r\n        self.addSubnode(crashyNode)\r\n    }\r\n\r\n    override func calculateSizeThatFits(constrainedSize: CGSize) -> CGSize {\r\n        var availableSize = CGSizeMake(constrainedSize.width - 2 * 15,\r\n            constrainedSize.height - 2 * 15);\r\n        var crashyNodeSize = crashyNode.measure(availableSize)\r\n        return CGSizeMake(\r\n            ceil(2 * 15 + crashyNodeSize.width),\r\n            ceil(2 * 15 + crashyNodeSize.height));\r\n\r\n    }\r\n\r\n    override func layout() {\r\n        self.crashyNode.frame = CGRectInset(self.bounds, 15, 15)\r\n    }\r\n}\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/comments/71694741","html_url":"https://github.com/facebook/AsyncDisplayKit/issues/244#issuecomment-71694741","issue_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/244","id":71694741,"user":{"login":"rnystrom","id":739696,"avatar_url":"https://avatars.githubusercontent.com/u/739696?v=3","gravatar_id":"","url":"https://api.github.com/users/rnystrom","html_url":"https://github.com/rnystrom","followers_url":"https://api.github.com/users/rnystrom/followers","following_url":"https://api.github.com/users/rnystrom/following{/other_user}","gists_url":"https://api.github.com/users/rnystrom/gists{/gist_id}","starred_url":"https://api.github.com/users/rnystrom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnystrom/subscriptions","organizations_url":"https://api.github.com/users/rnystrom/orgs","repos_url":"https://api.github.com/users/rnystrom/repos","events_url":"https://api.github.com/users/rnystrom/events{/privacy}","received_events_url":"https://api.github.com/users/rnystrom/received_events","type":"User","site_admin":false},"created_at":"2015-01-27T17:57:15Z","updated_at":"2015-01-27T17:57:15Z","body":"Holy cow, this is a great find!\r\n\r\nTurns out what is happening is that `shouldRasterizeDescendants` being set to YES, but all child nodes are receiving a [display](https://github.com/facebook/AsyncDisplayKit/blob/master/AsyncDisplayKit/Details/ASRangeController.mm#L27-44) message. Since the parent node is rastered, the child nodes actually don't have a backing store (layer/view), so display should never be called on them."}}