IOS 8 crashing in a weird pattern

I've spent over a thousand hours on the app, it works great on iOS 7, both on the device and on the simulator. When I run it on iOS 8 it works great on the simulator. But for some reason, when I run it on my iOS 8 device, it starts to crash strangely. If I implement CLLocation, the application runs smoothly for the first 5 times I run it. Then it crashes MOMENT I will compile it for the next 5 times. After doing this 5 times, it starts compiling again. Then, 5 more times, it runs again on startup and the pattern continues. IE. 1, run. 2. run. 3. run. 4. run. 5. run. 6-10. Startup crash, 11-15, startup. Accident 16-20

HOWEVER, when I remove CLLocation, the application runs smoothly, but it crashes every third launch. IE. 1. run. 2. run. 3. Accident. 4. run. 5. run 6. crash.

I banged my head against the wall like days without sleep. Can someone explain to me why? For each startup failure, the only console outputs error is the NSDictionary unknown selector.

I don't want my app to be rejected if Apple reviewers run it at one of the "crash times"

Console Bt

(lldb) bt
* thread #3: tid = 0x12646, 0x00000001983640a8 libobjc.A.dylib`objc_exception_throw, queue = 'com.apple.root.default-qos', stop reason = breakpoint 1.1
    frame #0: 0x00000001983640a8 libobjc.A.dylib`objc_exception_throw
    frame #1: 0x0000000187d8d094 CoreFoundation`-[NSObject(NSObject) doesNotRecognizeSelector:] + 220
    frame #2: 0x0000000187d89e48 CoreFoundation`___forwarding___ + 928
    frame #3: 0x0000000187c8f08c CoreFoundation`_CF_forwarding_prep_0 + 92
    frame #4: 0x0000000188c4f0dc Foundation`-[NSString getExternalRepresentation:extendedAttributes:forWritingToURLOrPath:usingEncoding:error:] + 192
    frame #5: 0x0000000188c4f23c Foundation`writeStringToURLOrPath + 72
  * frame #6: 0x00000001000c9f1c Blurtalk`+[PFInternalUtils installationId](self=<unavailable>, _cmd=<unavailable>) + 340 at PFInternalUtils.m:307
    frame #7: 0x00000001000f0a94 Blurtalk`+[PFNetworkCommandRunner createRequest:](self=0x000000010027d1b8, _cmd=<unavailable>, command=0x0000000170056a70) + 268 at PFNetworkCommandRunner.m:61
    frame #8: 0x00000001000f1044 Blurtalk`+[PFNetworkCommandRunner runCommandAsync:inOperation:](self=0x000000010027d1b8, _cmd=<unavailable>, command=<unavailable>, operation=<unavailable>) + 196 at PFNetworkCommandRunner.m:132
    frame #9: 0x00000001000f1748 Blurtalk`+[PFRetryingCommandRunner runCommandAsync:inOperation:attemptsMade:delay:](self=<unavailable>, _cmd=<unavailable>, command=<unavailable>, operation=<unavailable>, attemptsMade=1, delay=<unavailable>) + 92 at PFRetryingCommandRunner.m:42
    frame #10: 0x00000001000f16bc Blurtalk`+[PFRetryingCommandRunner runCommandAsync:inOperation:](self=<unavailable>, _cmd=<unavailable>, command=<unavailable>, operation=<unavailable>) + 124 at PFRetryingCommandRunner.m:35
    frame #11: 0x00000001000f1f80 Blurtalk`+[PFCachedCommandRunner runCommandAsync:inOperation:cachePolicy:maxCacheAge:](self=<unavailable>, _cmd=<unavailable>, command=<unavailable>, operation=<unavailable>, cachePolicy=<unavailable>, maxCacheAge=<unavailable>) + 240 at PFCachedCommandRunner.m:82
    frame #12: 0x000000010009dcd8 Blurtalk`__48-[BFTask continueWithExecutor:withSuccessBlock:]_block_invoke(.block_descriptor=0x0000000170241e60, task=<unavailable>) + 200 at BFTask.m:335
    frame #13: 0x000000010009d730 Blurtalk`__41-[BFTask continueWithExecutor:withBlock:]_block_invoke_2(.block_descriptor=0x000000017807a340) + 32 at BFTask.m:287
    frame #14: 0x0000000100338f20 libdispatch.dylib`_dispatch_call_block_and_release + 24
    frame #15: 0x0000000100338ee0 libdispatch.dylib`_dispatch_client_callout + 16
    frame #16: 0x00000001003459a0 libdispatch.dylib`_dispatch_root_queue_drain + 1272
    frame #17: 0x0000000100346f18 libdispatch.dylib`_dispatch_worker_thread3 + 132
    frame #18: 0x0000000198b852e4 libsystem_pthread.dylib`_pthread_wqthread + 816

      

