NSAsynchronousFetchRequest and concurrency violations

Is there any particular reason why the Core Data concurrency debug flag throws an exception when using NSAsynchronousFetchRequest? It semes to be happening in both iOS10 and iOS11. This is the code I was testing:


- (void) testAsync {
  
    NSManagedObjectContext *spotlightMOC = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType];
    spotlightMOC.name = @"BackgroundMOC";

    NSPersistentStoreCoordinator *psc = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:self.managedObjectModel];
    [psc addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:self.persistentStoreCoordinator.persistentStores.firstObject.URL options:@{NSReadOnlyPersistentStoreOption: @YES, NSMigratePersistentStoresAutomaticallyOption: @YES, NSInferMappingModelAutomaticallyOption: @NO} error:nil];
    [spotlightMOC setPersistentStoreCoordinator: psc];


    NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName: @"Person"];

    NSAsynchronousFetchRequest *asynchronousFetchRequest = [[NSAsynchronousFetchRequest alloc] initWithFetchRequest:fetchRequest completionBlock:^(NSAsynchronousFetchResult *result) {
     
        if (!result.operationError) {
            NSLog(@"processAsyncResult count = %lu", (unsigned long) result.finalResult.count);
            NSLog(@"print = %@", result.finalResult);
         
        }
    }];

    [spotlightMOC performBlock:^{
        NSError *asynchronousFetchRequestError = nil;
     
     
        /
     
        [spotlightMOC executeRequest:asynchronousFetchRequest error:&asynchronousFetchRequestError];
        if (asynchronousFetchRequestError) {
            NSLog(@"Unable to execute asynchronous fetch result.");
            NSLog(@"%@, %@", asynchronousFetchRequestError, asynchronousFetchRequestError.localizedDescription);
        } else {
            NSLog(@"AsyncRequest executeRequest finised without error");
        }
    }];
}



With the -com.apple.CoreData.ConcurrencyDebug flag set to 1 in "Arguments Passed On Launch", I always hit an exception that says "CoreData`+[NSManagedObjectContext __Multithreading_Violation_AllThatIsLeftToUsIsHonor__]:"



What concurrency violation am I committing here? Or is this a bug with Xcode / Core Data?

Three years later in iOS 13, I'm running into the same thing. I filed FB5746349 about it, but haven't heard anything yet.
NSAsynchronousFetchRequest and concurrency violations
 
 
Q