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 when I'm trying to close view controller with delete button enabled #225

Closed
danilNil opened this issue Dec 18, 2013 · 4 comments
Closed

Comments

@danilNil
Copy link

Here is steps:

screen shot 2013-12-18 at 15 51 14
screen shot 2013-12-18 at 15 53 06
screen shot 2013-12-18 at 15 51 44

I've created fork so you can reproduce the bug more easily:
https://github.com/danilNil/couchbase-lite-ios

@snej
Copy link
Contributor

snej commented Dec 18, 2013

The screenshot doesn’t show the backtrace of the crash, unfortunately. At the bottom of the left-hand thread/stack pane, there is a slider. Slide it all the way to the right to increase the level of detail in the stack; that will show all the frames.

And actually it’s much more compact to get a backtrace by entering bt in the debugger console pane, then copying and pasting the output.

Thanks!

@danilNil
Copy link
Author

Hi Jens,

Sorry, here is backtrace:

#0  0x01d2c0b2 in objc_msgSend ()
#1  0x00824181 in -[UITableView _canEditRowAtIndexPath:] ()
#2  0x0083a343 in -[UITableView _setupCell:forEditing:atIndexPath:animated:updateSeparators:] ()
#3  0x00832b4d in -[UITableView _setEditing:animated:forced:] ()
#4  0x0083ba09 in -[UITableView _endSwipeToDeleteRowDidDelete:] ()
#5  0x008328bb in -[UITableView willMoveToSuperview:] ()
#6  0x007a63cf in __UIViewWillBeRemovedFromSuperview ()
#7  0x007a6238 in -[UIView(Hierarchy) removeFromSuperview] ()
#8  0x007c26bf in -[UIScrollView removeFromSuperview] ()
#9  0x0079c715 in -[UIView dealloc] ()
#10 0x0079a124 in -[UIView release] ()
#11 0x01f1acb0 in CFRelease ()
#12 0x01f3a25e in -[__NSArrayM dealloc] ()
#13 0x01d2d692 in objc_object::sidetable_release(bool) ()
#14 0x01d2ce81 in objc_release ()
#15 0x01d2dce7 in (anonymous namespace)::AutoreleasePoolPage::pop(void*) ()
#16 0x01f3a968 in _CFAutoreleasePoolPop ()
#17 0x01f3f6c3 in __CFRunLoopRun ()
#18 0x01f3eac3 in CFRunLoopRunSpecific ()
#19 0x01f3e8db in CFRunLoopRunInMode ()
#20 0x021f39e2 in GSEventRunModal ()
#21 0x021f3809 in GSEventRun ()
#22 0x0074bd3b in UIApplicationMain ()
#23 0x0001dccd in main at /Users/danil/Documents/Al Digit/Projects/Couchbase project/Couchbase-Lite-Demo-CRM/CBLiteCRM/CBLiteCRM/main.m:16

Seems that here is couch base lite SDK issue. I've created fork because I'd like to take a look into SDK code and find the reason. Unfortunately it's not so easy.
After we close view controller CBLUITableSource deallocated but table view is still alive. The crash fixed by changing dealloc method in RootViewController.m:
- (void)dealloc {
self.tableView.dataSource = nil;
[self forgetSync];
}

@snej
Copy link
Contributor

snej commented Dec 19, 2013

I don’t think this is a CBL issue, just an ordinary UIKit-related app problem involving the order that objects get deallocated. (I think this could happen whether or not the table’s data source object used Couchbase Lite.) Your workaround sounds reasonable.

@danilNil
Copy link
Author

You are right that's UIKit issue. I've builded project from scratch and data source always get deallocated before table view. Actually the crash happened in iOS7 only. Table view would like to call delegate method before dealloc.

@snej snej closed this as completed Dec 20, 2013
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

2 participants