onesky / plugin-ios-ota

Over the air plugin
50 stars 8 forks source link

Crashes in Onesky OTA Library #3

Closed josephlord closed 9 years ago

josephlord commented 9 years ago

We added the OTA plugin to our product for one release and started getting crashes (about 0.5% of sessions that appear to be attempts to release an already released object (looks to be a mutable array). Last night we released the next version (and I removed the OTA plugin) and these crashes appear to have stopped.

I suspected the OneSky OTA plugin because our app is ARC based and it was the only library added in the crashing build.

Crashed: com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x00000000ce02beb8 Thread : Crashed: com.apple.main-thread 0 libobjc.A.dylib 0x0000000195287bd0 objc_msgSend + 16 1 CoreFoundation 0x0000000183925458 CFRelease + 524 2 CoreFoundation 0x0000000183931a18 -[__NSArrayM dealloc] + 152 3 libobjc.A.dylib 0x000000019528d724 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 564 4 CoreFoundation 0x0000000183929074 _CFAutoreleasePoolPop + 28 5 Foundation 0x000000018485a588 -[NSAutoreleasePool release] + 148 6 UIKit 0x00000001884f4460 -[UIApplication _run] + 588 7 UIKit 0x00000001884eefac UIApplicationMain + 1488 8 [OurApp] 0x000000010009f4b0 main (main.m:16) 9 libdyld.dylib 0x00000001958f2a08 start + 4

Some but not much more detail may be available from our Crashlytics reporting.

I've also seen similar but less frequent issues but with a slightly different stack trace: Thread : Crashed: com.apple.main-thread 0 libobjc.A.dylib 0x0000000197ec7bdc objc_msgSend + 28 1 CoreFoundation 0x0000000187385228 CFRelease + 524 2 CoreFoundation 0x00000001873917e8 -[__NSArrayM dealloc] + 152 3 libobjc.A.dylib 0x0000000197ecd724 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 564 4 CoreFoundation 0x0000000187388e44 _CFAutoreleasePoolPop + 28 5 Foundation 0x000000018828a724 -[NSAutoreleasePool release] + 148 6 UIKit 0x000000018bcbfad0 -[UIApplication _run] + 588 7 UIKit 0x000000018bcbaaa4 UIApplicationMain + 1488 8 [OurApp] 0x000000010012f4b0 main (main.m:16) 9 libdyld.dylib 0x0000000198522a08 start + 4

I also have these which definitely have OneSkyOTA in the stacktrace although these are low frequency issues.

Fatal Exception: NSInvalidArgumentException * -[NSKeyedUnarchiver initForReadingWithData:]: incomprehensible archive (0x62, 0x70, 0x6c, 0x69, 0x73, 0x74, 0x30, 0x30) Thread : Fatal Exception: NSInvalidArgumentException 0 CoreFoundation 0x2e0a8e83 exceptionPreprocess 1 libobjc.A.dylib 0x3885d6c7 objc_exception_throw 2 CoreFoundation 0x2e0a8dc5 -[NSException initWithCoder:] 3 Foundation 0x2ea1f22b -[NSKeyedUnarchiver initForReadingWithData:] 4 Foundation 0x2ea71493 +[NSKeyedUnarchiver unarchiveObjectWithFile:] 5 [OurApp] 0x002ceba1 -OneSkyOTAHelper data 6 [OurApp] 0x002cec29 -OneSkyOTAHelper md5 7 [OurApp] 0x002cf517 -OneSkyOTAHelper checkForUpdate 8 [OurApp] 0x002d31db +OneSkyOTAPlugin checkForUpdate 9 [OurApp] 0x00106c6d -PSAppDelegate application:didFinishLaunchingWithOptions: 10 UIKit 0x3089daad -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] 11 UIKit 0x3089d4f3 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] 12 UIKit 0x30897b41 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] 13 UIKit 0x30832a07 -[UIApplication handleEvent:withNewEvent:] 14 UIKit 0x30831cfd -[UIApplication sendEvent:] 15 UIKit 0x30897321 _UIApplicationHandleEvent 16 GraphicsServices 0x32cf176d _PurpleEventCallback 17 GraphicsServices 0x32cf1357 PurpleEventCallback 18 CoreFoundation 0x2e073777 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION** 19 CoreFoundation 0x2e073713 CFRunLoopDoSource1 20 CoreFoundation 0x2e071edf __CFRunLoopRun 21 CoreFoundation 0x2dfdc471 CFRunLoopRunSpecific 22 CoreFoundation 0x2dfdc253 CFRunLoopRunInMode 23 UIKit 0x308965c3 -[UIApplication _run] 24 UIKit 0x30891845 UIApplicationMain 25 [OurApp] 0x000b2617 main (main.m:16) 26 libdyld.dylib 0x38d56ab7 start

