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

ASTableNode deleteRowsAtIndexPath Crash #929

Open
fuhailong opened this issue May 21, 2018 · 6 comments
Open

ASTableNode deleteRowsAtIndexPath Crash #929

fuhailong opened this issue May 21, 2018 · 6 comments

Comments

@fuhailong
Copy link

fuhailong commented May 21, 2018

code:
[self.tableNode deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
Log:
*** Assertion failure in -[ASTableView _heightForShadowRowAtIndexPath:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3698.52.10/UITableView.m:12292

crash。
Have anyone ever met this problem?

@nguyenhuy
Copy link
Member

Hi, please share more details the crash, like stack traces, version of the framework that you're using, and maybe a sample project that can reliably reproduce this crash. Thanks!

@fuhailong
Copy link
Author

I found this problem on the IOS version of the 11.3.1 device.
I tried again on the IOS version of 10.3.3 for normal use.

I don't know where to view the frame version. I download it from the master of AsyncDisplayKit project. Due to support ios8.0, Texture project will be wrong, so the use of AsyncDisplayKit project.

ASAssert.m
Thread-local storage is not supported for the current target.

If the minimum support for ios9.0, compile it normally.

At this point, All exception breakpoint is positioned in ASTableView.mm, line:1638.

* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x0000000184dbd2ec libsystem_kernel.dylib`__pthread_kill + 8
    frame #1: 0x0000000184f5e288 libsystem_pthread.dylib`pthread_kill$VARIANT$mp + 376
    frame #2: 0x0000000184d2bd0c libsystem_c.dylib`abort + 140
    frame #3: 0x00000001844c72c8 libc++abi.dylib`abort_message + 132
    frame #4: 0x00000001844e1398 libc++abi.dylib`std::__terminate(void (*)()) + 44
    frame #5: 0x00000001844e0ccc libc++abi.dylib`__cxa_throw + 132
    frame #6: 0x00000001844f0720 libobjc.A.dylib`objc_exception_throw + 364
    frame #7: 0x0000000185336bf8 CoreFoundation`+[NSException raise:format:arguments:] + 104
    frame #8: 0x0000000185d26fa0 Foundation`-[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112
    frame #9: 0x000000018f381194 UIKit`-[UITableView _heightForShadowRowAtIndexPath:] + 476
    frame #10: 0x000000018f4c804c UIKit`-[_UITableViewShadowUpdatesController(UITableViewDelegate) tableView:heightForRowAtIndexPath:] + 172
    frame #11: 0x000000018f0309c8 UIKit`-[UITableView _dataSourceHeightForRowAtIndexPath:] + 112
    frame #12: 0x000000018f209734 UIKit`__66-[UISectionRowData refreshWithSection:tableView:tableViewRowData:]_block_invoke + 332
    frame #13: 0x000000018efa1594 UIKit`-[UISectionRowData refreshWithSection:tableView:tableViewRowData:] + 2684
    frame #14: 0x000000018f53f3a4 UIKit`__56-[UITableViewRowData _sectionRowForGlobalRow:inSection:]_block_invoke + 96
    frame #15: 0x0000000184cd5888 libsystem_c.dylib`bsearch_b + 72
    frame #16: 0x000000018efd0d28 UIKit`-[UITableViewRowData _sectionRowForGlobalRow:inSection:] + 200
    frame #17: 0x000000018efd3e60 UIKit`-[UITableViewRowData indexPathForRowAtGlobalRow:] + 40
    frame #18: 0x000000018f04d8c0 UIKit`-[UITableView _indexPathForCell:usingPresentationValues:] + 260
    frame #19: 0x000000018f36d138 UIKit`-[UITableView _updateAnimationDidStopWithOldVisibleViews:finished:context:] + 1976
    frame #20: 0x000000018f36c8fc UIKit`__46-[UITableView _updateWithItems:updateSupport:]_block_invoke.1304 + 44
    frame #21: 0x0000000185d6c4ac Foundation`__NSFireDelayedPerform + 408
    frame #22: 0x00000001852dfaa8 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
    frame #23: 0x00000001852df76c CoreFoundation`__CFRunLoopDoTimer + 864
    frame #24: 0x00000001852df010 CoreFoundation`__CFRunLoopDoTimers + 248
    frame #25: 0x00000001852dcb60 CoreFoundation`__CFRunLoopRun + 2168
    frame #26: 0x00000001851fcda8 CoreFoundation`CFRunLoopRunSpecific + 552
    frame #27: 0x0000000104c07930 MiaoMiaoZheApp`-[MWUncaughtExceptionHandler handleException:] + 616
    frame #28: 0x0000000185c9b764 Foundation`-[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] + 964
    frame #29: 0x0000000185c9b318 Foundation`-[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:] + 144
    frame #30: 0x0000000104c088a4 MiaoMiaoZheApp`MWHandleException + 108
    frame #31: 0x000000010498799c MiaoMiaoZheApp`BLYUncaughtExceptionHandlerCallback + 152
    frame #32: 0x00000001853371c8 CoreFoundation`__handleUncaughtException + 828
    frame #33: 0x00000001844f08c8 libobjc.A.dylib`_objc_terminate() + 112
    frame #34: 0x00000001049ab104 MiaoMiaoZheApp`BLYCPPExceptionTerminate() + 2004
    frame #35: 0x00000001844e137c libc++abi.dylib`std::__terminate(void (*)()) + 16
    frame #36: 0x00000001844e0ccc libc++abi.dylib`__cxa_throw + 132
    frame #37: 0x00000001844f0720 libobjc.A.dylib`objc_exception_throw + 364
    frame #38: 0x0000000185336bf8 CoreFoundation`+[NSException raise:format:arguments:] + 104
    frame #39: 0x0000000185d26fa0 Foundation`-[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112
    frame #40: 0x000000018f381194 UIKit`-[UITableView _heightForShadowRowAtIndexPath:] + 476
    frame #41: 0x000000018f4c804c UIKit`-[_UITableViewShadowUpdatesController(UITableViewDelegate) tableView:heightForRowAtIndexPath:] + 172
    frame #42: 0x000000018f0309c8 UIKit`-[UITableView _dataSourceHeightForRowAtIndexPath:] + 112
    frame #43: 0x000000018f209734 UIKit`__66-[UISectionRowData refreshWithSection:tableView:tableViewRowData:]_block_invoke + 332
    frame #44: 0x000000018efa1594 UIKit`-[UISectionRowData refreshWithSection:tableView:tableViewRowData:] + 2684
    frame #45: 0x000000018f0306b8 UIKit`-[UITableViewRowData ensureAllSectionsAreValid] + 152
    frame #46: 0x000000018f02cfa4 UIKit`-[UITableView _endCellAnimationsWithContext:] + 4004
    frame #47: 0x000000018f02be34 UIKit`-[UITableView _updateRowsAtIndexPaths:withUpdateAction:rowAnimation:usingPresentationValues:] + 1068
    frame #48: 0x000000018f38ac78 UIKit`__90-[UITableView _addSwipeDeletionShadowUpdatesIfNecessaryWithOldRowData:oldSwipedIndexPath:]_block_invoke.3569 + 132
    frame #49: 0x000000018f1c7360 UIKit`-[UITableView _performBatchUpdates:withContext:completion:] + 244
    frame #50: 0x000000018f1c7258 UIKit`-[UITableView performBatchUpdates:completion:] + 64
    frame #51: 0x000000018f381558 UIKit`-[UITableView _performShadowUpdates:] + 180
    frame #52: 0x000000018f04cd88 UIKit`-[UITableView _addSwipeDeletionShadowUpdatesIfNecessaryWithOldRowData:oldSwipedIndexPath:] + 196
    frame #53: 0x000000018f02fec4 UIKit`-[UITableView _endCellAnimationsWithContext:] + 16068
    frame #54: 0x000000018f02bf10 UIKit`-[UITableView endUpdates] + 92
    frame #55: 0x0000000106112b74 AsyncDisplayKit`__54-[ASTableView rangeController:didUpdateWithChangeSet:]_block_invoke.531 + 56
    frame #56: 0x000000018eecb1c4 UIKit`+[UIView(Animation) performWithoutAnimation:] + 104
    frame #57: 0x000000010611230c AsyncDisplayKit`-[ASTableView rangeController:didUpdateWithChangeSet:] + 3164
    frame #58: 0x00000001060fbd6c AsyncDisplayKit`-[ASRangeController dataController:didUpdateWithChangeSet:] + 88
    frame #59: 0x00000001060b2448 AsyncDisplayKit`__40-[ASDataController updateWithChangeSet:]_block_invoke_3 + 124
    frame #60: 0x0000000106083cb8 AsyncDisplayKit`__30-[ASMainSerialQueue runBlocks]_block_invoke + 160
    frame #61: 0x0000000105a69260 libdispatch.dylib`_dispatch_call_block_and_release + 24
    frame #62: 0x0000000105a69220 libdispatch.dylib`_dispatch_client_callout + 16
    frame #63: 0x0000000105a6ddb0 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 1180
    frame #64: 0x00000001852df070 CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
    frame #65: 0x00000001852dcbc8 CoreFoundation`__CFRunLoopRun + 2272
    frame #66: 0x00000001851fcda8 CoreFoundation`CFRunLoopRunSpecific + 552
    frame #67: 0x00000001871df020 GraphicsServices`GSEventRunModal + 100
    frame #68: 0x000000018f1dd78c UIKit`UIApplicationMain + 236
  * frame #69: 0x00000001043224d8 MiaoMiaoZheApp`main(argc=1, argv=0x000000016bd3b840) at main.m:14
    frame #70: 0x0000000184c8dfc0 libdyld.dylib`start + 4

@ay8s
Copy link
Collaborator

ay8s commented May 21, 2018

@fuhailong Are you able to temporarily bump your project to iOS 9 and try using Texture to see if you run into the same issue?

@fuhailong
Copy link
Author

Thank you very much for looking at this problem,I have found the cause of the problem. It should be that texture and AsyncDisplayKit project did not support the new method of ios11 under UITableViewDelegate.
For example
`

  • (nullable UISwipeActionsConfiguration *)tableView:(UITableView *)tableView trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(tvos);`
    In my corresponding viewcontroller, it is no problem not using the above method. If you use it, crash. I have mentioned another problem (app screen is stuck #928) before, and the cause should be the same, but the problem is due to the use of the [tableNode reloadData] method.

Can the problem of ios8 compile and report wrong under the texture project be solved together? I can change the FrameWork into Texture.

And this question (#785)

Thank you very much.

@codeOfRobin
Copy link

Hi @ay8s @nguyenhuy 👋 Managed to reproduce this crash in the Kittens sample project (ref: #1560 )

@gitKun
Copy link

gitKun commented Nov 30, 2020

You can use:

DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {
    self.dataSource.remove(at: indexPath.row)
    self.addressTableNode.deleteRows(at: [indexPath], with: .automatic)
}

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

5 participants