RHAddressBook icon indicating copy to clipboard operation
RHAddressBook copied to clipboard

Crash when Addressbook changes.

Open pranavss11 opened this issue 11 years ago • 11 comments

My App is crashing when the addressbook is changed. How do I debug this? AddressBook ABAddressBookHasUnsavedChanges + 79 1 AddressBook ABLogAPIUsage + 26 2 RHAddressBook.m line 1055 34-[RHAddressBook hasUnsavedChanges]_block_invoke 3 libdispatch.dylib
_dispatch_client_callout + 22 4 libdispatch.dylib
_dispatch_barrier_sync_f_slow + 230 5 RHAddressBook.m line 1054 -[RHAddressBook hasUnsavedChanges] 6 RHAddressBook.m line 1069 -[RHAddressBook addressBookExternallyChanged:] 7 CoreFoundation
__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER
+ 12 8 CoreFoundation
_CFXNotificationPost + 1720 9 Foundation
-[NSNotificationCenter postNotificationName:object:userInfo:] + 72 10 Foundation
-[NSNotificationCenter postNotificationName:object:] + 30 11 libdispatch.dylib
_dispatch_call_block_and_release + 10 19 UIKit
UIApplicationMain + 1136 20
main.m line 16 main

pranavss11 avatar May 23 '14 21:05 pranavss11

Have the same crash.

antigp avatar Jun 03 '14 14:06 antigp

Same problem here

alexrecarey avatar Jun 12 '14 13:06 alexrecarey

Happens to me after I do a [person setImage:image]; and then [addressBook save];

crash is on -(BOOL)hasUnsavedChanges{ in RHAddressBook.m

any progress with that?

idokleinman avatar Jun 13 '14 21:06 idokleinman

Are you using ARC? CocoaPods? What version/s of iOS? What library Version? Device or Simulator? All of these things would be useful to enable further debugging. Full crash log would also be useful (with all threads).

heardrwt avatar Jun 13 '14 22:06 heardrwt

ARC - Yes CocoaPods - Yes iOS - 7.1.1 Library Version - Using RHAddressBook (1.1.1) Crash on Device. Thanks!

Attached from Crashlytics: screen shot 2014-06-13 at 3 46 36 pm screen shot 2014-06-13 at 3 46 52 pm screen shot 2014-06-13 at 3 47 04 pm

pranavss11 avatar Jun 13 '14 22:06 pranavss11

I see that there is a new version (1.2.0) of RHAddressBook, and some changes have been made to the hasUnsavedChanges and revert methods.

Do these fix this issue? Would you mind pushing the version to 1.2.0 to CocoaPods?

alexrecarey avatar Jul 25 '14 14:07 alexrecarey

Unfortunately i've had a report that the changes didn't actually fix the issue. I've never actually been able to reproduce the crash myself, so debugging the issue is made harder than would normally be the case..

Any chance you could put together a sample project that causes the crash to occur?

Happy to push to cocoapods, however ill hold off until i know the crash is fixed..

heardrwt avatar Jul 25 '14 18:07 heardrwt

In my app, I couldn't get it to reproduce consistently. The way I fixed it was to create a sharedInstance of RHAddressBook for the app.

On Fri, Jul 25, 2014 at 11:55 AM, Richard Heard [email protected] wrote:

Unfortunately i've had a report that the changes didn't actually fix the issue. I've never actually been able to reproduce the crash myself, so debugging the issue is made harder than would normally be the case..

Any chance you could put together a sample project that causes the crash to occur?

Happy to push to cocoapods, however ill hold off until i know the crash is fixed..

— Reply to this email directly or view it on GitHub https://github.com/heardrwt/RHAddressBook/issues/56#issuecomment-50189957 .

-x

pranavss11 avatar Jul 26 '14 03:07 pranavss11

Hmmm... interesting.. I wonder if the last strong reference to the actual addressbook is being released.. Perhaps on receipt of a change notification..

heardrwt avatar Jul 28 '14 07:07 heardrwt

In my app I have also not been able to reproduce it consistently. Will try out the sharedInstance fix and report back. Will also try to find out what triggers it. Just the thought of going back to using straight C with ABAddressBook book sends shivers down my spine :cold_sweat:

alexrecarey avatar Sep 08 '14 13:09 alexrecarey

@heardrwt I was able to find fairly reproducible steps for this that might help. Basically if I keep going to the settings app and toggle icloud contacts off->on (and delete from the phone) then come back to my app, it will frequently crash. This can be caught in the zombies tool using the simulator. Happy to give any more information. Thanks!

johnryan avatar Mar 21 '15 15:03 johnryan