ABMetadataOperationController initWithAddressBook:ignoredDirectories

My mac app get crah log as this below, any one kow, how does it happen, and how can I sovle it. Thanks a lot.


Application Specific Information:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'could not open metadata shared lock: <ABProcessSharedLock: 0x6000030a4ac0: name=(null), lockFilePath=/private/var/folders/5y/cbjwc3t95lj05lqsx5y5nfxr0000gp/T/.AddressBookLocks/_Users_xxy_Library_Application Support_AddressBook_Metadata_.MetaData.lock_lock, localLock=<NSRecursiveLock: 0x600000e6ef40>{recursion count = 0, name = nil}, fileDescriptor=-1> Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={NSFilePath=/private/var/folders/5y/cbjwc3t95lj05lqsx5y5nfxr0000gp/T/.AddressBookLocks/_Users_xxy_Library_Application Support_AddressBook_Metadata_.MetaData.lock_lock, ABFileDescriptor=-1}'

terminating with uncaught exception of type NSException

abort() called



Application Specific Backtrace 1:

0 CoreFoundation 0x00007fff309e0e65 __exceptionPreprocess + 256

1 libobjc.A.dylib 0x00007fff5ca37720 objc_exception_throw + 48

2 AddressBookCore 0x00007fff407873e1 -[ABMetadataOperationController initWithAddressBook:ignoredDirectories:] + 837

3 AddressBookCore 0x00007fff40786f64 -[ABMetadataOperationController initWithAddressBook:] + 95

4 AddressBookCore 0x00007fff40786e7e +[ABMetadataOperationController sharedInstanceForAddressBook:] + 128

5 AddressBookCore 0x00007fff40786dd6 +[ABMetadataOperationController sharedInstance] + 64

6 AddressBookCore 0x00007fff40786d7e __33-[ABAddressBook validateMetaData]_block_invoke_2 + 29

7 ContactsFoundation 0x00007fff43eebb81 __62-[_CNQueueScheduler afterDelay:performBlock:qualityOfService:]_block_invoke + 25

8 libdispatch.dylib 0x00007fff5dac35c8 _dispatch_block_async_invoke2 + 83

9 libdispatch.dylib 0x00007fff5dab7dcf _dispatch_client_callout + 8

10 libdispatch.dylib 0x00007fff5daba5dc _dispatch_continuation_pop + 427

11 libdispatch.dylib 0x00007fff5dac98ed _dispatch_source_invoke + 2013

12 libdispatch.dylib 0x00007fff5dac5d26 _dispatch_root_queue_drain + 325

13 libdispatch.dylib 0x00007fff5dac64bd _dispatch_worker_thread2 + 90

14 libsystem_pthread.dylib 0x00007fff5dcf770e _pthread_wqthread + 619

15 libsystem_pthread.dylib 0x00007fff5dcf7435 start_wqthread + 13

Replies

My mac app get crah log as this below

Please post the complete Apple crash report for this crash.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

[For those following along at home, PaddyDu sent me a crash report via email.]

Thanks for the crash report. Unfortunately it didn’t reveal anything particularly interesting. We’ve seen this crash a few times (r. 48535511) and it seems to affect a wide range of apps across a wide range of OS releases. My best guess right now is that this in fact a bug in the OS. Analysis of that bug so far does not, alas, suggest any obvious workaround.

How often are you seeing this crash? Can you reproduce it reliably?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

NO, it doesn't happen offen. It occured on our users' mac. They also don't know how it happen. My mac doesn't have this crash.


Can you tell me the implementation of:

ABMetadataOperationController initWithAddressBook:ignoredDirectories.


Or how can I use [ABAddressBook sharedAddress] to prevent this problem.

Can you tell me the implementation of:

ABMetadataOperationController
initWithAddressBook:ignoredDirectories
.

No. I actually had a look at that code before replying yesterday, and my conclusion is that it’s too complex, and too closely entangled with a bunch of the gory implementation details of Address Book, for me to offer any concrete insight here.

Or how can I use

[ABAddressBook sharedAddress]
to prevent this problem.

I’m not sure what you’re proposing here.

Are you calling the Address Book API directly? Or indirectly via the Contacts framework?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

I just call the API about [ABAddressBook sharedAddress].

I just call the API about

[ABAddressBook sharedAddress]
.

Are you asking whether this might help work around the problem? Or have you tried this as a workaround, found that it works, and want to know whether it’s acceptable?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"