我目前正在使用TestFlight来获取我们的应用程序测试版本的远程崩溃报告。我收到了堆栈跟踪,但是我不太清楚如何缩小问题范围。以下是我收到的报告:iOS Stack Trace Mystery,ABRecordCopyValue Is Suspect
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
不幸的是,堆栈跟踪中的最后8个项目似乎没有符号化。有没有办法让我做到这一点?我假设hte问题与ABRecordCopyValue有关,但我不是100%确定的。由于我不知道最后两次Holler呼叫是什么,我有点困惑。有人想知道我应该怎么做才能缩小问题的范围?
我相信问题现在存在于一个特定的方法中,因为重复了两个Holler调用之后的事件序列(ABRecordCopyValue)。这是代码...我使用它来加载用户的电话簿/联系人列表。让我知道这是否提供任何更多的细节:
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);
}
不幸的是,没有发现问题:(它只是象征“<__ destroy_helper_block_1 + 1861>” –