Crashed: com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x00000000d510beb8 Thread : Crashed: com.apple.main-thread 0 libobjc.A.dylib 0x000000019723bbd0 objc_msgSend + 16 1 CoreFoundation 0x00000001859388e0 -[NSDictionary descriptionWithLocale:indent:] + 1068 2 CoreFoundation 0x0000000185938924 -[NSDictionary descriptionWithLocale:indent:] + 1136 3 CoreFoundation 0x0000000185938924 -[NSDictionary descriptionWithLocale:indent:] + 1136 4 CoreFoundation 0x0000000185938924 -[NSDictionary descriptionWithLocale:indent:] + 1136 5 Foundation 0x00000001868124dc _NSDescriptionWithLocaleFunc + 84 6 CoreFoundation 0x00000001859ce134 CFStringAppendFormatCore + 7768 7 CoreFoundation 0x00000001859cc2a4 _CFStringCreateWithFormatAndArgumentsAux2 + 248 8 CoreFoundation 0x00000001859e9a88 _CFLogvEx2 + 152 9 Foundation 0x0000000186823660 NSLogv + 108 10 Foundation 0x00000001868235e8 NSLog + 24 11 [OurApp] 0x000000010036f2c8 33-[OneSkyOTAHelper checkForUpdate]_block_invoke (OneSkyOTAHelper.m:246) 12 CFNetwork 0x00000001853c7310 67+[NSURLConnection sendAsynchronousRequest:queue:completionHandler:]_block_invoke_2 + 188 13 Foundation 0x00000001868eb1c4 NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK + 16 14 Foundation 0x000000018683c604 -[NSBlockOperation main] + 96 15 Foundation 0x000000018682c1cc -[**NSOperationInternal _start:] + 636 16 Foundation 0x00000001868edf28 NSOQSchedule_f + 228 17 libdispatch.dylib 0x0000000197879954 _dispatch_client_callout + 16 18 libdispatch.dylib 0x000000019787e20c _dispatch_main_queue_callback_4CF + 1608 19 CoreFoundation 0x00000001859bb7f8 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE** + 12 20 CoreFoundation 0x00000001859b98a0 CFRunLoopRun + 1492 21 CoreFoundation 0x00000001858e52d4 CFRunLoopRunSpecific + 396 22 GraphicsServices 0x000000018f0fb6fc GSEventRunModal + 168 23 UIKit 0x000000018a4aafac UIApplicationMain + 1488 24 [OurApp] 0x000000010010b4b0 main (main.m:16) 25 libdyld.dylib 0x00000001978a6a08 start + 4

bretdabaker commented 9 years ago

The OTA plugin is also ARC based so I will need to find out what might be the problem. Will work on the NSKeyedUnarchiver issue too.

bretdabaker commented 9 years ago

v0.9.1 fixed the bug caused by NSKeyedUnArchiever.

bretdabaker commented 9 years ago

As for the EXC_BAD_ACCESS crash, I cannot find any code relevant to the crash, the library doesn't really hold reference to any NSArray object.

Please try to reproduce the bug under debug environment and provide more information. Until then I will mark this issue as closed.