Unable to reproduce App Store Review Crashes

Dear Apple Developers community,

Our app is being rejected by the App Store upon review based on detecting crashes upon launch. However, following exhaustive tests on all available simulators and some physical devices (including an iPhone 12 Pro running iOS 14.4.2) we were unable to reproduce the crashes reported. We also tried testing a binary via TestFlight without any issues at all. We also symbolicated our crash reports following Apple's documentation without being able to find any issues that cause the crash upon launch. I am attaching the three reports that Apple Store review shared with us for reference along with the symbolicated outputs for "ParkZen" and "FirebaseFirestore". Our app uses the FireStore database. Any feedback would be greatly appreciated.

1) https://iosapps-ssl.itunes.apple.com/itunes-assets/Purple125/v4/80/06/1e/80061eee-c4c2-2194-c8e1-4cb693546c6a/attachment.crashlog-3B112192-8D8A-44DA-8EB1-0563386C41BB.txt?accessKey=1618848035_6910206807337667898_h6kPaYJOV56xwRkNjjTkztP%2BRq4CQCroN9LS%2BuJKwoV8TAkWCV3X%2Fd9XapTSBt9j%2FEetbrTifhYvaNHpCxXgLFEUQ6Sz68LW1KyUrp7nWwG2TjsZiYj2OAGpVVkYlLzu%2Fz7LVVaPp06PYIdfGEHYFUfe6PuFRUCB8xAnrm%2B0Poq7gYWFy0%2F7%2BkrqMxlbt8TklgbJimfs0F7%2F6ny1oc0yIbhsRNxV0BKp9wH0p85YgsQ%3D

2) https://iosapps-ssl.itunes.apple.com/itunes-assets/Purple125/v4/4f/a5/36/4fa5366a-2ab3-a0f0-9553-4a9b8cc32ab1/attachment.crashlog-E5709224-7BCB-45FC-92F7-E6E1DC7A2BC8.txt?accessKey=1618848035_5419641398235611613_S5R436uDbgLHsLasiTbmzF456qVlLyS6lyoDcbbx%2BSxV0xyzVzA67bNK7A7yftxwisf4gz3%2BjMBHwsyF3ZAeoyStfQA%2BAMENq%2B8%2B2dDa361WfIM%2BbL4toHk5RoyEzlNvaZTC8G65VMy%2BklOlbeTwLUD9HtoTYXnhyjKm4E8CV8hc2MwkwapKANmAlO9RrnEitUWt1qp620c439IN5NpSZmVdEBxYQlSp%2FJqZb33thoM%3D

3) https://iosapps-ssl.itunes.apple.com/itunes-assets/Purple125/v4/47/67/c4/4767c4bc-8820-6264-f8ce-d6464aa6cdeb/attachment.crashlog-2FAC820F-7BBD-428C-8901-BCA3663599BD.txt?accessKey=1618848035_1479893548423628230_JF9xULY4IoBRblEDOeKQZk5borlYARJjnKDlClMbXekl7BWr7Y00E6HKjwz00K3lautGkwCjdVc7khcrNcovUlbaKSI8lSZs3JAxlAvmTgdjzQVAcfYPvc0YQ%2B%2FgDIGUnPZtLiDJRC31XnZ59Yx%2B6Cidvz5%2B590ebu7DdXZ%2BMyevS%2BclcTc2C8Wl48Hq%2F9Bq7DmfcmcIJLJmI%2B1KTe6gq%2FLm%2BQhJoWxDOEpVDV33IsE%3D

Symbolicated Debugging:

closure #1 in ViewController.viewDidLoad() (in ParkZen) (ViewController.swift:87)
closure #1 in ViewController.viewDidLoad() (in ParkZen) (ViewController.swift:87)
closure #1 in DatabaseInterface.retrieveData_dynamic(completionHandler:) (in ParkZen) (DatabaseInterface.swift:0)
thunk for @escaping @callee_guaranteed (@guaranteed FIRQuerySnapshot?, @guaranteed Error?) -> () (in ParkZen) (<compiler-generated>:0)
main (in ParkZen) (ViewController.swift:18)
2)
3)
Please post the full symbolicated crash report, not just a snippet. Use the text attachment feature (the paperclip icon) to avoid clogging up the timeline.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Dear Quinn,

I sincerely appreciate you for your response and I apologize for the long post. I am attached via the text attachment feature here the symbolicated report as produced by copying the review's crash files into Window -> Devices & Simulators -> Device -> Crash reports. I look forward to your invaluable feedback on how to tackle this issue as it has greatly delayed our release in the app store provided that we were unable to reproduce the reported "crash upon launch" in any of the iOS simulators, physical devices and installs via TestFlight we have attempted.

Kind regards,

Manos




These crashes look like they both have the same underlying cause. The snippets I’ve used below are from the first one.

Let’s start here:

Code Block
Exception Type: EXC_BREAKPOINT (SIGTRAP)


This almost always means that your app has crashed deliberately because some code within the app has detected a failure. If you’re working in Swift the most common cause of this is a trap within the Swift runtime, for example, if you force unwrap an optional that’s nil or access an array out of bounds.

In that case your next step should be to look at the backtrace of the crashing thread:

Code Block
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 ParkZen … closure #1 in DatabaseInterface.retrieveData_static(completionHandler:) + 38056
(DatabaseInterface.swift:45)
1 ParkZen … closure #1 in DatabaseInterface.retrieveData_static(completionHandler:) + 37872
(DatabaseInterface.swift:45)
2 ParkZen … thunk for @escaping @callee_guaranteed (@guaranteed FIRQuerySnapshot?, @guaranteed
Error?) -> () + 38132 (<compiler-generated>:0)
3 FirebaseFirestore … std::__1::__function::__func<-[FIRQuery addSnapshotListenerInternalWithOptions:
listener:]::$_0, std::__1::allocator<-[FIRQuery addSnapshotListenerInternalWithOptions:
listener:]::$_0>, void (firebase::firestore::util::StatusOr<firebase::firestore::core::
ViewSnapshot>)>::operator()(firebase::firestore::util::StatusOr<firebase::firestore::
core::ViewSnapshot>&&) + 425936 (functional:1720)
4 FirebaseFirestore … firebase::firestore::core::EventListener<firebase::firestore::core::ViewSnapshot>::Cr…
5 FirebaseFirestore … void std::__1::__invoke_void_return_wrapper<void>::__call<firebase::firestore::core::…
6 FirebaseFirestore … firebase::firestore::util::Task::ExecuteAndRelease() + 1053176 (task.cc:107)
7 libdispatch.dylib … _dispatch_client_callout + 20


Note that I’ve truncated the long lines where they’re not relevant (frames 7 through 4) but wrapped them where they are.

Frame 7 shows that this code is running as the result of something scheduling a block on a Dispatch queue. Frame 6 shows that this something is the third-party library you’re using (FirebaseFirestore). Frames 6 through 3 are code running inside that library. Frame 2 shows that the library has called out to your code. The thunk here indicates that the compiler has generated a small piece of adapter code to convert from Objective-C calling conventions to Swift calling conventions, so you really need to focus on frames 1 and 0. This relate to a closure within your retrieveData_static(…) method. Note that the crash report includes a source file and line number here, namely line 45 of DatabaseInterface.swift. You should look at that line to see if there’s any obvious reason why it might trap.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Dear Quinn,

Many thanks for your kind and insightful response, I’ll follow the steps you outlined to figure out where the crash may be. Would be helpful if I could reproduce it in Xcode or TestFlight but the app always runs there without issues. I may bother you again with a note in this thread if I get stuck!

Thanks again,

Manos
Unable to reproduce App Store Review Crashes
 
 
Q