Cannot replicate Apple iOS app review crash

2019-06-09 00:42发布

问题:

I recently submitted my iOS app to Apple for review. It was written in C# using Xamarin iOS, Monotouch and Monogame. I used the Xamarin IDE for development. A week later I get a rejection which specifies the reason being that the app crashes on iPad when the reviewer tries to access the In-App-Purchase store, while on the iPhone 5s it doesn't crash, but indicates that it couldn't reach the Apple servers to retrieve the store items. Much of my store retrieving code is from Xamarin's guide found here.

The problem is that I could not replicate those crashes. The store opens just fine with me and I tested it extensively. I tested on all simulators, and many real devices in debug & release configurations (iPhone 4, iPhone 5, iPhone 5s, iPad 3rd generation). I didn't test in ad-hoc mode since many of these devices were borrowed from my friends and I didn't want to sync in iTunes since that could wipe out device data. So am hoping release build and ad-hoc are equivalent in terms of finding the review team's bug.

As for the crash logs given to me by Apple, they didn't help me since most lines don't get symbolicated properly in Xcode using the same archive that I submitted to Apple. There are a lot of '___lldb_unnamed_function' lines in the log. All i was able to tell was that the crash occurred when trying to retrieve the store. Therefore am stuck and not sure what to do next. Advice is appreciated.

Below is the last portion of a long crash log.

Incident Identifier: 24777CEA-21FF-434B-A658-BFB4BC89F7B2
CrashReporter Key:   e981dd69858f1d35ba231cd2e288f3d33625919f
Hardware Model:      xxx
Version:             1 (1)
Code Type:           ARM (Native)
Parent Process:      launchd [1]
Date/Time:           2014-01-09 13:30:21.579 -0800
OS Version:          iOS 7.0.4 (11B554a)
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x387e41fc __pthread_kill + 8
1   libsystem_pthread.dylib         0x3884ba4f pthread_kill + 55
2   libsystem_c.dylib               0x38795029 abort + 73
3   MyGame                          0x00d8036d mono_handle_native_sigsegv (mini-exceptions.c:2413)
4   MyBeGame                        0x00d855b7 sigabrt_signal_handler (mini-posix.c:206)
5   libsystem_platform.dylib        0x38846721 _sigtramp + 41
6   libsystem_pthread.dylib         0x3884ba4f pthread_kill + 55
7   libsystem_c.dylib               0x38795029 abort + 73
8   MyBeGame                        0x00e30744 monotouch_unhandled_exception_handler (monotouch-glue.m:1436)
9   MyBeGame                        0x00d8072d mono_invoke_unhandled_exception_hook (mini-exceptions.c:2749)
10  MyBeGame                        0x00d8d7ab mono_thread_abort_dummy (mini.c:2768)
11  MyBeGame                        0x00d7ff35 mono_handle_exception_internal (mini-exceptions.c:1710)
12  MyBeGame                        0x00d7f6b7 mono_handle_exception (mini-exceptions.c:2003)
13  MyBeGame                        0x00d791b5 mono_arm_throw_exception (exceptions-arm.c:161)
14  MyBeGame                        0x0023f7d4 ___lldb_unnamed_function12968$$MyBeGame + 64
15  MyBeGame                        0x002da1d0 ___lldb_unnamed_function20307$$MyBeGame + 92
16  MyBeGame                        0x00293960 ___lldb_unnamed_function17583$$MyBeGame + 196
17  MyBeGame                        0x00212418 ___lldb_unnamed_function12101$$MyBeGame + 168
18  MyBeGame                        0x0029205c ___lldb_unnamed_function17574$$MyBeGame + 92
19  MyBeGame                        0x00295c58 ___lldb_unnamed_function17610$$MyBeGame + 32
20  MyBeGame                        0x00083570 ___lldb_unnamed_function2892$$MyBeGame + 860
21  MyBeGame                        0x000954f4 ___lldb_unnamed_function3194$$MyBeGame + 1516
22  MyBeGame                        0x00093610 ___lldb_unnamed_function3176$$MyBeGame + 40
23  MyBeGame                        0x0006246c MyBeGame.HintStoreController.HintStoreControl/StateRetrieving:<Activate>m__F + 624
24  MyBeGame                        0x0045d39c ___lldb_unnamed_function33945$$MyBeGame + 48
25  MyBeGame                        0x0020c10c ___lldb_unnamed_function11957$$MyBeGame + 196
26  MyBeGame                        0x00d8ce4f mono_jit_runtime_invoke (mini.c:6504)
27  MyBeGame                        0x00dd482b mono_runtime_invoke (object.c:2827)
28  MyBeGame                        0x00d5117b native_to_managed_trampoline_MonoTouch_Foundation_InternalNSNotificationHandler_Post (registrar.m:28)
29  CoreFoundation                  0x2da4fe6f __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 11
30  CoreFoundation                  0x2d9c3aad _CFXNotificationPost + 1717
31  Foundation                      0x2e3a9ec1 -[NSNotificationCenter postNotificationName:object:userInfo:] + 69

回答1:

You can determine if builds from two different configurations (say Release and Ad-Hoc) are identical by comparing the project's options. In particular look at the Build/Compiler and Build/iOS Build pages and make sure all the options are identical.

Regarding the crash report we've unfortunately had a bug with the dSYM generation in Xamarin.iOS 7.0.4, so managed frames will not symbolicate correctly (this is the reason for all the lldb_unnamed_function entries). What I can say however is that the app is crashing because there is an unhandled managed exception.

If you're unable to reproduce the problem yourself, I'd suggest rebuilding your app with Xamarin.iOS 7.0.6 (currently in the beta channel), and resubmit to Apple. The app may still crash, but you should get better crash reports which will at least tell you where the managed exception is occurring.