Crash with MapKit on iOS 6 - iphone

I have not been able to reproduce this particular crash myself but it has been reported via our crash reporting tool and is being experienced by several hundred of our users. Finding it hard to debug or reproduce.
It happens on all hardware platforms but only on iOS 6. Any help or insights will be highly appreciated.
Exception Type:SIGSEGVCode:SEGV_ACCERR
Fatal Exception
Thread 0 Crashed
0 MapKit _remove(objc_object*, MKQuadTrieNode*) + 13
1 MapKit -[MKQuadTrie remove:] + 54
2 MapKit -[MKAnnotationContainerView observeValueForKeyPath:ofObject:change:context:] + 252
3 Foundation NSKeyValueNotifyObserver + 272
4 Foundation NSKeyValueWillChange + 572
5 Foundation -[NSObject(NSKeyValueObserverNotification) willChangeValueForKey:] + 180
6 Foundation NSKVOForwardInvocation + 130
7 CoreFoundation ___forwarding___ + 626
8 CoreFoundation _CF_forwarding_prep_0 + 24
9 MapKit -[MKUserLocation _updateCoordinate] + 106
10 MapKit -[MKUserLocation setLocation:] + 106
11 MapKit -[MKMapView(UserPositioningInternal) locationManagerUpdatedLocation:] + 994
12 CoreFoundation -[NSArray makeObjectsPerformSelector:withObject:] + 206
13 MapKit -[MKLocationManager _reportLocationStatus:] + 66
14 MapKit -[MKLocationManager locationProvider:didUpdateLocation:] + 1540
15 MapKit -[MKCoreLocationProvider locationManager:didUpdateLocations:] + 864
16 CoreLocation -[CLLocationManager onClientEventLocation:] + 1614
17 CoreLocation __CLClientInvokeCallback_block_invoke_0 + 64
18 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
19 CoreFoundation __CFRunLoopDoBlocks + 160
20 CoreFoundation __CFRunLoopRun + 1450
21 CoreFoundation CFRunLoopRunSpecific + 356
22 CoreFoundation CFRunLoopRunInMode + 104
23 GraphicsServices GSEventRunModal + 74
24 UIKit UIApplicationMain + 1120
25 App Name main.m line 14 main + 14

Try setting the delegate method of the locationManager to nil in the dealloc method of the class you are using it in
Something like this:
-(void) dealloc
{
self.locationManager.delegate = nil;
}
What might be happening is that the object is being deallocated (maybe due to low memory) and the location manager is trying to send a message to a non existing delegate.

Related

AFNetworking and NSBlockOperation crash

Running an iPhone app using the latest version of AFNetworking, the most popular crash according to Crashlytics is involving NSBlockOperation. I am unsure whether AFNetworking is responsible or not. The log from Crashlytics:
Exception Type: EXC_BAD_ACCESS Code: KERN_INVALID_ADDRESS at 0x2985118298
5com.apple.NSURLConnectionLoader Crashed
0 libobjc.A.dylib objc_msgSend + 9
1 Foundation -[NSBlockOperation main] + 200
2 Foundation -[__NSOperationInternal start] + 840
3 Foundation -[_NSCFURLProtocolBridgeWithTrampoline processEventQ] + 344
4 Foundation -[_NSCFURLProtocolBridgeWithTrampoline pushEvent:from:] + 298
5 Foundation -[_NSCFURLProtocolBridge stop] + 88
6 Foundation _bridger + 64
7 CFNetwork __block_global_7 + 24
8 CFNetwork __block_global_8 + 12
9 CFNetwork ___performAsync_block_invoke_068 + 18
10 CoreFoundation CFArrayApplyFunction + 176
11 CFNetwork RunloopBlockContext::perform() + 74
12 CFNetwork MultiplexerSource::perform() + 188
13 ... CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
14 CoreFoundation __CFRunLoopDoSources0 + 212
15 CoreFoundation __CFRunLoopRun + 646
16 CoreFoundation CFRunLoopRunSpecific + 356
17 CoreFoundation CFRunLoopRunInMode + 104
18 Foundation +[NSURLConnection(Loader) _resourceLoadLoop:] + 308
19 Foundation __NSThread__main__ + 972
20 libsystem_c.dylib _pthread_start + 308
Let me know if you need more logs. Can anybody direct me in the direction to avoid this crash? Out of 2500 users 76 users has been affected.
Update Sept 17:
Seems like this guy is having the same problem:
iOS Blocks Async Callbacks Causing Crash after View Controller is deallocated.

ios core data NSFetchedResultsControllerDelegate crash

I am keep getting this error for NSFetchedResultsControllerDelegate.
not sure what to do with it, since it happen sporadically.
I do create the records synchronized, but still ..
any ideas why could this be?
- (Activity *)createActivityWithDictionary:(NSDictionary*)dict
{
#synchronized([DBController sharedManaged])
{
Activity *act = [Activity activityWithDictionary:dict inManagedObjectContext:self.managedObjectContext];
[self saveContext];
return act;
}
}
Date/Time: 2012-09-18 22:55:53.686 -0700
OS Version: iPhone OS 5.1.1 (9B206)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x3724188f __exceptionPreprocess + 163
1 libobjc.A.dylib 0x34f46259 objc_exception_throw + 33
2 CoreFoundation 0x37244a9b -[NSObject doesNotRecognizeSelector:] + 175
3 CoreFoundation 0x37243915 ___forwarding___ + 301
4 CoreFoundation 0x3719e650 _CF_forwarding_prep_0 + 48
5 CoreData 0x36a78f4d -[NSFetchedResultsController(PrivateMethods) _managedObjectContextDidChange:] + 2401
6 Foundation 0x37aa64ff __57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_0 + 19
7 CoreFoundation 0x3720d547 ___CFXNotificationPost_block_invoke_0 + 71
8 CoreFoundation 0x37199097 _CFXNotificationPost + 1407
9 Foundation 0x37a1a3eb -[NSNotificationCenter postNotificationName:object:userInfo:] + 67
10 CoreData 0x36a00839 -[NSManagedObjectContext(_NSInternalNotificationHandling) _postObjectsDidChangeNotificationWithUserInfo:] + 77
11 CoreData 0x36a0031d -[NSManagedObjectContext(_NSInternalChangeProcessing) _createAndPostChangeNotification:withDeletions:withUpdates:withRefreshes:] + 305
12 CoreData 0x36a09d01 -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:] + 1245
13 CoreData 0x369fd145 -[NSManagedObjectContext save:] + 201
14 PalFinds 0x000a57cb -[DBController saveContext] (DBController.m:75)
15 PalFinds 0x000a8dff -[DBController createActivityWithDictionaries:] (DBController.m:852)
16 PalFinds 0x00086649 -[PFMe finishRequest:andRestConnection:] (PFMe.m:1986)
17 PalFinds 0x0002e17d -[RestConnection connectionDidFinishLoading:] (RestConnection.m:326)
18 Foundation 0x37addc29 __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke_0 + 17
19 Foundation 0x37a356d9 -[NSURLConnectionInternalConnection invokeForDelegate:] + 29
20 Foundation 0x37a356a3 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 199
21 Foundation 0x37a355c5 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 61
22 CFNetwork 0x36ed97f5 URLConnectionClient::_clientDidFinishLoading(URLConnectionClient::ClientConnectionEventQueue*) + 193
23 CFNetwork 0x36ece4a5 URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent, XClientEventParams>*, long) + 425
24 CFNetwork 0x36ece599 URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent, XClientEventParams>*, long) + 669
25 CFNetwork 0x36ece599 URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent, XClientEventParams>*, long) + 669
26 CFNetwork 0x36ece1a3 URLConnectionClient::processEvents() + 107
27 CFNetwork 0x36ece0d9 MultiplexerSource::perform() + 157
28 CoreFoundation 0x37215ad3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
29 CoreFoundation 0x3721529f __CFRunLoopDoSources0 + 215
30 CoreFoundation 0x37214045 __CFRunLoopRun + 653
31 CoreFoundation 0x371974a5 CFRunLoopRunSpecific + 301
32 CoreFoundation 0x3719736d CFRunLoopRunInMode + 105
33 GraphicsServices 0x33956439 GSEventRunModal + 137
34 UIKit 0x30f43cd5 UIApplicationMain + 1081
35 PalFinds 0x000038bf main (main.mm:14)
36 PalFinds 0x00003878 start + 40
Looks like it's trying to call the delegate back and the delegate isn't implementing a method it's supposed to.
I'm thinking either controller:didChangeObject:atIndexPath:forChangeType:newIndexPath: or controllerDidChangeContent:
Did you implement those methods in your NSFetchedResultsControllerDelegate?
I know this might seem far fetched BUT I had a very similar problem and I had all those methods implemented and then I realized I had my release commented out for the fetchedREsultsController...once I put that back in no more sigbart and works like a charm.
All I'm saying is that sometimes the error isn't always the obvious.
We would need to see a bit more code to figure it out. Thanks.

Application crash on login in ios Facebook SDK 3.0

My app uses Facebook Authentication. It works fine if there is no Facebook app installed on device and also works for devices having Facebook app if user in not logged in to Facebook app. But if the user is already logged in to the Facebook app my app shows login page for two or three seconds and crashes by saying
-[SBJsonParser errorTrace]: unrecognized selector sent to instance 0x48ad90
the crash log shows Exception Type: EXC_CRASH (SIGTRAP)
Any body please help?
Stack Trace: (
0 CoreFoundation 0x37aae8d7 __exceptionPreprocess + 186
1 libobjc.A.dylib 0x315941e5 objc_exception_throw + 32
2 CoreFoundation 0x37ab1acb -[NSObject doesNotRecognizeSelector:] + 174
3 CoreFoundation 0x37ab0945 ___forwarding___ + 300
4 CoreFoundation 0x37a0b680 _CF_forwarding_prep_0 + 48
5 MyFbApp 0x0014bf83 -[SBJSON objectWithString:allowScalar:error:] + 118
6 MyFbApp 0x0014bffb -[SBJSON objectWithString:error:] + 26
7 MyFbApp 0x0015030b -[FBRequestConnection parseJSONOrOtherwise:error:] + 94
8 MyFbApp 0x0014ff19 -[FBRequestConnection parseJSONResponse:error:statusCode:] + 100
9 MyFbApp 0x0014fcbb -[FBRequestConnection completeWithResponse:data:orError:] + 566
10 MyFbApp 0x0014e08f __68-[FBRequestConnection startWithCacheIdentity:skipRoundtripIfCached:]_block_invoke_0 + 174
11 MyFbApp 0x00151acf -[FBURLConnection invokeHandler:error:response:responseData:] + 482
12 MyFbApp 0x0015202b -[FBURLConnection connectionDidFinishLoading:] + 298
13 Foundation 0x31a0ac39 __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke_0 + 16
14 Foundation 0x319626e9 -[NSURLConnectionInternalConnection invokeForDelegate:] + 28
15 Foundation 0x319626b3 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 198
16 Foundation 0x319625d5 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 60
17 CFNetwork 0x36f8f8a5 _ZN19URLConnectionClient23_clientDidFinishLoadingEPNS_26ClientConnectionEventQueueE + 192
18 CFNetwork 0x36f84545 _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl + 424
19 CFNetwork 0x36f84243 _ZN19URLConnectionClient13processEventsEv + 106
20 CFNetwork 0x36f84179 _ZN17MultiplexerSource7performEv + 156
21 CoreFoundation 0x37a82b03 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
22 CoreFoundation 0x37a822cf __CFRunLoopDoSources0 + 214
23 CoreFoundation 0x37a81075 __CFRunLoopRun + 652
24 CoreFoundation 0x37a044dd CFRunLoopRunSpecific + 300
25 CoreFoundation 0x37a043a5 CFRunLoopRunInMode + 104
26 GraphicsServices 0x37582fcd GSEventRunModal + 156
27 UIKit 0x34e94743 UIApplicationMain + 1090
28 MyFbApp 0x0007512d main + 236
29 MyFbApp 0x0007503c start + 40
)
At last I fixed my problem by adding
-(id) errorTrace{
return [NSArray arrayWithObjects:#"error1", nil];
}
in SBJsonParser. I dont know how it worked.
Thank God>>>>>>>>>>
For further reference http://developers.facebook.com/bugs/202230616574138/
I'm not familiar with Facebook Authentication but two things can happen here:
either you sent an errorTrace: message to a deallocated object that has been replaced in memory by a SBJsonParser object.
or you sent an invalid message to your SBJsonParser object
I'd suggest 2 things:
Add the NSZombieEnabled flag to see if you deallocated an object by error
Post the code where you're using SBJsonParser, hoping it is not created inside an external source code or library

using testFlight i got my application crash log but don't know what went wrong

I have one application and in beta testing i got my application crash but i am not able to understand what is wrong with it, can you suggest me where to look, Thanks :)
0 TurfNutritionTool_ver_5.1 0x00189642 testflight_backtrace + 142
1 TurfNutritionTool_ver_5.1 0x0018a1d0 TFSignalHandler + 212
2 libsystem_c.dylib 0x3174872e _sigtramp + 42
3 UIKit 0x362f2aa0 -[UITableView dealloc] + 56
4 CoreFoundation 0x317b5c42 -[NSObject(NSObject) release] + 30
5 libobjc.A.dylib 0x3125d50c objc_setProperty_non_gc + 120
6 libobjc.A.dylib 0x31255046 objc_setProperty + 26
7 TurfNutritionTool_ver_5.1 0x001051c8 -[TNTScenarioViewController setScenarioTable:] (TNTScenarioViewController.m:15)
8 TurfNutritionTool_ver_5.1 0x00103610 -[TNTScenarioViewController viewDidUnload] (TNTScenarioViewController.m:160)
9 UIKit 0x362a9a28 -[UIViewController unloadViewForced:] + 172
10 UIKit 0x362b96b8 -[UIViewController unloadViewIfReloadable] + 16
11 UIKit 0x3630012c -[UIViewController purgeMemoryForReason:] + 40
12 UIKit 0x3630014c -[UIViewController didReceiveMemoryWarning] + 16
13 TurfNutritionTool_ver_5.1 0x00102682 -[TNTScenarioViewController didReceiveMemoryWarning] (TNTScenarioViewController.m:40)
14 UIKit 0x36300162 -[UIViewController _didReceiveMemoryWarning:] + 14
15 Foundation 0x3113f182 _nsnote_callback + 142
16 CoreFoundation 0x3182020e __CFXNotificationPost_old + 402
17 CoreFoundation 0x317baeea _CFXNotificationPostNotification + 118
18 Foundation 0x3113c5d2 -[NSNotificationCenter postNotificationName:object:userInfo:] + 70
19 Foundation 0x3113e1c0 -[NSNotificationCenter postNotificationName:object:] + 24
20 UIKit 0x362d6360 -[UIApplication _performMemoryWarning] + 48
21 UIKit 0x362d6d82 -[UIApplication _receivedMemoryNotification] + 126
22 UIKit 0x362d4506 _memoryStatusChanged + 42
23 CoreFoundation 0x31820d68 __CFNotificationCenterDarwinCallBack + 24
24 CoreFoundation 0x3181dbde __CFMachPortPerform + 210
25 CoreFoundation 0x31828a96 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
26 CoreFoundation 0x3182a83e __CFRunLoopDoSource1 + 166
27 CoreFoundation 0x3182b60c __CFRunLoopRun + 520
28 CoreFoundation 0x317bbec2 CFRunLoopRunSpecific + 230
29 CoreFoundation 0x317bbdca CFRunLoopRunInMode + 58
30 GraphicsServices 0x336d641e GSEventRunModal + 114
31 GraphicsServices 0x336d64ca GSEventRun + 62
32 UIKit 0x361abd68 -[UIApplication _run] + 404
33 UIKit 0x361a9806 UIApplicationMain + 670
34 TurfNutritionTool_ver_5.1 0x000edb68 main (main.m:14)
35 TurfNutritionTool_ver_5.1 0x000edb27 start + 39
Are you familiar with the concept of a stack trace? What you are looking at are the lines of code execution from the crash (0) back to a recent frame entry. As such, this is referred to as a 'back trace' since it goes backwards from the point that the code stopped executing.
I have no knowledge of your code, but you can see from line 14 of the back trace that you received a low memory warning. This warning caused a chain of unload events, including a deallocation of a UITableView (line 3).
This is immediately followed by the _sigtramp, which probably indicates an EXC_BAD_ACCESS. My guess, without seeing the rest of your code, is that you are accessing something that has been released by the low memory unload situation.

iphone - understanding crash logs

Im developing my app and yesterday while I was playing with it crashed. I wasnt debugging, so I thought I'd take a look at the crash log today.
But my surprise is that I can't see anything that can give me some info, here it is:
Thread 0 Crashed:
0 libobjc.A.dylib 0x33479464 objc_msgSend + 16
1 MapKit 0x31bffe28 -[MKMapView annotationContainer:viewForAnnotation:] + 36
2 MapKit 0x31bffaba -[MKAnnotationContainerView _addViewForAnnotation:] + 270
3 MapKit 0x31c25540 -[MKAnnotationContainerView addViewForManagedAnnotation:] + 8
4 MapKit 0x31c21df2 -[MKMapView(UserPositioningInternal) _runPositioningChange] + 1034
5 MapKit 0x31c20036 -[MKMapView(UserPositioningInternal) _startPositioningChange:] + 22
6 MapKit 0x31c23446 -[MKMapView(UserPositioningInternal) locationManagerUpdatedLocation:] + 578
7 CoreFoundation 0x33a5ebb8 -[NSObject(NSObject) performSelector:withObject:] + 16
8 CoreFoundation 0x33a83266 -[NSArray makeObjectsPerformSelector:withObject:] + 394
9 MapKit 0x31c1232a -[MKLocationManager _reportLocationStatus:] + 34
10 MapKit 0x31c13844 -[MKLocationManager _reportLocationSuccess] + 36
11 MapKit 0x31c134b8 -[MKLocationManager locationManager:didUpdateToLocation:fromLocation:] + 688
12 CoreLocation 0x34371410 -[CLLocationManager onClientEventLocation:] + 528
13 CoreLocation 0x3436f68e -[CLLocationManager onClientEvent:supportInfo:] + 98
14 CoreLocation 0x3436f7e6 OnClientEventInternal + 14
15 CoreLocation 0x3436b534 CLClientInvokeCallback(__CLClient*, CLClientEvent, __CFDictionary const*) + 60
16 CoreLocation 0x3436d3cc CLClientHandleDaemonDataLocation(__CLClient*, CLClientLocation const*, __CFDictionary const*) + 196
17 CoreLocation 0x3436d512 CLClientHandleDaemonData(__CFMessagePort*, long, __CFData const*, void*) + 286
18 CoreFoundation 0x33a813fe __CFMessagePortPerform + 242
19 CoreFoundation 0x33a556f8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20
20 CoreFoundation 0x33a556bc __CFRunLoopDoSource1 + 160
21 CoreFoundation 0x33a47f76 __CFRunLoopRun + 514
22 CoreFoundation 0x33a47c80 CFRunLoopRunSpecific + 224
23 CoreFoundation 0x33a47b88 CFRunLoopRunInMode + 52
24 GraphicsServices 0x33b0e4a4 GSEventRunModal + 108
25 GraphicsServices 0x33b0e550 GSEventRun + 56
26 UIKit 0x32099322 -[UIApplication _run] + 406
27 UIKit 0x32096e8c UIApplicationMain + 664
28 Palyque 0x0000280a main (main.m:14)
29 Palyque 0x00002794 start + 44
Hope you can help me with this, thanks.
Without the app still in memory I'm not sure there's much you can do. From experience I guess you messaged an object that has been dealloc'd. (Maybe the datasource object for your MKMapView?) I'd try running your app with zombies enabled to track it down.