Hi,
I'm encountering a crash when attempting to enumerate contacts using a block-based enumeration method. The crash log shows an EXC_BAD_ACCESS error.
I suspect the crash may be related to a memory management issue, but I'm having trouble pinpointing the exact cause. The crash have on Crashlytics but can not reproduce.
Has anyone else encountered this issue or have any suggestions for troubleshooting this type of crash?
Any help would be greatly appreciated. Thank you!
Crash log:
EXC_BAD_ACCESS (KERN_INVALID_ADDRESS)
0 libobjc.A.dylib 0x307c objc_retain_x8 + 16
1 Contacts 0x2c318 __52-[CNXPCDataMapper contactObservableForFetchRequest:]_block_invoke + 260
2 ContactsFoundation 0xc344 __26-[CNObservable doOnError:]_block_invoke + 320
3 ContactsFoundation 0xc728 __31-[CNObservable doOnCompletion:]_block_invoke + 320
4 ContactsFoundation 0xc728 __31-[CNObservable doOnCompletion:]_block_invoke + 320
5 ContactsFoundation 0xc344 __26-[CNObservable doOnError:]_block_invoke + 320
6 ContactsFoundation 0x8048 __27-[CNObservable doOnCancel:]_block_invoke + 252
7 ContactsFoundation 0xbb88 -[CNObservable enumerateObjectsUsingBlock:] + 404
8 Contacts 0xb48f8 __91-[CNDataMapperContactStore enumerateContactsAndMatchInfoWithFetchRequest:error:usingBlock:]_block_invoke.61 + 552
9 Contacts 0x315c4 __38-[_CNContactsLogger fetchingContacts:]_block_invoke_2 + 44
10 libsystem_trace.dylib 0xa108 os_activity_apply_f + 88
11 Contacts 0x221fc -[_CNContactsLogger fetchingContacts:] + 248
12 Contacts 0x2149c -[CNDataMapperContactStore enumerateContactsAndMatchInfoWithFetchRequest:error:usingBlock:] + 528
13 Contacts 0x21174 -[CNContactStore pool_enumerateContactsWithFetchRequest:error:usingBlock:] + 268
14 Contacts 0x22ab0 -[CNContactStore enumerateContactsWithFetchRequest:error:usingBlock:] + 492
Source code:
@synchronized (contactStore) {
@try {
[contactStore enumerateContactsWithFetchRequest:listKeyToFetch
error:&error
usingBlock:^(CNContact* cnContact, BOOL* stop) {
Contact *contact = [Contact newWithCNContact:cnContact];
if (filter(contact)) {
[contacts addObject:contact];
}
}];
}
}
Post
Replies
Boosts
Views
Activity
From iOS 15.4.0 we have the crash below on Crashlytics but don't known how to reproduce and fix it. I hope someone can provide some insights to fix this.
Fatal Exception: NSGenericException
Attempt to invoke -_activityImage on <_UIShareServiceActivityProxy_Share: 0x286935d40>, which is not supported for proxies to out-of-process activities.
Fatal Exception: NSGenericException
0 CoreFoundation 0x99ee8 __exceptionPreprocess
1 libobjc.A.dylib 0x16704 objc_exception_throw
2 CoreFoundation 0xf1150 __CFDictionaryCreateGeneric
3 ShareSheet 0x77008 _UIShareServiceProxyRaiseInvocationUnsupportedForInstance
4 ShareSheet 0x76f74 -[_UIShareServiceActivityProxy methodSignatureForSelector:]
5 CoreFoundation 0x2e554 ___forwarding___
6 CoreFoundation 0x2dbe0 _CF_forwarding_prep_0
7 ShareSheet 0x4b950 -[UIActivityContentViewController _configureSharingAppCell:itemIdentifier:]
8 ShareSheet 0x4f38 -[UIActivityContentViewController _provideCellForCollectionView:indexPath:itemIdentifier:]
9 ShareSheet 0x4af08 __67-[UIActivityContentViewController _configureCollectionViewIfNeeded]_block_invoke
10 UIKitCore 0x3eae0 -[__UIDiffableDataSource collectionView:cellForItemAtIndexPath:]
11 UIKitCore 0x65cb60 -[UICollectionViewDiffableDataSource collectionView:cellForItemAtIndexPath:]
12 UIKitCore 0x32ae60 -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:isFocused:notify:]
13 UIKitCore 0x4ded0c -[UICollectionView _recomputePreferredAttributesAsNeeded]
14 UIKitCore 0x442c0c -[UICollectionView _viewAnimationsForCurrentUpdateWithCollectionViewAnimator:]
15 UIKitCore 0x88acf8 __102-[UICollectionView _updateWithItems:tentativelyForReordering:propertyAnimator:collectionViewAnimator:]_block_invoke.2339
16 UIKitCore 0x172988 +[UIView(Animation) performWithoutAnimation:]
17 UIKitCore 0x266f3c -[UICollectionView _updateWithItems:tentativelyForReordering:propertyAnimator:collectionViewAnimator:]
18 UIKitCore 0x3e9cb0 -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:collectionViewAnimator:]
19 UIKitCore 0x36e8ac -[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:animator:animationHandler:]
20 UIKitCore 0x85afb4 __179-[_UIDiffableDataSourceViewUpdater _performUpdateWithCollectionViewUpdateItems:dataSourceSnapshot:updateHandler:completion:viewPropertyAnimator:customAnimationsProvider:animated:]_block_invoke.35
21 UIKitCore 0x329d84 -[UICollectionView _performInternalBatchUpdates:]
22 UIKitCore 0x4e4de8 -[UICollectionView _performDiffableUpdate:]
23 UIKitCore 0x98294 -[_UIDiffableDataSourceViewUpdater _performUpdateWithCollectionViewUpdateItems:dataSourceSnapshot:updateHandler:completion:viewPropertyAnimator:customAnimationsProvider:animated:]
24 UIKitCore 0x97eec -[__UIDiffableDataSource _commitNewDataSource:withViewUpdates:viewPropertyAnimator:customAnimationsProvider:animated:commitAlongsideHandler:completion:]
25 UIKitCore 0x35cd8c __122-[__UIDiffableDataSource _applyDifferencesFromSnapshot:viewPropertyAnimator:customAnimationsProvider:animated:completion:]_block_invoke.241
26 UIKitCore 0x856fb4 __122-[__UIDiffableDataSource _applyDifferencesFromSnapshot:viewPropertyAnimator:customAnimationsProvider:animated:completion:]_block_invoke.271
27 libdispatch.dylib 0x3a2c _dispatch_client_callout
28 libdispatch.dylib 0x12c90 _dispatch_lane_barrier_sync_invoke_and_complete
29 UIKitCore 0x31a3b8 -[__UIDiffableDataSource _applyDifferencesFromSnapshot:viewPropertyAnimator:customAnimationsProvider:animated:completion:]
30 UIKitCore 0x32f030 -[__UIDiffableDataSource applyDifferencesFromSnapshot:animatingDifferences:completion:]
31 UIKitCore 0x2d5164 -[UICollectionViewDiffableDataSource applySnapshot:animatingDifferences:completion:]
32 ShareSheet 0x4fe54 -[UIActivityContentViewController dataSourceManager:didPublishDataSourceWithChangeDetails:]
33 ShareSheet 0x1ec30 -[SHSheetContentDataSourceManager updateWithChangeRequest:]
34 ShareSheet 0x4c7fc -[UIActivityContentViewController updateContentWithPeopleProxies:shareProxies:actionProxies:activitiesByUUID:nearbyCountSlotID:animated:reloadData:]
35 ShareSheet 0x65d20 -[SHSheetMainPresenter _updateContentView:]
36 ShareSheet 0xe5f8 -[SHSheetMainPresenter mainInteractorDidUpdateSessionConfiguration:]
37 ShareSheet 0x6acb8 -[SHSheetMainInteractor sessionConfigurationDidChangeForSession:]
38 ShareSheet 0x8d3e8 -[SHSheetSession setConfiguration:]
39 ShareSheet 0x731e8 __67-[SHSheetServiceManager dataSourceUpdatedWithSessionConfiguration:]_block_invoke
40 libdispatch.dylib 0x1e68 _dispatch_call_block_and_release
41 libdispatch.dylib 0x3a2c _dispatch_client_callout
42 libdispatch.dylib 0x11f48 _dispatch_main_queue_drain
43 libdispatch.dylib 0x11b98 _dispatch_main_queue_callback_4CF
44 CoreFoundation 0x52470 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
45 CoreFoundation 0xc374 __CFRunLoopRun
46 CoreFoundation 0x1f838 CFRunLoopRunSpecific
47 GraphicsServices 0x1374 GSEventRunModal
48 UIKitCore 0x513f98 -[UIApplication _run]
49 UIKitCore 0x296060 UIApplicationMain