swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.59k stars 10.37k forks source link

[SR-2103] Crash in IndexPath._unconditionallyBridgeFromObjectiveC #44711

Closed swift-ci closed 8 years ago

swift-ci commented 8 years ago
Previous ID SR-2103
Radar None
Original Reporter IngmarStein (JIRA User)
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Standard Library | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 451aa8cb2302e3606f210d50c36b0f4c

relates to:

Issue Description:

I'm implementing `UITableViewDelegate.tableView(_:didEndEditingRowAt:) and experience a crash with the following stack trace on iOS 10:

    #​0  0x000000010dfa8e8a in static IndexPath._unconditionallyBridgeFromObjectiveC(NSIndexPath?) -> IndexPath ()
    #​1  0x0000000109b5e727 in @objc CarViewController.tableView(UITableView, didEndEditingRowAt : IndexPath) -> () ()
    #​2  0x000000010bfcf5dd in -[UITableView _sendDidEndEditingForIndexPath:] ()
    #​3  0x000000010bff2e98 in -[UITableView _endSwipeToDeleteRowDidDelete:] ()
    #​4  0x000000010bfc2c8c in -[UITableView _endCellAnimationsWithContext:] ()
    #&#8203;5  0x0000000109b5f844 in CarViewController.controllerDidChangeContent(NSFetchedResultsController<NSFetchRequestResult>) -> () at CarViewController.swift:629
    #&#8203;6  0x0000000109b5f8da in @objc CarViewController.controllerDidChangeContent(NSFetchedResultsController<NSFetchRequestResult>) -> () ()
    #&#8203;7  0x000000010aaccb88 in __82-[NSFetchedResultsController(PrivateMethods) _core_managedObjectContextDidChange:]_block_invoke ()
    #&#8203;8  0x000000010a9ace5c in developerSubmittedBlockToNSManagedObjectContextPerform ()
    #&#8203;9  0x000000010a9acd2f in -[NSManagedObjectContext performBlockAndWait:] ()
    #&#8203;10 0x000000010aacb3e7 in -[NSFetchedResultsController(PrivateMethods) _core_managedObjectContextDidChange:] ()
    #&#8203;11 0x000000010adec74c in __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ ()
    #&#8203;12 0x000000010adec64b in _CFXRegistrationPost ()
    #&#8203;13 0x000000010adec3b2 in ___CFXNotificationPost_block_invoke ()
    #&#8203;14 0x000000010adaf072 in -[_CFXNotificationRegistrar find:object:observer:enumerator:] ()
    #&#8203;15 0x000000010adae10b in _CFXNotificationPost ()
    #&#8203;16 0x0000000109f7f92b in -[NSNotificationCenter postNotificationName:object:userInfo:] ()
    #&#8203;17 0x000000010a9957d0 in -[NSManagedObjectContext(_NSInternalNotificationHandling) _postObjectsDidChangeNotificationWithUserInfo:] ()
    #&#8203;18 0x000000010aa27e61 in -[NSManagedObjectContext(_NSInternalChangeProcessing) _createAndPostChangeNotification:deletions:updates:refreshes:deferrals:wasMerge:] ()
    #&#8203;19 0x000000010a98f6f2 in -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:] ()
    #&#8203;20 0x000000010a99333c in -[NSManagedObjectContext save:] ()

My interpretation is that something bad happens when bridging NSIndexPath to IndexPath.

swift-ci commented 8 years ago

Comment by Ingmar Stein (JIRA)

Fixed in Xcode 8 Beta 3