objc_msgSend [__NSArrayM dealloc] crash report sometimes from Crashlytics

后端 未结 5 431
醉酒成梦
醉酒成梦 2020-12-15 16:27

I recently received this app after updating to Crashlytics 3.0 Not sure if it comes from my code or something else. The crash report is untraceable

Here is          


        
5条回答
  •  粉色の甜心
    2020-12-15 17:05

    CoreFoundation  _CFAutoreleasePoolPop + 28
    

    Autorelease pool is being drained, probably in the end of the UI loop. That means all autoreleased objects in the pool are now released.

    CoreFoundation  -[__NSArrayM dealloc] + 152
    

    A mutable array is being released. That means all the items it is holding are being released too.

    CoreFoundation  CFRelease + 524
    

    One of the items in the array is being released.

    Crash, the item is invalid, it has already been deallocated.

    The thing you should inspect are items in arrays. Something is definitely overreleased. If you are using manual reference counting, you should inspect objects that you put into arrays - one of the items is deallocated but is still being kept in some array.

    A code that will trigger a similar error under MRC is the following:

    NSMutableArray *array = [NSMutableArray array]; //an autoreleased array
    NSObject *object1 = [[NSObject alloc] init];
    NSObject *object2 = [[NSObject alloc] init];
    
    [array addObject:object1]    
    [array addObject:object2]    
    
    [object1 release];
    [object2 release];
    
    //let's overrelease
    [object1 release];
    //when array is released, it will send a release message to object1, too
    

提交回复
热议问题