2022-11-23

EXC_BREAKPOINT on NSFetchedResultsController.performFetch() because of -[CFString isNSString__]: message sent to deallocated instance

I'm running into a repeatable crash when calling -performFetch on my NSFetchedResultsController in what SEEMS like a data-related crash:

 NSFetchedResultsController *aFetchedResultsController =
        [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest
                                            managedObjectContext:self.managedObjectContext
                                              sectionNameKeyPath:sectionnamekeypath
                                                       cacheName:cacheName];
        

aFetchedResultsController.delegate = self;

NSError *error = nil;
if (NO == [aFetchedResultsController performFetch:&error]) {
    NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
}

It crashes at the performFetch() call. I turned on Zombie checking and it printed:

*** -[CFString isNSString__]: message sent to deallocated instance 0x12c6071d0

I've checked all of the strings in my function and I can't find a string that has that address. I NSLog()'d all of the strings along with their address locations. I figured it would break on whatever NSLog() line that referenced the string in question, but all of them were still valid.

This makes me think this is a problem inside NSFetchedResultsController.performFetch() but it's hard to imagine that they have this kind of bug. So, what else can I do to find out what string this is?

I haven't run into problems like this since we switched over to ARC. I'm not sure how to figure out where this string comes from.

It SEEMS like this is data related though. My app pulls down data from our server, imports it into Core Data, and then uses the NSFetchedResultsController to show the data in a UITableView. I can login as various different users, download their data, and the FRC fetches and works just fine. But when I login as this one particular user, then it crashes. That user is one of our biggest users and their dataset is thousands and thousands of records, so it's not something I can easily look through to visually find things that might be weird. Doing further testing and will update this if I find any new info.

Any help?



No comments:

Post a Comment