ABPeoplePickerNavigationController crashes on iOS9 (on selecting linked contact)

Originator:jkirsakmens
Number:rdar://23141714 Date Originated:16-Oct-2015
Status:Closed as duplicate Resolved:
Product:iOS Product Version:9.0.2
Classification:Crash Reproducible:Always
 
Since iOS8 ABPeoplePickerNavigationController does not require us to ask the user's permission when picking a contact. However, when the selecting contact that is linked with another contacts it crashes.

This is a major bug. For selecting simple contact it would be overkill to ask for access to all Contacts if it is just for selecting single contact.

Steps to Reproduce:
1) Create linked contact in the Contacts.app

2) Run attached app on iOS 9, tap [Select from Contacts] button

3) Select contact that is linked with another contact

Expected Results:
After selecting contact app should NSLog contact details in the console.

Actual Results:
Trace: (from device):
2015-10-16 12:24:49.771 bug[2631:2725986] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'A contact and its snapshot should both be non-unified.'
*** First throw call stack:
(0x182a78f5c 0x19757ff80 0x182a78ea4 0x18249fe64 0x18249fa8c 0x1824dbf68 0x1824a98a8 0x1819971b4 0x1825273b4 0x1825a90e8 0x1825a98c4 0x100159d70 0x100159d30 0x10015f780 0x182a30258 0x182a2e0c0 0x18295cdc0 0x18dab0088 0x188036f44 0x1000f8578 0x197daa8b8)
libc++abi.dylib: terminating with uncaught exception of type NSException

Trace (from simulator):
2015-10-16 12:07:55.382 bug[85436:1568705] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'A contact and its snapshot should both be non-unified.'
*** First throw call stack:
(
	0   CoreFoundation                      0x00cfca94 __exceptionPreprocess + 180
	1   libobjc.A.dylib                     0x00559e02 objc_exception_throw + 50
	2   CoreFoundation                      0x00cfc9bd +[NSException raise:format:] + 141
	3   Contacts                            0x051f9deb +[CNCalculatesContactDiff addMultiValueUpdateTo:forProperty:contact1:contact2:] + 626
	4   Contacts                            0x051f99b6 +[CNCalculatesContactDiff diffContact:to:] + 669
	5   Contacts                            0x0523eb12 +[CNContactDiff diffContact:to:] + 52
	6   Contacts                            0x05204f5b -[CNContact(iOSABCompatibility) detachedPerson] + 61
	7   AddressBookUI                       0x00a0dbde -[CNContact(ABCompatibility) recordFromAddressBook:] + 137
	8   AddressBookUI                       0x00a536e7 -[ABPeoplePickerNavigationController contactPicker:didSelectContact:] + 154
	9   ContactsUI                          0x0532273b -[CNContactPickerViewController pickerDidSelectContact:property:] + 324
	10  ContactsUI                          0x053b6c73 -[CNContactPickerHostViewController pickerDidSelectContact:property:] + 102
	11  ContactsUI                          0x053b7528 __71-[CNContactPickerExtensionHostContext pickerDidSelectContact:property:]_block_invoke + 81
	12  libdispatch.dylib                   0x0326a3ff _dispatch_call_block_and_release + 15
	13  libdispatch.dylib                   0x0328d9cd _dispatch_client_callout + 14
	14  libdispatch.dylib                   0x03273018 _dispatch_main_queue_callback_4CF + 910
	15  CoreFoundation                      0x00c4e70e __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14
	16  CoreFoundation                      0x00c0c454 __CFRunLoopRun + 2356
	17  CoreFoundation                      0x00c0b866 CFRunLoopRunSpecific + 470
	18  CoreFoundation                      0x00c0b67b CFRunLoopRunInMode + 123
	19  GraphicsServices                    0x0429f664 GSEventRunModal + 192
	20  GraphicsServices                    0x0429f4a1 GSEventRun + 104
	21  UIKit                               0x0108bcc1 UIApplicationMain + 160
	22  bug                                 0x00084cda main + 138
	23  libdyld.dylib                       0x032b7a21 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException


Version:
iOS 9.0.2 (13A452)

Notes:
Related radars:
rdar://23006507

Configuration:
iPhone 5S 64G

Attachments:
'bug.zip' was successfully uploaded.

Comments

Closed as duplicate of rdar://23006507

By jkirsakmens at Nov. 4, 2015, 8:40 a.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!