1

I have a crash that only occurs on Apple review: when they try to login the app crashes. I tested it with real iPhones in test environment and in Ad-hoc several times and the crash never occurred before. After the review I made some research and I found some similar things and I have been trying out but I can't event simulate the same issue here (I also tried to change Xcode debug to release and he crash does not happen).

Here is what they said it happened at the review:

Upon further review and a fresh install of your app we continue to find that your app crashed on an iPad running iOS 8.4 and iPhone running iOS 8.4 when we: 1. Launch App 2. Input provided demo account credentials 3. Tap "Login" 4. Application crashes.

Here is the symbolicated log:

Last Exception Backtrace:
0   CoreFoundation                  0x1820ac2d8 __exceptionPreprocess + 132
1   libobjc.A.dylib                 0x193c7c0e4 objc_exception_throw + 60
2   CoreFoundation                  0x1820ac198 +[NSException raise:format:arguments:] + 116
3   Foundation                      0x182f60ed4 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112
4   UIKit                           0x186b4f1e0 -[UIKeyboardTaskQueue waitUntilAllTasksAreFinished] + 184
5   UIKit                           0x186b4f8c8 -[UIKeyboardImpl setDelegate:force:] + 636
6   UIKit                           0x186b48b3c -[UIPeripheralHost(UIKitInternal) _reloadInputViewsForResponder:] + 1212
7   UIKit                           0x186c2709c -[UIResponder _finishResignFirstResponder] + 184
8   UIKit                           0x187277730 -[UITextField _finishResignFirstResponder] + 56
9   UIKit                           0x186bced5c -[UIResponder resignFirstResponder] + 320
10  UIKit                           0x186c508bc -[UITextField resignFirstResponder] + 124
11  UIKit                           0x186d4b170 -[UITextField _setEnabled:animated:] + 128
12  PioNET                          0x100051110 -[LoginViewController startLogging] (LoginViewController.m:667)
13  Foundation                      0x182faddb8 __NSThread__main__ + 1072
14  libsystem_pthread.dylib         0x1944dbdc8 _pthread_body + 164
15  libsystem_pthread.dylib         0x1944dbd24 _pthread_start + 160
16  libsystem_pthread.dylib         0x1944d8ef8 thread_start + 4


Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0:
0   PioNET                          0x00000001000e3274 +[AFNetworkReachabilityManager sharedManager] (AFNetworkReachabilityManager.m:113)
1   PioNET                          0x00000001000dee9c +[AFHTTPRequestOperationManager manager] (AFHTTPRequestOperationManager.m:41)
2   PioNET                          0x000000010004db98 -[LoginViewController authentication:andPassword:] (LoginViewController.m:247)
3   PioNET                          0x0000000100050cfc -[LoginViewController loginProcess:andPassword:] (LoginViewController.m:641)
4   PioNET                          0x00000001000514b4 -[LoginViewController login:] (LoginViewController.m:692)
5   UIKit                           0x0000000186b59394 -[UIApplication sendAction:to:from:forEvent:] + 92
6   UIKit                           0x0000000186b42470 -[UIControl _sendActionsForEvents:withEvent:] + 608
7   UIKit                           0x0000000186b58d30 -[UIControl touchesEnded:withEvent:] + 588
8   UIKit                           0x0000000186b589bc -[UIWindow _sendTouchesForEvent:] + 696
9   UIKit                           0x0000000186b51ef8 -[UIWindow sendEvent:] + 680
10  UIKit                           0x0000000186b2511c -[UIApplication sendEvent:] + 260
11  UIKit                           0x0000000186dc62b4 _UIApplicationHandleEventFromQueueEvent + 15420
12  UIKit                           0x0000000186b23630 _UIApplicationHandleEventQueue + 1712
13  CoreFoundation                  0x000000018206423c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 20
14  CoreFoundation                  0x00000001820634e0 __CFRunLoopDoSources0 + 260
15  CoreFoundation                  0x0000000182061590 __CFRunLoopRun + 708
16  CoreFoundation                  0x0000000181f8d2d0 CFRunLoopRunSpecific + 392
17  GraphicsServices                0x000000018b8bb6f8 GSEventRunModal + 164
18  UIKit                           0x0000000186b8af3c UIApplicationMain + 1484
19  PioNET                          0x00000001000709b0 main (main.m:14)
20  libdyld.dylib                   0x0000000194326a04 start + 0

Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0   libsystem_kernel.dylib          0x0000000194424c24 kevent64 + 8
1   libdispatch.dylib               0x0000000194309e6c _dispatch_mgr_invoke + 272
2   libdispatch.dylib               0x00000001942fb998 _dispatch_mgr_thread + 48

Thread 2:
0   libsystem_kernel.dylib          0x000000019443fc78 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x00000001944d92d8 _pthread_wqthread + 988
2   libsystem_pthread.dylib         0x00000001944d8eec start_wqthread + 0

Thread 3:
0   libsystem_kernel.dylib          0x000000019443fc78 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x00000001944d92d8 _pthread_wqthread + 988
2   libsystem_pthread.dylib         0x00000001944d8eec start_wqthread + 0

Thread 4:
0   libsystem_kernel.dylib          0x000000019443fc78 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x00000001944d92d8 _pthread_wqthread + 988
2   libsystem_pthread.dylib         0x00000001944d8eec start_wqthread + 0

Thread 5:
0   libsystem_kernel.dylib          0x000000019443fc78 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x00000001944d92d8 _pthread_wqthread + 988
2   libsystem_pthread.dylib         0x00000001944d8eec start_wqthread + 0

Thread 6:
0   libsystem_kernel.dylib          0x000000019443fc78 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x00000001944d92d8 _pthread_wqthread + 988
2   libsystem_pthread.dylib         0x00000001944d8eec start_wqthread + 0

Thread 7 name:  com.apple.NSURLConnectionLoader
Thread 7:
0   libsystem_kernel.dylib          0x0000000194424e0c mach_msg_trap + 8
1   libsystem_kernel.dylib          0x0000000194424c84 mach_msg + 68
2   CoreFoundation                  0x0000000182063720 __CFRunLoopServiceMachPort + 196
3   CoreFoundation                  0x0000000182061674 __CFRunLoopRun + 936
4   CoreFoundation                  0x0000000181f8d2d0 CFRunLoopRunSpecific + 392
5   CFNetwork                       0x0000000181a6a590 +[NSURLConnection(Loader) _resourceLoadLoop:] + 436
6   Foundation                      0x0000000182faddb4 __NSThread__main__ + 1068
7   libsystem_pthread.dylib         0x00000001944dbdc4 _pthread_body + 160
8   libsystem_pthread.dylib         0x00000001944dbd20 _pthread_start + 156
9   libsystem_pthread.dylib         0x00000001944d8ef4 thread_start + 0

Thread 8 name:  com.apple.CFSocket.private
Thread 8:
0   libsystem_kernel.dylib          0x000000019443f498 __select + 8
1   CoreFoundation                  0x0000000182069124 __CFSocketManager + 668
2   libsystem_pthread.dylib         0x00000001944dbdc4 _pthread_body + 160
3   libsystem_pthread.dylib         0x00000001944dbd20 _pthread_start + 156
4   libsystem_pthread.dylib         0x00000001944d8ef4 thread_start + 0

Thread 9:
0   libsystem_kernel.dylib          0x0000000194424e0c mach_msg_trap + 8
1   libsystem_kernel.dylib          0x0000000194424c84 mach_msg + 68
2   CoreFoundation                  0x0000000182063720 __CFRunLoopServiceMachPort + 196
3   CoreFoundation                  0x0000000182061674 __CFRunLoopRun + 936
4   CoreFoundation                  0x0000000181f8d2d0 CFRunLoopRunSpecific + 392
5   CoreFoundation                  0x0000000181fdf358 CFRunLoopRun + 108
6   CoreMotion                      0x00000001829982b8 0x182950000 + 295608
7   libsystem_pthread.dylib         0x00000001944dbdc4 _pthread_body + 160
8   libsystem_pthread.dylib         0x00000001944dbd20 _pthread_start + 156
9   libsystem_pthread.dylib         0x00000001944d8ef4 thread_start + 0