+2


source to share


2 answers


I was able to reproduce and narrow down your crash using NSZombieEnabled.

My feedback:

2014-12-30 14:58:26.997 Proto[1398:513570] *** -[CFString getExternalRepresentation:extendedAttributes:forWritingToURLOrPath:usingEncoding:error:]: message sent to deallocated instance 0x170e78fc0
(lldb) bt
* thread #7: tid = 0x7d622, 0x00000001864be440 CoreFoundation`___forwarding___ + 968, queue = 'com.apple.root.default-qos', stop reason = EXC_BREAKPOINT (code=1, subcode=0x1864be440)
  * frame #0: 0x00000001864be440 CoreFoundation`___forwarding___ + 968
    frame #1: 0x00000001863c2b6c CoreFoundation`_CF_forwarding_prep_0 + 92
    frame #2: 0x000000018738a83c Foundation`writeStringToURLOrPath + 72
    frame #3: 0x00000001002485bc Proto`+[PFInternalUtils installationId](self=<unavailable>, _cmd=<unavailable>) + 340 at PFInternalUtils.m:308
    frame #4: 0x000000010028a944 Proto`+[PFNetworkCommandRunner createRequest:](self=0x000000010054eea8, _cmd=<unavailable>, command=0x0000000170446990) + 308 at PFNetworkCommandRunner.m:62
    frame #5: 0x000000010028aef4 Proto`+[PFNetworkCommandRunner runCommandAsync:inOperation:](self=0x000000010054eea8, _cmd=<unavailable>, command=<unavailable>, operation=<unavailable>) + 196 at PFNetworkCommandRunner.m:133
    frame #6: 0x000000010028b5fc Proto`+[PFRetryingCommandRunner runCommandAsync:inOperation:attemptsMade:delay:](self=<unavailable>, _cmd=<unavailable>, command=<unavailable>, operation=<unavailable>, attemptsMade=1, delay=<unavailable>) + 92 at PFRetryingCommandRunner.m:42
    frame #7: 0x000000010028b570 Proto`+[PFRetryingCommandRunner runCommandAsync:inOperation:](self=<unavailable>, _cmd=<unavailable>, command=<unavailable>, operation=<unavailable>) + 124 at PFRetryingCommandRunner.m:35
    frame #8: 0x000000010028be40 Proto`+[PFCachedCommandRunner runCommandAsync:inOperation:cachePolicy:maxCacheAge:](self=<unavailable>, _cmd=<unavailable>, command=<unavailable>, operation=<unavailable>, cachePolicy=<unavailable>, maxCacheAge=<unavailable>) + 248 at PFCachedCommandRunner.m:83
    frame #9: 0x00000001001ad038 Proto`__48-[BFTask continueWithExecutor:withSuccessBlock:]_block_invoke(.block_descriptor=0x0000000170446ea0, task=<unavailable>) + 200 at BFTask.m:335
    frame #10: 0x00000001001aca90 Proto`__41-[BFTask continueWithExecutor:withBlock:]_block_invoke_2(.block_descriptor=0x0000000171067b40) + 32 at BFTask.m:287
    frame #11: 0x0000000100ab8e30 libdispatch.dylib`_dispatch_call_block_and_release + 24
    frame #12: 0x0000000100ab8df0 libdispatch.dylib`_dispatch_client_callout + 16
    frame #13: 0x0000000100ac59a0 libdispatch.dylib`_dispatch_root_queue_drain + 1280
    frame #14: 0x0000000100ac6f18 libdispatch.dylib`_dispatch_worker_thread3 + 132
    frame #15: 0x00000001974312e4 libsystem_pthread.dylib`_pthread_wqthread + 816

      



This is a bug in the Parse SDK, especially when Parse tries to get device information on initial installation. I suggest you report this bug in Parse directly and point this question to StackOverflow.

Additional talk here: Failed CC snippet library at [PFInternalUtils installationId]

EDIT: There is an open bug report here: https://developers.facebook.com/bugs/1548203598729083

+2


source


you have to create one for all breakpoints that will stop on any exception, please read this article, this is a very useful method. http://blog.manbolo.com/2012/01/23/xcode-tips-1-break-on-exceptions



By the way, NSDictionary has no length, it seems like you made a mistake by obfuscating it with NSString object.

+1


source







All Articles