开发者

iOS Stack Trace Mystery, ABRecordCopyValue Is Suspect

开发者 https://www.devze.com 2023-04-03 02:03 出处:网络
I\'m currently using TestFlight in order to get remote crash reports on a beta version of our app.I\'ve received a stack trace, however I\'m not quite sure how to narrow down the problem.Here\'s the r

I'm currently using TestFlight in order to get remote crash reports on a beta version of our app. I've received a stack trace, however I'm not quite sure how to narrow down the problem. Here's the report I've received:

0 Holler 0x0003f2a1 Holler + 254625
1 Holler 0x0003f6b7 Holler + 255671
2 libsystem_c.dylib 0x344da72f _sigtramp + 42
3 AppSupport 0x34dfc58d CPRecordCopyProperty + 12
4 AddressBook 0x33e333bf ABRecordCopyValue + 14
5 Holler 0x00018df5 Holler + 97781
6 Holler 0x000182d3 Holler + 94931
7 Holler 0x0000a561 Holler + 38241
8 Holler 0x00033e0f Holler + 208399
9 CoreFoundation 0x3675d571 -[NSObject(NSObject) performSelector:withObject:withObject:] + 24
10 UIKit 0x355efec9 -[UIApplication sendAction:to:from:forEvent:] + 84
11 UIKit 0x355efe69 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 32
12 UIKit 0x355efe3b -[UIControl sendAction:to:forEvent:] + 38
13 UIKit 0x355efb8d -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 356
14 UIKit 0x355f0423 -[UIControl touchesEnded:withEvent:] + 342
15 UIKit 0x355eebf5 -[UIWindow _sendTouchesForEvent:] + 368
16 UIKit 0x355ee56f -[UIWindow sendEvent:] + 262
17 UIKit 0x355d7313 -[UIApplication sendEvent:] + 298
18 UIKit 0x355d6c53 _UIApplicationHandleEvent + 5090
19 GraphicsServices 0x35f11e77 PurpleEventCallback + 666
20 CoreFoundation 0x367c4a97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
21 CoreFoundation 0x367c683f __CFRunLoopDoSource1 + 166
22 CoreFoundation 0x367c760d __CFRunLoopRun + 520
23 CoreFoundation 0x36757ec3 CFRunLoopRunSpecific + 230
24 CoreFoundation 0x36757dcb CFRunLoopRunInMode + 58
25 GraphicsServices 0x35f1141f GSEventRunModal + 114
26 GraphicsServices 0x35f114cb GSEventRun + 62
27 UIKit 0x35601d69 -[UIApplication _run] + 404
28 UIKit 0x355ff807 UIApplicationMain + 670
29 Holler 0x00002d79 Holler + 7545
30 Holler 0x00002d44 Holler + 7492

Unfortunately the last 8 items in the stack trace don't appear to be symbolicated. Is there a way for me to do this? I'm assuming hte problem is related to ABRecordCopyValue however I'm not 100% certain. Since I don't know what the last two Holler calls are, I'm somewhat confused. Anybody have an idea about what I should do to narrow down the problem?

I believe the problem now resides within a specific method as the sequence of events (ABRecordCopyValue) followed by two Holler calls is repeated. Here's the code ... I'm using it to load up a user's phone book/contact list. Let me know if this provides any more details:

ContactLists *list = [ContactLists defaultLists];

