I did not change nothing in my code, but after iOS 14 and Xcode 12 I started to get the crashes. Previous build was on Xcode 11 and I didn't see the crashes, I tried to create same test cases for deferent iOS and Xcode, and I don’t see the crashes in previous build. I started to get the crashes, only for iOS 14 operating systems and after using Xcode 12.
My function, where I think I have the crash, but I don't understand where exactly, because I didn't change nothing. Maybe something changed in Core Data?
(NSMutableArray *)getObjectsforEntity:(NSString *)strEntity sortBy:(NSString *)strSort isAscending:(BOOL)ascending predicate:(NSPredicate *)predicate {
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:strEntity];
if (strSort) {
NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:strSort ascending:ascending];
[fetchRequest setSortDescriptors:[NSArray arrayWithObject:sort]];
}
if (predicate) {
[fetchRequest setPredicate:predicate];
}
NSError *error;
NSMutableArray *result = [[[[self managedObjectContext] executeFetchRequest:fetchRequest error:&error] mutableCopy ]autorelease];
if (result == nil) {
return [[NSMutableArray alloc] init];
}
return result;
}
I tried to caught it and this is what I found:
==13048==ERROR: AddressSanitizer: allocator is out of memory trying to allocate 0x1a0 bytes
==13048==FATAL: AddressSanitizer: internal allocator is out of memory trying to allocate 0x50 bytes
AddressSanitizer report breakpoint hit. Use 'thread info -s' to get extended information about the report.
(lldb) thread info -s
thread #1: tid = 0x12fa63, 0x00000001041961f8 libclangrt.asaniosdynamic.dylib`asan::AsanDie(), queue = 'SQLQueue 0x16572e2c0 for MyApp.sqlite', stop reason = AddressSanitizer detected: out-of-memory
{
"accesssize": 0,
"accesstype": 0,
"address": 0,
"description": "out-of-memory",
"instrumentationclass": "AddressSanitizer",
"pc": 0,
"stoptype": "fatalerror"
}
This is what I see in log:
self RMNDatabaseManager * 0x164416210 0x0000000164416210
NSObject NSObject
isa _unsafeunretained Class RMNDatabaseManager 0x000021a1019b6131
predicate NSPredicate * 0x2d7143b90 0x00000002d7143b90
NSObject NSObject
predicateFlags struct predicateFlags
evaluationBlocked unsigned int 0
reservedPredicateFlags unsigned int 0
reserved uint32t 0
fetchRequest NSFetchRequest * 0x2ce26f2d0 0x00000002ce26f2d0
NSPersistentStoreRequest NSPersistentStoreRequest
NSObject NSObject
isa unsafeunretained Class 0x61a1fb9ef989 0x000061a1fb9ef989
error NSError * domain: nil - code: 1287 0x0000000102957960
NSObject NSObject
isa _unsafeunretained Class 0x102957880 0x0000000102957880
reserved void * 0x10295792c 0x000000010295792c
code NSInteger 1287
domain NSString * 0x303 0x0000000000000303
NSObject NSObject
isa unsafeunretained Class 0x0
userInfo NSDictionary * 0x20ff 0x00000000000020ff
NSObject NSObject
isa unsafeunretained Class 0x0
result NSMutableArray * 0x2d5131420 0x00000002d5131420
NSArray NSArray
NSObject NSObject
isa _unsafeunretained Class 0x154000452 0x0000000154000452
Crashlog details:
[[Crashed: 0 CoreData 0x000000019d9fb6b8 PFObjectIDFastHash64 + 36 (NSBasicObjectID.m:707) 1 CoreData 0x000000019d9fb6b4 PFObjectIDFastHash64 + 32 (NSBasicObjectID.m:706) 2 CoreFoundation 0x0000000197c1c10c CFBasicHashRehash + 996 (CFBasicHash.c:477) 3 CoreFoundation 0x0000000197c1fdf4 CFBasicHashRemoveValue + 2352 (CFBasicHash.c:1386) 4 CoreFoundation 0x0000000197b3e2f8 CFDictionaryRemoveValue + 224 (CFDictionary.c:471) 5 CoreData 0x000000019d94b8e8 -[NSManagedObjectContext(NSInternalAdditions) forgetObject:propagateToObjectStore:removeFromRegistry:] + 120 (NSManagedObjectContext.m:5088) 6 CoreData 0x000000019d92b450 -[PFManagedObjectReferenceQueue processReferenceQueue:] + 864 (NSManagedObjectContext.m:5077) 7 CoreData 0x000000019da43578 90-[NSManagedObjectContext(NSInternalNotificationHandling) registerAsyncReferenceCallback]blockinvoke + 68 (NSManagedObjectContext.m:8825) 8 CoreData 0x000000019da39b18 developerSubmittedBlockToNSManagedObjectContextPerform + 156 (NSManagedObjectContext.m:3880) 9 libdispatch.dylib 0x000000019782b280 dispatchclientcallout + 16 (object.m:559) 10 libdispatch.dylib 0x00000001977d3fa8 dispatchlaneserialdrain$VARIANT$mp + 612 (inlineinternal.h:2548) 11 libdispatch.dylib 0x00000001977d4a84 dispatchlaneinvoke$VARIANT$mp + 424 (queue.c:3862) 12 libdispatch.dylib 0x00000001977de518 dispatchworkloopworkerthread + 712 (queue.c:6590) 13 libsystempthread.dylib 0x00000001dc7005a4 pthreadwqthread + 272 (pthread.c:2193) 14 libsystempthread.dylib 0x00000001dc703874 startwqthread + 8]]
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
iOS
Xcode
Xcode Sanitizers and Runtime Issues