Thread 10 Crashed:
0   libsystem_kernel.dylib          0x000000019443f270 __pthread_kill + 8
1   libsystem_pthread.dylib         0x00000001944dd16c pthread_kill + 108
2   libsystem_c.dylib               0x00000001943b6b14 abort + 108
3   libc++abi.dylib                 0x0000000193449414 abort_message + 112
4   libc++abi.dylib                 0x0000000193468b88 default_terminate_handler() + 300
5   libobjc.A.dylib                 0x0000000193c7c3bc _objc_terminate() + 124
6   libc++abi.dylib                 0x0000000193465bb0 std::__terminate(void (*)()) + 12
7   libc++abi.dylib                 0x0000000193465474 __cxa_throw + 132
8   libobjc.A.dylib                 0x0000000193c7c200 objc_exception_throw + 344
9   CoreFoundation                  0x00000001820ac194 +[NSException raise:format:arguments:] + 112
10  Foundation                      0x0000000182f60ed0 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 108
11  UIKit                           0x0000000186b4f1dc -[UIKeyboardTaskQueue waitUntilAllTasksAreFinished] + 180
12  UIKit                           0x0000000186b4f8c4 -[UIKeyboardImpl setDelegate:force:] + 632
13  UIKit                           0x0000000186b48b38 -[UIPeripheralHost(UIKitInternal) _reloadInputViewsForResponder:] + 1208
14  UIKit                           0x0000000186c27098 -[UIResponder _finishResignFirstResponder] + 180
15  UIKit                           0x000000018727772c -[UITextField _finishResignFirstResponder] + 52
16  UIKit                           0x0000000186bced58 -[UIResponder resignFirstResponder] + 316
17  UIKit                           0x0000000186c508b8 -[UITextField resignFirstResponder] + 120
18  UIKit                           0x0000000186d4b16c -[UITextField _setEnabled:animated:] + 124
19  PioNET                          0x000000010005110c -[LoginViewController startLogging] (LoginViewController.m:667)
20  Foundation                      0x0000000182faddb4 __NSThread__main__ + 1068
21  libsystem_pthread.dylib         0x00000001944dbdc4 _pthread_body + 160
22  libsystem_pthread.dylib         0x00000001944dbd20 _pthread_start + 156
23  libsystem_pthread.dylib         0x00000001944d8ef4 thread_start + 0

Thread 10 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x0000000000000000   x3: 0x00000001700ed0b7
    x4: 0x0000000193469dfd   x5: 0x0000000105476460   x6: 0x000000000000006e   x7: 0x0000000000000fa0
    x8: 0x0000000008000000   x9: 0x0000000004000000  x10: 0x0000000000000200  x11: 0x0000000000000000
   x12: 0x0000000000000000  x13: 0x0000000000000000  x14: 0x0000000000000002  x15: 0x0000000000000000
   x16: 0x0000000000000148  x17: 0x0000000000000000  x18: 0x0000000000000000  x19: 0x0000000000000006
   x20: 0x0000000105478000  x21: 0x00000001983f1ce8  x22: 0x0000000170010360  x23: 0x0000000000000000
   x24: 0x0000000000000000  x25: 0x0000000000000000  x26: 0x0000000187316681  x27: 0x0000000194c08000
   x28: 0x0000000000000110  fp: 0x00000001054763c0   lr: 0x00000001944dd170
    sp: 0x00000001054763a0   pc: 0x000000019443f270 cpsr: 0x00000000
Rafael Nascimento
  • 309
  • 1
  • 4
  • 14
  • You should symbolicate that crash report to get more details about where the crash is happening, this post has some details on how to do that: http://stackoverflow.com/questions/25855389/how-to-symbolicate-crash-log-xcode-6 You can always ask for more details from the Apple review team here: https://developer.apple.com/contact/app-store/?topic=clarification – LunaCodeGirl Aug 05 '15 at 21:59
  • I just asked for more info at Apple's resolution center. But I just can't simulate the crash. – Rafael Nascimento Aug 05 '15 at 22:16
  • It'll be hard for anyone to make heads or tails of a bunch of addresses like that. Have you symbolicated the crash report on your machine? Can you post that symbolicated log? – LunaCodeGirl Aug 05 '15 at 22:21
  • Ok, I did it. Here is what I got from the symbolicated log: -[GCMDataMessageManager didReceiveParsedMessage:] (in PioNET) + 253 – Rafael Nascimento Aug 05 '15 at 23:15
  • Is this (-[GCMDataMessageManager didReceiveParsedMessage:] (in PioNET) + 253) symbolicated log like? I can't find this class or method in my workspace. – Rafael Nascimento Aug 05 '15 at 23:49
  • I think now I did it right. The symbolicated log in my question. – Rafael Nascimento Aug 06 '15 at 12:30
  • @RafaelNascimento You may have copied the wrong thing. What you labelled as "symbolicated log" in the question is still just a list of addresses, not names of symbols. – Phillip Mills Aug 06 '15 at 12:36
  • @PhillipMills Ya! I got it right now. I just updated it in the question. Have a look! – Rafael Nascimento Aug 06 '15 at 13:03
  • The last stack frame in your code on the crashing thread points to "LoginViewController.m:667". What's happening around that line in that class...and should it be happening on a background thread? – Phillip Mills Aug 06 '15 at 14:42
  • @PhillipMills This line of code is happening in a new separated thread and it is showing a loading view (with a UIActivityIndicator). I did this so while the app is downloading some data from the web, it shows a loading view. Maybe I should not create new thread for that? And how can I reproduce the same issue here, so I can check if everything is good? – Rafael Nascimento Aug 06 '15 at 14:56
  • 1
    I don't know how to reproduce it...I assume you've tried running without Xcode attached. My question about threads was to make sure you're not attempting UI-related things in the background. Downloading in the background is good but if you show activity or progress, those should be dispatched back to the main thread. – Phillip Mills Aug 06 '15 at 15:30
  • Ok, I will make sure to keep the UI in the main thread. But again I come to the same issue: how do I test it? How can I make sure i won't crash at apple review? – Rafael Nascimento Aug 07 '15 at 13:34

2 Answers2

0

Do you use some third party control? It's not rare some controls crash when compiled for release. You can try to turn off the code optimizations for the release build and test if it crashes.

Fábio Salata
  • 372
  • 11
  • 16
0

Looks like it crashed at

0   PioNET 0x00000001000e3274 +[AFNetworkReachabilityManager sharedManager] (AFNetworkReachabilityManager.m:113)

That class, AFNetworkReachabilityManager, has something to do with if the network is reachable or not. Have you tried testing your application under different network situations, like no internet or poor internet connectivity? That might be where they're seeing the crash.

LunaCodeGirl
  • 5,432
  • 6
  • 30
  • 36
  • I did. I tested it under this circumstances and I never had this issue before. – Rafael Nascimento Aug 07 '15 at 13:32
  • Expanding Spencevail's answer, it also appears that you have source code for `AFNetworkReachabilityManager.m`, which means you can place a breakpoint, or add a log for all the variables, used in the call at that line, etc. Basically, something is not right at that spot. Perhaps you are calling a zombie object. Perhaps you are extending past the end of an array. Perhaps you are attempting to add a nil value to an array or dictionary. It's really hard to tell without seeing the couple of lines of code surrounding the problem. – Olie Sep 11 '15 at 00:15