//Delete the phone contacts, and load them
[list clearContacts];
//Load them
ABAddressBookRef addressbook = ABAddressBookCreate();
if( addressbook )
{
    //Got this via http://stackoverflow.com/questions/4641229/code-example-for-abaddressbookcopyarrayofallpeopleinsourcewithsortordering
    ABRecordRef source = ABAddressBookCopyDefaultSource(addressbook);
    CFArrayRef sortedPeople = ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering(addressbook, source, kABPersonSortByFirstName);
    //Sort them first

    if( sortedPeople )
    {
        CFIndex contactCount = ABAddressBookGetPersonCount(addressbook);

        for( int i = 0; i<contactCount; i++ )
        {
            ABRecordRef ref = CFArrayGetValueAtIndex(sortedPeople, i);
            NSMutableString *fName = [[[NSMutableString alloc] init] autorelease];
            NSMutableString *lName = [[[NSMutableString alloc] init] autorelease];
            NSMutableDictionary *identifiers = [[[NSMutableDictionary alloc]init]autorelease];
            if( ref )
            {
                //Get the user's name first
                CFStringRef firstName = ABRecordCopyValue(ref, kABPersonFirstNameProperty);
                if( firstName )
                {
                    NSString *fn = [NSString stringWithFormat:@"%@",firstName];
                    if([fn hasPrefix:@"(null"])
                        [fName appendString:@""];
                    else
                    {
                        [fName appendString:[NSString stringWithFormat:@"%@", firstName]];
                        [fName setString:[fName stringByReplacingCharactersInRange:NSMakeRange(0,1) withString:[[fName substringToIndex:1]uppercaseString]]];
                    }
                    CFRelease(firstName);
                }
                CFStringRef lastName = ABRecordCopyValue(ref, kABPersonLastNameProperty);
                if( lastName )
                {
                    NSString *ln = [NSString stringWithFormat:@"%@",lastName];
                    if([ln hasPrefix:@"(null"])
                        [lName appendString:@""];
                    else
                        [lName appendString:[NSString stringWithFormat:@"%@",lastName]];
                    CFRelease(lastName);
                }
                //If there is no first name don't deal with adding this contact to the ContactsList
                if( [fName isEqualToString:@""] )
                {
                    continue;
                }

                //Handle phone and email contacts
                ABMultiValueRef phoneRef = ABRecordCopyValue(ref, kABPersonPhoneProperty);
                if(phoneRef)
                {
                    for( int i = 0; i<ABMultiValueGetCount(phoneRef); i++ )
                    {
                        CFStringRef phone = ABMultiValueCopyValueAtIndex(phoneRef, i);
                        if (phone) {
                            //Create the contact and add them to the phone contactList
                            NSString *mobileLabel = (NSString *)ABMultiValueCopyLabelAtIndex(phoneRef, i);
                            if( [mobileLabel isEqualToString:(NSString *)kABPersonPhoneMobileLabel] )
                                开发者_开发百科[identifiers setValue:(NSString *)phone forKey:@"Mobile:"];
                            if( [mobileLabel isEqualToString:(NSString *)kABPersonPhoneIPhoneLabel] )
                                [identifiers setValue:(NSString *)phone forKey:@"iPhone:"];
                            if( [mobileLabel isEqualToString:(NSString *)kABPersonPhoneMainLabel] )
                                [identifiers setValue:(NSString *)phone forKey:@"Main:"];
                            if( [mobileLabel isEqualToString:(NSString *)kABWorkLabel] )
                                [identifiers setValue:(NSString *)phone forKey:@"Work:"];
                            if( [mobileLabel isEqualToString:(NSString *)kABHomeLabel] )
                                [identifiers setValue:(NSString *)phone forKey:@"Home:"];
                            if( [mobileLabel isEqualToString:(NSString *)kABOtherLabel] )
                                [identifiers setValue:(NSString *)phone forKey:@"Other:"];

                            CFRelease(phone);
                            [mobileLabel release];
                        }
                    }
                    CFRelease(phoneRef);
                }


                ABMultiValueRef emailRef = ABRecordCopyValue(ref, kABPersonEmailProperty);
                if (emailRef) {
                    if (ABMultiValueGetCount(emailRef) > 0) {
                        CFStringRef email = ABMultiValueCopyValueAtIndex(emailRef, 0);

                        if (email) {
                            [identifiers setValue:(NSString *)email forKey:@"Email:"];
                            CFRelease(email);
                        }
                    }
                    CFRelease(emailRef);
                }
                if( [identifiers count] > 0 )
                {
                    //This is where I believe the problem is happen as it's two calls to internal Holler models
                    [list addContact:[[[Contact alloc]initWithIdentifiers:identifiers firstName:fName lastName:lName]autorelease]];
                }
            }
        }
        CFRelease(sortedPeople);
    }
    CFRelease(addressbook);
    CFRelease(source);
}


You need to have the stack trace symbolicated before anything educated can be said about where the crash is.

If you open the stack trace file in Xcode (Import button in the Organizer window) it will automatically be symbolicated with the matching binary and symbolic file.... that is if you have saved the binary/symbolic files - preferably by using the archive function.

If you have not saved symbolic files for that exact file then you can not symbolicate the crash log and would have to wildly guess the real cause.


You really need to symbolicate the Holler methods in the stack trace. Here's how: Go to TestFlight --> Select the Builds tab, then click the Testers button under the build that you are having issues with. Scroll down to the bottom and click on the bit.ly link that can be used to manually notify testers. At the bottom of that page, it gives you the option to download the .ipa file that you previously uploaded. Download it.

Once downloaded to your computer, rename the file extension from .ipa to .zip. Then unarchive it, and you should get the .app file. Since you only have the stack trace and not the full crash report, you can't use XCode to symbolicate, but you can do symbolication manually using the instructions found here: http://www.bartlettpublishing.com/site/bartpub/blog/3/entry/311

Hope that helps, and I'd love to be a beta tester for your future apps!

0

精彩评论

暂无评论...
验证码 换一张
取 消