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

[Crash] static IndexPath._unconditionallyBridgeFromObjectiveC(NSIndexPath?) -> IndexPath #297

Closed
muukii opened this issue May 20, 2017 · 3 comments

Comments

@muukii
Copy link
Contributor

muukii commented May 20, 2017

Where:

ASCellNode, ASCellNode.subnodes

Crashed: com.apple.main-thread
0  libswiftFoundation.dylib       0x100f16c44 static IndexPath._unconditionallyBridgeFromObjectiveC(NSIndexPath?) -> IndexPath (__hidden#3516_:239)
1  App                            0x10055cc5c @objc MessagingListViewController.collectionNode(ASCollectionNode, constrainedSizeForItemAt : IndexPath) -> ASSizeRange (MessagingListViewController.swift)
2  AsyncDisplayKit                0x1016a571c -[ASCollectionViewFlowLayoutInspector collectionView:constrainedSizeForNodeAtIndexPath:] (ASCollectionViewFlowLayoutInspector.m:70)
3  AsyncDisplayKit                0x101632f60 -[ASCollectionView dataController:constrainedSizeForNodeAtIndexPath:] (ASCollectionView.mm:1703)
4  AsyncDisplayKit                0x10163ac3c -[ASDataController constrainedSizeForNodeOfKind:atIndexPath:] (ASDataController.mm:460)
5  AsyncDisplayKit                0x10163ab20 -[ASDataController constrainedSizeForElement:inElementMap:] (ASDataController.mm:445)
6  AsyncDisplayKit                0x10163cc88 -[ASDataController relayoutNodes:nodesSizeChanged:] (ASDataController.mm:726)
7  AsyncDisplayKit                0x1016317f8 -[ASCollectionView layoutSubviews] (ASCollectionView.mm:1436)
8  UIKit                          0x189439354 <redacted> + 1200
9  QuartzCore                     0x186629274 -[CALayer layoutSublayers] + 148
10 AsyncDisplayKit                0x10160d474 -[_ASDisplayLayer layoutSublayers] (_ASDisplayLayer.mm:132)
11 QuartzCore                     0x18661dde8 CA::Layer::layout_if_needed(CA::Transaction*) + 292
12 QuartzCore                     0x1866291b4 -[CALayer layoutIfNeeded] + 208
13 AsyncDisplayKit                0x1016551d4 -[ASDisplayNode _recursivelyTriggerDisplayAndBlock:] (ASDisplayNode.mm:2236)
14 AsyncDisplayKit                0x10165498c __49+[ASDisplayNode scheduleNodeForRecursiveDisplay:]_block_invoke_2 (ASDisplayNode.mm:2097)
15 AsyncDisplayKit                0x1016903f0 -[ASRunLoopQueue processQueue] (iterator:1190)
16 CoreFoundation                 0x1832b89a8 <redacted> + 32
17 CoreFoundation                 0x1832b6630 <redacted> + 372
18 CoreFoundation                 0x1832b6a7c <redacted> + 956
19 CoreFoundation                 0x1831e6da4 CFRunLoopRunSpecific + 424
20 GraphicsServices               0x184c50074 GSEventRunModal + 100
21 UIKit                          0x1894a1330 UIApplicationMain + 208
22 Pairs                          0x10003039c main (AppDelegate.swift:25)
23 libdyld.dylib                  0x1821f559c <redacted> + 4

When

call setNeedsLayout() when Node.interfaceState is [.measureLayout, .preload, .display] 0b111

// interfaceState
0b0000 causes nothing
0b1111 causes nothing
0b0111 causes crash

Proposal

setNeedsLayout has special behavior on ASCollectionNode.
I think that This especially behavior should be modified that ignore setNeedsLayout when interfaceState is [.measureLayout, .preload, .display].

but, Swift3.1 could be having essential problems.

What do you think?

@nguyenhuy
Copy link
Member

@muukii Thanks for reporting. It seems like the app crashed while the index path was crossing the ObjC - Swift bridge. One possibility is that the index path was nil which is because the item at that index path was visible but no longer existed in the pendingMap. That means it was deleted recently but the change had not yet been propagated to the UIKit index space.

We landed a fix recently that I believe should address this issue: #279. Could you please try to reproduce it with latest master?

@muukii
Copy link
Contributor Author

muukii commented May 20, 2017

@nguyenhuy
Thanks for reply and information!
I just checked it on master branch.
It was fixed! Thank you!

@muukii muukii closed this as completed May 20, 2017
@nguyenhuy
Copy link
Member

Awesome! Definitely let us know if you encounter other issues in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants