Skip to content

Instantly share code, notes, and snippets.

@emilevictor
Created March 31, 2014 00:21
Show Gist options
  • Save emilevictor/7422ac293eb27b415fb8 to your computer and use it in GitHub Desktop.
Save emilevictor/7422ac293eb27b415fb8 to your computer and use it in GitHub Desktop.
Crash log and relevant code
- (IBAction)onClickNewConsultation:(UIButton *)sender {
@try {
Consult *newConsult = [NSEntityDescription insertNewObjectForEntityForName:@"Consult" inManagedObjectContext:SCDataManager.app.managedObjectContext];
newConsult.date = [NSDate date];
newConsult.patient = _patient;
ClinicalExam *clinicalExam = [NSEntityDescription insertNewObjectForEntityForName:@"ClinicalExam" inManagedObjectContext:SCDataManager.app.managedObjectContext];
clinicalExam.consult = newConsult;
NSError *error = nil;
// Save the object to persistent store
////CRASH HERE:
if (![SCDataManager.app.managedObjectContext save:&error]) {
NSLog(@"Can't Save! %@ %@", error, [error localizedDescription]);
return;
}
}
@catch (NSException *exception) {
NSLog(@"Problem creating a new consultiaton");
UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"ERROR" message: [NSString stringWithFormat:@"We weren't able to create a new consultation for you due to the following reason: %@",exception.reason] delegate: nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; }
@finally {
}
// [self update];
}
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Subtype: KERN_PROTECTION_FAILURE at 0x000000002d4fa3b4
Triggered by Thread: 0
Thread 0 Crashed:
0 libsystem_platform.dylib 0x3943ca37 OSAtomicCompareAndSwapPtrBarrier + 15
1 libobjc.A.dylib 0x38e2d947 realizeClass(objc_class*) + 75
2 libobjc.A.dylib 0x38e2f793 lookUpImpOrForward + 71
3 libobjc.A.dylib 0x38e28027 _class_lookupMethodAndLoadCache3 + 31
4 libobjc.A.dylib 0x38e27df7 _objc_msgSend_uncached + 23
5 CoreData 0x2e50b4a9 -[NSFetchedResultsController(PrivateMethods) _managedObjectContextDidChange:] + 3305
6 CoreFoundation 0x2e752e6f __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 11
7 CoreFoundation 0x2e6c6aad _CFXNotificationPost + 1717
8 Foundation 0x2f0acec1 -[NSNotificationCenter postNotificationName:object:userInfo:] + 69
9 CoreData 0x2e50a79f -[NSManagedObjectContext(_NSInternalNotificationHandling) _postObjectsDidChangeNotificationWithUserInfo:] + 75
10 CoreData 0x2e50a737 -[NSManagedObjectContext(_NSInternalChangeProcessing) _createAndPostChangeNotification:withDeletions:withUpdates:withRefreshes:] + 295
11 CoreData 0x2e508de9 -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:] + 2293
12 CoreData 0x2e507b33 -[NSManagedObjectContext save:] + 187
13 SkinConsult 0x000cb7a4 -[SCPatientHistoryVC onClickNewConsultation:] (SCPatientHistoryVC.m:564)
14 UIKit 0x30f49d9f -[UIApplication sendAction:to:from:forEvent:] + 87
15 UIKit 0x30f49d3b -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 35
16 UIKit 0x30f49d0f -[UIControl sendAction:to:forEvent:] + 43
17 UIKit 0x30f3573f -[UIControl _sendActionsForEvents:withEvent:] + 371
18 UIKit 0x30f49757 -[UIControl touchesEnded:withEvent:] + 591
19 UIKit 0x30f49421 -[UIWindow _sendTouchesForEvent:] + 525
20 UIKit 0x30f4444d -[UIWindow sendEvent:] + 829
21 UIKit 0x30f19d75 -[UIApplication sendEvent:] + 193
22 SkinConsult 0x000bb9b4 -[SCApplication sendEvent:] (SCApplication.m:15)
23 UIKit 0x30f18565 _UIApplicationHandleEventQueue + 7113
24 CoreFoundation 0x2e75bf1d __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 13
25 CoreFoundation 0x2e75b3e3 __CFRunLoopDoSources0 + 203
26 CoreFoundation 0x2e759bd3 __CFRunLoopRun + 627
27 CoreFoundation 0x2e6c446d CFRunLoopRunSpecific + 521
28 CoreFoundation 0x2e6c424f CFRunLoopRunInMode + 103
29 GraphicsServices 0x333c52e7 GSEventRunModal + 135
30 UIKit 0x30f79841 UIApplicationMain + 1133
31 libdyld.dylib 0x39325ab5 start + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment