ABPeoplePicker Crash for Only One Person - iphone

I have an app that only crashes for one of my tester’s - no one else’s. But it crashes consistently for her. It’s very odd.
Details:
She has in iPhone 4 and an iPhone 3Gs
The app crashes on all OSes on BOTH phones
The app crashes with all contacts no matter how they were created
When she sends me her contacts they work fine on both my iPHone 4 and my 3G (not s)
She is the ONLY one that ever gets a crash and it is consistent across both phones and all OSes
She has uninstalled and reinstalled the app and the provisioning profile
She is syncing her iPhone with a windows machine version of iTunes
The crash happens when we use ABPeoplePicker.
From her perspective it looks like the minute she selects a phone number the app crashes.
Of course she is not in our app at that moment. She is in the ABPeoplePicker navigation view provided by Apple.
From the resymbolicated crash log it looks to me like it’s actually crashing when it is trying to return to our app. In other words I can’t find any mention of our app actually being responsible for the crash in the crash log (see below).
It looks like it’s not able to get the index of the selected phone number and then fails when trying to pop back into our app but that’s a guess at best.
I have read the Apple docs and tried to do due diligence in learning about how to read crash logs but I am still stumped.
Here are my questions:
1. Does anyone know what Exception Codes: 0x00000000, 0x00000000 means?
2. Am I correct in assuming that line 9 is where the actual issues is referred to? And if so how do I understand what objc_exception_throw + 64 means?
3. Can anyone shed some light on what this crash log says the problem is?
Incident Identifier:
CrashReporter Key:
Hardware Model: iPhone3,1
Process: My App [471]
Path:
Identifier: My App
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2010-12-06 16:32:44.088 -0600
OS Version: iPhone OS 4.0.2 (8A400)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Thread 0 Crashed:
0 libSystem.B.dylib 0x000791d0 __kill + 8
1 libSystem.B.dylib 0x000791c0 kill + 4
2 libSystem.B.dylib 0x000791b2 raise + 10
3 libSystem.B.dylib 0x0008d6fa abort + 50
4 libstdc++.6.dylib 0x00044a20 __gnu_cxx::__verbose_terminate_handler() + 376
5 libobjc.A.dylib 0x000059ec _objc_terminate + 104
6 libstdc++.6.dylib 0x00042df2 __cxxabiv1::__terminate(void (*)()) + 46
7 libstdc++.6.dylib 0x00042e46 std::terminate() + 10
8 libstdc++.6.dylib 0x00042f16 __cxa_throw + 78
9 libobjc.A.dylib 0x000048cc objc_exception_throw + 64
10 CoreFoundation 0x0001fb72 -[__NSArrayI objectAtIndex:] + 154
11 My App 0x00005a68 0x1000 + 19048
12 My App 0x00005dec 0x1000 + 19948
13 UIKit 0x000668f4 -[UIViewController view] + 104
14 UIKit 0x000784e4 -[UIViewController contentScrollView] + 16
15 UIKit 0x00078354 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 24
16 UIKit 0x00078252 -[UINavigationController _layoutViewController:] + 18
17 UIKit 0x00077d58 -[UINavigationController _startTransition:fromViewController:toViewController:] + 372
18 UIKit 0x00077b68 -[UINavigationController _startDeferredTransitionIfNeeded] + 176
19 UIKit 0x00066fa8 -[UINavigationController pushViewController:transition:forceImmediate:] + 600
20 UIKit 0x00066d40 -[UINavigationController pushViewController:animated:] + 28
21 My App 0x0000a29a 0x1000 + 37530
22 My App 0x0000bcba 0x1000 + 44218
23 AddressBookUI 0x00032cfc -[ABPeoplePickerNavigationController personViewController:shouldPerformDefaultActionForPerson:property:identifier:withMemberCell:] + 152
24 AddressBookUI 0x0003b8ce -[ABPersonViewControllerHelper personTableViewDataSource:selectedPropertyAtIndex:inPropertyGroup:withMemberCell:forEditing:] + 222
25 AddressBookUI 0x0004a17c -[ABPersonTableViewDataSource valueAtIndex:selectedForPropertyGroup:withMemberCell:forEditing:] + 40
26 AddressBookUI 0x00048c00 -[ABPersonTableViewDataSource tableView:didSelectRowAtIndexPath:] + 316
27 UIKit 0x00091f40 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 656
28 UIKit 0x0009db40 -[UITableView _userSelectRowAtIndexPath:] + 124
29 Foundation 0x00086c86 __NSFireDelayedPerform + 362
30 CoreFoundation 0x00071a54 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 8
31 CoreFoundation 0x00073ede __CFRunLoopDoTimer + 854
32 CoreFoundation 0x0007485e __CFRunLoopRun + 1082
33 CoreFoundation 0x0001d8e4 CFRunLoopRunSpecific + 224
34 CoreFoundation 0x0001d7ec CFRunLoopRunInMode + 52
35 GraphicsServices 0x000036e8 GSEventRunModal + 108
36 GraphicsServices 0x00003794 GSEventRun + 56
37 UIKit 0x000062a0 -[UIApplication _run] + 396
38 UIKit 0x00004e10 UIApplicationMain + 664
39 My App 0x0000d694 0x1000 + 50836
40 My App 0x00002d00 0x1000 + 7424
Here is my ABPeoplePicker code.
#pragma mark ABPeoplePickerNavigationControllerDelegate methods
// Displays the information of a selected person
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person
{
return YES;
}
// Does not allow users to perform default actions such as dialing a phone number, when they select a person property.
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person
property:(ABPropertyID)property
identifier:(ABMultiValueIdentifier)identifier {
CFStringRef cfName = ABRecordCopyCompositeName(person);
self.selectedName = [NSString stringWithString:(NSString *)cfName];
CFRelease(cfName);
ABMultiValueRef allThePhoneNums = ABRecordCopyValue(person, kABPersonPhoneProperty);
// ABMultiValueGetIndexForIdentifier the exact value of the "identifier" passed to us.
NSString *number = (NSString *)ABMultiValueCopyValueAtIndex(allThePhoneNums, ABMultiValueGetIndexForIdentifier(allThePhoneNums, identifier));
self.selectedNumber = number;
[number release];
CFRelease(allThePhoneNums);
[self showDialOutToPartViewControllerWithName:self.selectedName andNumber:self.selectedNumber];
[peoplePicker dismissModalViewControllerAnimated:YES];
return NO;
}
// Dismisses the people picker and shows the application when users tap Cancel.
- (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker; {
[self dismissModalViewControllerAnimated:YES];
}

Foremost, it helps to symbolicate your crash logs using the symbolicatecrash tool and the DSYM file that was generated when you compiled it. I won't discuss how to do that here -- you can search Google to find more details; try "symbolicate crash log DSYM" as keywords.
Once you do that, instead of:
My App 0x0232032+433
It will show something like this:
My App [className callSomeMethod:argument]
Much easier to find the line of code that is spawning the problem.
However - note in the stack trace that the last line of code is [array objectAtIndex:] in Foundation. This method will throw an NSRangeException when you pass an index outside of the bounds of the receiver (e.g. array). From the NSArray docs:
If index is beyond the end of the
array (that is, if index is greater
than or equal to the value returned by
count), an NSRangeException is raised.
So, I'd put my money on that being your crash.
Then the question is - after you symbolicate your crash log - what line of your code is calling an array with an out-of-bounds index?

Related

I am getting a lot of SIGSEGV exception in my iOS app crash report and that too crashes in UINavigationController

Here is my crash report and this is irrespective of the iOS version and the device. Also I would like to know, is SIGSEGV_ACCERR is something related to memory. Can you Please help me nailing down this issue. I have a bunch of crash reports with the below log
Date/Time: 2012-09-25 23:55:33 +0000
OS Version: iPhone OS 5.1.1 (9B206)
Report Version: 104
Exception Type: SIGSEGV
Exception Codes: SEGV_ACCERR at 0x60000008
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x37734f78 objc_msgSend + 16
1 UIKit 0x32e0c503 -[UINavigationController _startDeferredTransitionIfNeeded] + 251
2 UIKit 0x32e568eb _popViewControllerNormal + 191
3 UIKit 0x32e56719 -[UINavigationController _popViewControllerWithTransition:allowPoppingLast:] + 393
4 UIKit 0x32e56c79 -[UINavigationController navigationBar:shouldPopItem:] + 153
5 UIKit 0x32e56a8f -[UINavigationBar _popNavigationItemWithTransition:] + 99
6 UIKit 0x32ea6247 -[UINavigationBar popNavigationItemAnimated:] + 123
7 UIKit 0x32ea60d5 -[UINavigationBar _handleMouseUpAtPoint:] + 925
8 UIKit 0x32ea5d33 -[UINavigationBar touchesEnded:withEvent:] + 83
9 UIKit 0x32de192b -[UIWindow _sendTouchesForEvent:] + 319
10 UIKit 0x32de1319 -[UIWindow sendEvent:] + 381
11 UIKit 0x32dc7695 -[UIApplication sendEvent:] + 357
12 UIKit 0x32dc6f3b _UIApplicationHandleEvent + 5827
13 GraphicsServices 0x36f8622b PurpleEventCallback + 883
14 CoreFoundation 0x35367523 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 39
15 CoreFoundation 0x353674c5 __CFRunLoopDoSource1 + 141
16 CoreFoundation 0x35366313 __CFRunLoopRun + 1371
17 CoreFoundation 0x352e94a5 CFRunLoopRunSpecific + 301
18 CoreFoundation 0x352e936d CFRunLoopRunInMode + 105
19 GraphicsServices 0x36f85439 GSEventRunModal + 137
20 UIKit 0x32df5cd5 UIApplicationMain + 1081
21 Myapp 0x00003597 main (main.m:20)
A very quick google of SIGSEGV will tell you exactly what it is (a signal meaning a segmentation violation). Those links will also teach you why it happens.
From the stack trace, you can see that the main loop is handling a touch in the navigation bar., which results in a pop transition. While popping the view controller, a bad memory access crashes the app.
It even tells you the address it tried to access (which resulted in the crash): 0x60000008 Doesn't that address look a bit too "neat?"
So, I'd first try to recreate it in the debugger. I'd also add some logging in my view controllers that are pushed/popped so I can tell which one is causing the crash.
You can guess that it is a direct result of pressing one of the "back" buttons in your navigation controller.
So, I'd also be inclined to look at how I setup my controllers that are pushed on the nav controller and also investigate how you are using the navigation bar (because popping them is causing the crash).
It looks like the crash is happening in the core library, so it must be in the setup of your controller, as there does not appear to be any calls to you code in the stack trace.

iOS app crashing in Core Location callback machinery

I have problems analyzing my crashlog. The iPhone crashes sometimes, when I click on the app icon to start the app. The app is already "running" in background, but it's not active. This is the symbolized crash log:
Thread 0 Crashed:
0 libobjc.A.dylib 0x33479470 objc_msgSend + 28
1 CoreLocation 0x3436f68e -[CLLocationManager onClientEvent:supportInfo:] + 98
2 CoreLocation 0x3436f804 OnClientEvent + 16
3 CoreLocation 0x3436b522 CLClientInvokeCallback(__CLClient*, CLClientEvent, __CFDictionary const*) + 42
4 CoreLocation 0x3436cf74 CLClientHandleDaemonDataRegistration(__CLClient*, CLDaemonCommToClientRegistration const*, __CFDictionary const*) + 668
5 CoreLocation 0x3436d4c8 CLClientHandleDaemonData(__CFMessagePort*, long, __CFData const*, void*) + 212
6 CoreFoundation 0x33a813fe __CFMessagePortPerform + 242
7 CoreFoundation 0x33a556f8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20
8 CoreFoundation 0x33a556bc __CFRunLoopDoSource1 + 160
9 CoreFoundation 0x33a47f76 __CFRunLoopRun + 514
10 CoreFoundation 0x33a47c80 CFRunLoopRunSpecific + 224
11 CoreFoundation 0x33a47b88 CFRunLoopRunInMode + 52
12 GraphicsServices 0x33b0e4a4 GSEventRunModal + 108
13 GraphicsServices 0x33b0e550 GSEventRun + 56
14 UIKit 0x32099322 -[UIApplication _run] + 406
15 UIKit 0x32096e8c UIApplicationMain + 664
16 Norddeich 0x00002764 main (main.m:14)
17 Norddeich 0x00002718 start + 32
As far as i understand the stack trace, the error occurred in the main.m. Line 14 is part of the default code:
int retVal = UIApplicationMain(argc, argv, nil, nil);
Please give me a hint, how to find the error.
Thank you in advance!
Do you set it's delegate to nil before returning from controller (or at least in controller's dealloc)? I suspect CLLocationManager is trying to send a message to delegate which is deallocated already - that's why it crashes at obj_msgSend.
I had this same problem testing my app on 4.3, but not in 5.0. The issue was that I was trying to dealloc the CLLocationManager inside one of the delegate methods. It works fine in 5.0, but crashes a iPhone 3GS running 4.3 every time.
In the end I made the CLLocationManager object a property, then in the delegate method set the delegate to nil and dispatched a block to the main thread to release the object.

popViewControllerAnimated:YES crashes my app

My app crashes when I do [self.navigationController popViewControllerAnimated:YES].
It crashes more on Device than on Simulator. Please suggest how to fix this?
Date/Time: 2010-11-09 10:51:41.325 +0800
OS Version: iPhone OS 4.0.1 (8A306)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000000
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x0000286e objc_msgSend + 18
1 CoreFoundation 0x00002c30 -[NSObject(NSObject) release] + 24
2 libobjc.A.dylib 0x00003c1a objc_setProperty + 114
3 UIKit 0x000693d4 -[UINavigationController setDisappearingViewController:] + 24
4 UIKit 0x0007d5c0 -[UINavigationController _clearLastOperation] + 40
5 UIKit 0x0007d4b4 -[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:] + 556
6 UIKit 0x0007d248 -[UINavigationTransitionView _notifyDelegateTransitionDidStopWithContext:] + 204
7 UIKit 0x0007d0b6 -[UINavigationTransitionView _navigationTransitionDidStop] + 450
8 UIKit 0x00059974 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 184
9 UIKit 0x0005987e -[UIViewAnimationState animationDidStop:finished:] + 34
10 QuartzCore 0x000127ba run_animation_callbacks(double, void*) + 286
11 QuartzCore 0x0001265c CA::timer_callback(__CFRunLoopTimer*, void*) + 116
12 CoreFoundation 0x00071a54 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 8
13 CoreFoundation 0x00073ede __CFRunLoopDoTimer + 854
14 CoreFoundation 0x0007485e __CFRunLoopRun + 1082
15 CoreFoundation 0x0001d8e4 CFRunLoopRunSpecific + 224
16 CoreFoundation 0x0001d7ec CFRunLoopRunInMode + 52
17 GraphicsServices 0x000036e8 GSEventRunModal + 108
18 GraphicsServices 0x00003794 GSEventRun + 56
19 UIKit 0x000062a0 -[UIApplication _run] + 396
20 UIKit 0x00004e10 UIApplicationMain + 664
21 tenpay 0x00006124 main (main.m:13)
22 tenpay 0x00002324 start + 44
myviewcontroller = [[[MyViewController alloc]init]autorelease];
[self.navigationController pushViewController:myviewcontroller animated:YES];
[myviewcontroller release]; //This is my bug !!! I just fixed it.
This usually means you are sending a message to a released object which is a bad idea.
From the stack you can see that it is sending a release message to an object. I'd suggest that the object has already been released and thus hasa retain count of 0. Therefore a further release would be invalid.
I believe if you turn on a flag, I think it's called Zombie detection or something like that, then any message to a released object will generate a more descriptive message.
Perhaps a more experienced developer can jump in here with more details.
Yes, I believe Derek is pointing you in the right direction. Could you possibly list what kind of memory-related operations you are performing on the active controller before sending this release message (the release message is being sent implicitly when you try to pop it out). Please clarify if you are using autorelease for this controller,etc... Also it might be helpful to see what are the associated properties that you may have associated with this controller (ex: #property(nonatomic, retain, etc...)) if there are any.

iPhone: App crash in MapView after 20 min

I am working on an app that tracks a users location. After about 20 minutes it seems that the app always crashes, and I am not sure why. Device logs show:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x069f6000
Crashed Thread: 0
Thread 0 Crashed:
0 Ride 0x00012e00 -[Route addCoordinate:] (Route.m:92)
1 Ride 0x0000877a -[MyRidesMapViewController locationManager:didUpdateToLocation:fromLocation:] (MyRidesMapViewController.m:528)
2 CoreLocation 0x0000931c -[CLLocationManager onClientEventLocation:] + 584
3 CoreLocation 0x00007552 -[CLLocationManager onClientEvent:supportInfo:] + 98
4 CoreLocation 0x000076a0 OnClientEvent + 16
5 CoreLocation 0x00002ade CLClientInvokeCallback(__CLClient*, CLClientEvent, __CFDictionary const*) + 42
6 CoreLocation 0x0000512c CLClientHandleDaemonDataLocation(__CLClient*, CLClientLocation const*, __CFDictionary const*) + 204
7 CoreLocation 0x0000528a CLClientHandleDaemonData(__CFMessagePort*, long, __CFData const*, void*) + 298
8 CoreFoundation 0x0006936a __CFMessagePortPerform + 242
9 CoreFoundation 0x00071aa4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20
10 CoreFoundation 0x00073848 __CFRunLoopDoSource1 + 160
11 CoreFoundation 0x00074626 __CFRunLoopRun + 514
12 CoreFoundation 0x0001d8e4 CFRunLoopRunSpecific + 224
13 CoreFoundation 0x0001d7ec CFRunLoopRunInMode + 52
14 GraphicsServices 0x000036e8 GSEventRunModal + 108
15 GraphicsServices 0x00003794 GSEventRun + 56
16 UIKit 0x000062a0 -[UIApplication _run] + 396
17 UIKit 0x00004e10 UIApplicationMain + 664
18 Ride 0x00002a20 main (main.m:14)
19 Ride 0x000029d4 start + 32
Looks like I am trying to release something that has already been released, but what?! I have NSZombie enabled, and it does not seem to help.
It used to work, and I recently updated my class to use self. for anything that I synthesized, could this be the issue?
EDIT: I updated the error. It seems to be listing the line numbers for each line, but they do not seem to be helping to find the issue.
Do you have NSZombie enabled while you're running on the device? If so chances are you are running out of memory. As you know, NSZombie keeps released objects around so you can detect a double release.
Chances are you do have some memory issues though. Does the static analyzer show you anything? (shift-command-A).
Setting the location manager delegate to nil AND THEN releasing it fixed the crash for me.

iPad application crash in Apple review - cannot replicate in simulator, have crash log

I am clearly missing something obvious here and would really appreciate some input. I have tried repeatedly to submit an application to Apple (iPad in this case) that is crashing on their end when testing but I cannot replicated the situation on my end (obviously I only have the damned simulator to work with at this point).
The crash log is as follows:
Date/Time: 2010-04-01 05:39:47.226 -0700
OS Version: iPhone OS 3.2 (7B367)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Thread 0 Crashed:
0 libSystem.B.dylib 0x000790a0 __kill + 8
1 libSystem.B.dylib 0x00079090 kill + 4
2 libSystem.B.dylib 0x00079082 raise + 10
3 libSystem.B.dylib 0x0008d20a abort + 50
4 libstdc++.6.dylib 0x00044a1c __gnu_cxx::__verbose_terminate_handler() + 376
5 libobjc.A.dylib 0x000057c4 _objc_terminate + 104
6 libstdc++.6.dylib 0x00042dee __cxxabiv1::__terminate(void (*)()) + 46
7 libstdc++.6.dylib 0x00042e42 std::terminate() + 10
8 libstdc++.6.dylib 0x00042f12 __cxa_throw + 78
9 libobjc.A.dylib 0x000046a4 objc_exception_throw + 64
10 CoreFoundation 0x00090c6e +[NSException raise:format:arguments:] + 74
11 CoreFoundation 0x00090d38 +[NSException raise:format:] + 28
12 Foundation 0x00002600 -[NSCFDictionary setObject:forKey:] + 184
13 iPadMosaic 0x00003282 -[iPadMosaicViewController getAlbumThumbs] (iPadMosaicViewController.m:468)
14 Foundation 0x000728fe __NSFireDelayedPerform + 314
15 CoreFoundation 0x00022d1c CFRunLoopRunSpecific + 2092
16 CoreFoundation 0x000224da CFRunLoopRunInMode + 42
17 GraphicsServices 0x000030d4 GSEventRunModal + 108
18 GraphicsServices 0x00003180 GSEventRun + 56
19 UIKit 0x000034c2 -[UIApplication _run] + 374
20 UIKit 0x000019ec UIApplicationMain + 636
21 iPadMosaic 0x00002234 main (main.m:14)
22 iPadMosaic 0x00002204 start + 32
My understanding here is that I am botching the Dictionary add somehow. The relevant lines of code are:
for (NSDictionary *album in self.albumList) {
// Get image for each album cover
UIImage *albumCover;
// Loop through photos to get URL of cover based on photo ID match
NSString *coverURL = #"";
for (NSDictionary *photo in self.photoList) {
if ([[photo objectForKey:#"pid"] isEqualToString:[album objectForKey:#"cover_pid"]]) {
coverURL = [photo objectForKey:#"src"];
}
}
NSURL *albumCoverURL = [NSURL URLWithString:coverURL];
NSData *albumCoverData = [NSData dataWithContentsOfURL:albumCoverURL];
albumCover = [UIImage imageWithData:albumCoverData];
if (albumCover == nil || albumCover == NULL) {
//NSLog(#"No album cover for some reason");
albumCover = [UIImage imageNamed:#"noImage.png"];
}
[[self.albumList objectAtIndex:albumCurrent] setObject:albumCover forKey:#"coverThumb"];
}
This is part of a loop that runs over the existing dictionaries stored in an array. If retrieving the album cover fails for some reason the object is filled with a default image and then added. The last line of the code is what's showing up in the crash log.
It runs fine in the simulator but crashes 100% in testing on device apparently. Can anyone tell me what I am missing here?
If Foundation isn't radically changed in from 3.0 to 3.2, then there's only 3 cases an exception is raised in -setObject:forKey::
mutating method sent to immutable object
attempt to insert nil value
attempt to insert nil key
Obviously the 3rd case is impossible, so you only need to check:
Is [self.albumList objectAtIndex:albumCurrent] guaranteed to be an NSMutableDictionary?
Have you forgotten to include noImage.png in submission?
I had the same problem! It was a case sensitivity issue...make sure that the file named noImage.png matches the actual file...not NoImage.png or noimage.png...check all of your images! I missed out on the app store opening because of 1 letter on 1 file!