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

Scrolling ASTableNode in editing mode causes NSRangeException #83

Closed
rewcraig opened this issue Apr 28, 2017 · 0 comments
Closed

Scrolling ASTableNode in editing mode causes NSRangeException #83

rewcraig opened this issue Apr 28, 2017 · 0 comments

Comments

@rewcraig
Copy link
Contributor

rewcraig commented Apr 28, 2017

Put an ASTableNode into editing mode and scroll up/down. An NSRangeException will be produced.

This bug appears to happen if the ASCellNode will have a different height in editing vs. non-editing mode. With the provided example, an ASTextNode with only a few characters does not produce the exception.

2017-04-28 12:50:17.325 ASTableEdit[61429:1412415] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 11 beyond bounds [0 .. 10]'
*** First throw call stack:
(
0 CoreFoundation 0x000000010ce10b0b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000109cc6141 objc_exception_throw + 48
2 CoreFoundation 0x000000010cd4605b -[__NSArrayM objectAtIndex:] + 203
3 UIKit 0x000000010a2d8fdc -[UITableView _updateVisibleCellsNow:isRecursive:] + 2064
4 UIKit 0x000000010a30d97c -[UITableView _performWithCachedTraitCollection:] + 111
5 UIKit 0x000000010a2f4b2a -[UITableView layoutSubviews] + 233
6 AsyncDisplayKit 0x000000010945e76d -[ASTableView layoutSubviews] + 733
7 UIKit 0x000000010a25b20b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1268
8 QuartzCore 0x000000010dd7b904 -[CALayer layoutSublayers] + 146
9 AsyncDisplayKit 0x00000001092d86b0 -[_ASDisplayLayer layoutSublayers] + 384
10 QuartzCore 0x000000010dd6f526 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 370
11 QuartzCore 0x000000010dd6f3a0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
12 QuartzCore 0x000000010dcfee92 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
13 QuartzCore 0x000000010dd2b130 _ZN2CA11Transaction6commitEv + 468
14 QuartzCore 0x000000010dd2bb37 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 115
15 CoreFoundation 0x000000010cdb6717 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23
16 CoreFoundation 0x000000010cdb6687 __CFRunLoopDoObservers + 391
17 CoreFoundation 0x000000010cd9b720 __CFRunLoopRun + 1200
18 CoreFoundation 0x000000010cd9b016 CFRunLoopRunSpecific + 406
19 GraphicsServices 0x0000000110707a24 GSEventRunModal + 62
20 UIKit 0x000000010a1980d4 UIApplicationMain + 159
21 ASTableEdit 0x0000000109219767 main + 55
22 libdyld.dylib 0x000000010e06265d start + 1
23 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

The exception started appearing in Texture 2.3. AsyncDisplayKit 2.2 does not suffer from this issue.

Example:
ASTableEdit.zip

nguyenhuy added a commit to nguyenhuy/Texture that referenced this issue Jul 4, 2017
…ing layoutSubviews

- Previously, when a change set is empty, `ASDataController` forwards the change set to its delegate right away, without dispatching to its editing queue and then back to main.
- This behaviour can potentially cause bad internal states in UITableView which trigger a crash reported in TextureGroup#83.
- Fix by still reusing the existing pending map, because the data source's state has not changed, but go through the editing queue and main queue tunnel.
nguyenhuy added a commit that referenced this issue Jul 5, 2017
…mpty change set during layoutSubviews (#416)

* Fix a crash in table view caused by executing an empty change set during layoutSubviews
- Previously, when a change set is empty, `ASDataController` forwards the change set to its delegate right away, without dispatching to its editing queue and then back to main.
- This behaviour can potentially cause bad internal states in UITableView which trigger a crash reported in #83.
- Fix by still reusing the existing pending map, because the data source's state has not changed, but go through the editing queue and main queue tunnel.

* Update CHANGELOG
bernieperez pushed a commit to AtomTickets/Texture that referenced this issue Apr 25, 2018
…mpty change set during layoutSubviews (TextureGroup#416)

* Fix a crash in table view caused by executing an empty change set during layoutSubviews
- Previously, when a change set is empty, `ASDataController` forwards the change set to its delegate right away, without dispatching to its editing queue and then back to main.
- This behaviour can potentially cause bad internal states in UITableView which trigger a crash reported in TextureGroup#83.
- Fix by still reusing the existing pending map, because the data source's state has not changed, but go through the editing queue and main queue tunnel.

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

No branches or pull requests

1 participant