Why is a reboot required to send the crash log to iOS?

Using a dedicated crash reporting system (for example, specialized in Ask the user to send the crash log to the iPhone ), to send the log, the application must restart. What for? Is there no way to send it during custom exception handling? Or is there a crash reporting system that doesn't require an application restart?

+3


source to share


2 answers


When the application crashes, it is in a very unstable state. Thus, the crash reporting library cannot do anything, as even allocating memory during a crash can do more damage. Thus, the Crash Reporting SDK can use the so called asynchronous C method to collect all crash data. Any Objective-C code also cannot be processed, nor can the iOS networking stack be used.

Also note that exceptions are just one example of application crashes in Objective-C, and crashes caused by low-level BSD signals also occur. Both types mean that the application is in an extremely insecure and unstable state, and at a minimum, the code must be called during a crash.

This would require rewriting most networking frameworks to be able to send data during a crash, and it might not even be possible to do it in a secure way. This is why all the proper SDK crash reports do nothing of the sort.



Also, on iOS, it is not possible to create another process that could send data in the background, so the only safe and feasible solution is to send the data the next time the app is launched.

We now have another takeaway that crashes that occur at the start of an application launch will never be dispatched from the moment the application crashed until or during dispatch. Several SDKs provide mechanisms to handle this scenario, which most likely require changes to your application startup code.

+5


source


Since you disabled the application, the control process is not working, so you cannot start a new process to send the report. Any code in the crash handler has a limited amount of time to retain what ever caused you to crash the application before iOS kills the entire application and removes it from memory.



When you restart the application, the Crash Reporter formats the crash report and sends it. This can only be disabled when the app is active.

+3


source







All Articles