How to find the root cause of Crashed: com.apple.main-thread in a production application?

I have a report from Crashlytics:

Thread : Crashed: com.apple.main-thread 0 libobjc.A.dylib 0x000000019503fbd0 objc_msgSend + 16 1 CoreFoundation 0x00000001836e5458 CFRelease + 524 2 CoreFoundation 0x00000001836f1a18 -[__NSArrayM dealloc] + 152 3 libobjc.A.dylib 0x0000000195045724 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 564 4 CoreFoundation 0x00000001836e9074 _CFAutoreleasePoolPop + 28 5 Foundation 0x000000018461a588 -[NSAutoreleasePool release] + 148 6 UIKit 0x00000001882b4460 -[UIApplication _run] + 588 7 UIKit 0x00000001882aefac UIApplicationMain + 1488 

Is there anything I can do to catch such a problem? This happens on client devices, so I have no way to play it.

+6
source share
3 answers

Here was the answer: objc_msgSend [__NSArrayM dealloc] crash report sometimes from Crashlytics

Basically, upgrade your Crashlytics framework to version 3.0.9. The accident occurred in the structure of the crash reports.

0
source

For crashes like this, if the crash is reproducible, include NSZombies in the project environment variables. This will keep the freed objects alive (zombies), and when one of them is sent to the message, the caller and the message will be recorded on the emergency object.

Disable it when done, as it may lock the application memory due to objects not being freed up to track zombies.

0
source

Part of the logic code must run in the background. You should try debugging where the code is an error and then add this code

 DispatchQueue.main.async(execute: { // your code }) 
0
source

Source: https://habr.com/ru/post/989163/


All Articles