title: iOS10 Open Beta - iOS Core Data Crash on save
body: <p>I am assuming it is ok to post beta iOS10 issues here, since it is an open beta.  The apple forums don't come close to the help one gets on Stackoverflow.</p>
  
  <p>Since the update to iOS10, our users are getting a constant crash when saving the managedObjectContext in CoreData.</p>
  
  <p>This is something that has worked flawlessly since iOS 5.</p>
  
  <p>It only happens on the 64 bit version of iOS10.  The 32 bit version works fine.</p>
  
  <p>Here is my simple save code snip:</p>
  
  <pre><code>    [self.managedObjectContext performBlockAndWait:^{
      NSError *error;
      if (![self.managedObjectContext save:&amp;error])
      {
         NSLog(@"\n\nerror in save 1 %@\n\n", error);
      }
  }];
  
  [self.managedObjectContext performBlock:^{
      NSError *error;
      if (![_privateWriterContext save:&amp;error])
      {
         NSLog(@"\n\nerror in save 2 %@\n\n", error);
      }
  }];
  </code></pre>
  
  <p>(Above NSLog reports nothing, as it works in simulator).</p>
  
  <p>This only fails on a 64bit device.  I cannot replicate on the simulator.  I also cannot replicate in debug on a device due to issues with my only 64 bit device not connecting to Xcode correctly.  So I am a bit stuck.</p>
  
  <p>Below is a sample stack trace reported from a user:</p>
  
  <pre><code>    Incident Identifier: 7A8DD23B-48A2-4ABF-88E7-67F1E6CDA8D5
  CrashReporter Key:   5454e7c7b99a94cd75b6adfa8334bbdf10b859eb
  Hardware Model:      iPhone8,1
  Code Type:           ARM-64 (Native)
  Role:                Foreground
  Parent Process:      launchd [1]
  
  
  
  Date/Time:           2016-07-20 22:23:00.1429 -0400
  Launch Time:         2016-07-20 22:21:30.6058 -0400
  OS Version:          iPhone OS 10.0 (14A5309d)
  Report Version:      104
  
  Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
  Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000985e4beb8
  Triggered by Thread:  0
  
  Thread 0 name:
  Thread 0 Crashed:
  0   libobjc.A.dylib                 0x00000001850e6eb0 objc_msgSend + 16
  1   CoreFoundation                  0x0000000185a76740 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20 (CFNotificationCenter.c:650)
  2   CoreFoundation                  0x0000000185a75e44 _CFXRegistrationPost + 400 (CFNotificationCenter.c:164)
  3   CoreFoundation                  0x0000000185a75bc0 ___CFXNotificationPost_block_invoke + 60 (CFNotificationCenter.c:1031)
  4   CoreFoundation                  0x0000000185ae40cc -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1504 (CFXNotificationRegistrar.m:163)
  5   CoreFoundation                  0x00000001859b9484 _CFXNotificationPost + 376 (CFNotificationCenter.c:1028)
  6   Foundation                      0x000000018644e9dc -[NSNotificationCenter postNotificationName:object:userInfo:] + 68 (NSNotification.m:482)
  7   CoreData                        0x0000000187e1dbf4 -[NSManagedObjectContext(_NSInternalNotificationHandling) _postContextDidSaveNotificationWithUserInfo:] + 880 (NSManagedObjectContext.m:7381)
  8   CoreData                        0x0000000187dabb4c -[NSManagedObjectContext(_NSInternalAdditions) _didSaveChanges] + 2156 (NSManagedObjectContext.m:5827)
  9   CoreData                        0x0000000187d98570 -[NSManagedObjectContext save:] + 3440 (NSManagedObjectContext.m:1532)
  10  App                             0x000000010008db34 __29-[RPSAppDelegate saveContext]_block_invoke227 + 52 (RPSAppDelegate.m:338)
  11  CoreData                        0x0000000187e17c68 developerSubmittedBlockToNSManagedObjectContextPerform + 168 (NSManagedObjectContext.m:3529)
  12  libdispatch.dylib               0x0000000185525784 _dispatch_client_callout + 16 (object.m:455)
  13  libdispatch.dylib               0x000000018552a330 _dispatch_main_queue_callback_4CF + 1000 (inline_internal.h:2421)
  14  CoreFoundation                  0x0000000185a8a0cc __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 (CFRunLoop.c:1793)
  15  CoreFoundation                  0x0000000185a87cb8 __CFRunLoopRun + 1660 (CFRunLoop.c:3004)
  16  CoreFoundation                  0x00000001859b78d8 CFRunLoopRunSpecific + 444 (CFRunLoop.c:3113)
  17  GraphicsServices                0x00000001873be198 GSEventRunModal + 180 (GSEvent.c:2245)
  18  UIKit                           0x000000018b9617c8 -[UIApplication _run] + 664 (UIApplication.m:2651)
  19  UIKit                           0x000000018b95c534 UIApplicationMain + 208 (UIApplication.m:4088)
  20  App                             0x000000010008c138 main + 152 (main.m:27)
  21  libdyld.dylib                   0x00000001855585b8 start + 4
  </code></pre>
  
  <p>Thank you for any ideas.</p>