Interpreting iOS crash reports - ios

I'm experiencing multiple crashes where it appears that a native iOS method is calling functions from a third-party library. Here's an example:
Thread: Unknown Name (Crashed)
0 libsystem_kernel.dylib 0x33222350 __pthread_kill + 8 + 8
1 libsystem_c.dylib 0x3500f973 abort + 95 + 94
2 libsystem_c.dylib 0x34ff04d1 basename + 1
3 FireChat 0x00036489 -[OTOverlayButton drawRect:] + 1
4 Foundation 0x37a4a5a9 -[NSDictionary(NSKeyValueCoding) valueForKey:] + 33 + 32
5 FireChat 0x709d -[NetworkModel getUserForUid:] (NetworkModel.m:150)
6 FireChat 0x0001c42f -[OpenTokController session:didReceiveStream:] (OpenTokController.m:258)
7 libdispatch.dylib 0x32da011f _dispatch_call_block_and_release + 11 + 10
8 libdispatch.dylib 0x32d9f4b7 _dispatch_client_callout + 23 + 22
9 libdispatch.dylib 0x32da41bd _dispatch_main_queue_callback_4CF$VARIANT$mp + 225 + 224
10 CoreFoundation 0x37dbbf3b __CFRunLoopRun + 1291 + 1290
11 CoreFoundation 0x37d2eebd CFRunLoopRunSpecific + 357 + 356
12 CoreFoundation 0x37d2ed49 CFRunLoopRunInMode + 105 + 104
13 GraphicsServices 0x358e22eb GSEventRunModal + 75 + 74
14 UIKit 0x3a1b42f9 UIApplicationMain + 1121 + 1120
15 FireChat 0x43b3 main (main.m:8)
To me, it appears that the [NSDictionary valueForKey:] method is invoking [OTOverlayButton drawRect:] which comes from a third-party library. This shouldn't be possible -- am I reading the crash report wrong?
[OTOverlayButton drawRect:] isn't called anywhere in my code. Note that the dictionary contains (my) objects which contain pointers to objects from the third-party library.
The library vendor and I are both baffled.
Thanks.

I believe the cause of this crash was memory corruption resulting from calling performSelector: on a method that returned a struct. See this blog post for more details:
Why performSelector is more dangerous than I thought

Related

How can I interpret this stacktrace

I am seeing some crashes that I cannot properly read.
Background: The app has a react native part. Below the regular react native objc code with some additional modules. The there is lot of custom objc and swift code. And on the very bottom we have a c/c++ engine doing their voodoo.
Note: Those stack traces are taken from Firebase / Crashlytics. Are these logs looking like DSYM files are missing? Or am I just not able to read them?
First stacktrace
Crashed: com.apple.main-thread
0 Objc/C++Part 0x104052a6c Engine::setTask(Task const*) + 408
1 SwiftPart 0x102dc14a8 __swift_memcpy2_1 + 3268
2 SwiftPart 0x102d89c2c globalinit_33_D059BB15480DF7E417659EA3E0158837_func83 + 2880
3 SwiftPart 0x102dc6a28 globalinit_33_164233930FF8443B67F99609B74287FF_func109 + 496
4 SwiftPart 0x102dc2ff4 globalinit_33_F9D0611596767A886B653DD36AB555FE_func108 + 2208
5 Foundation 0x196131050 __NSFireTimer + 64
6 CoreFoundation 0x195cc5e00 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
7 CoreFoundation 0x195cc5b3c __CFRunLoopDoTimer + 880
8 CoreFoundation 0x195cc520c __CFRunLoopDoTimers + 276
9 CoreFoundation 0x195cc0348 __CFRunLoopRun + 1920
10 CoreFoundation 0x195cbf8a0 CFRunLoopRunSpecific + 464
11 GraphicsServices 0x19fc17328 GSEventRunModal + 104
12 UIKitCore 0x199db0740 UIApplicationMain + 1936
13 MainApplication 0x1023390e4 main + 16 (main.m:16)
14 libdyld.dylib 0x195b4a360 start + 4
What does the line 2 SwiftPart 0x102d89c2c globalinit_33_D059BB15480DF7E417659EA3E0158837_func83 + 2880 mean for example? How can I find out what line Engine::setTask(Task const*) + 408 exactly means?
Second stacktrace
Crashed: com.apple.main-thread
0 libswiftCore.dylib 0x1aba7b440 swift_isUniquelyReferenced_nonNull_native + 34
1 MainApplication 0x100bb6f60 thunk for #escaping #callee_guaranteed () -> () + 4309315424 (<compiler-generated>:4309315424)
2 libdispatch.dylib 0x19e18b7dc _dispatch_block_async_invoke2 + 104
3 libdispatch.dylib 0x19e1d9184 _dispatch_client_callout + 16
4 libdispatch.dylib 0x19e18b190 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1044
5 CoreFoundation 0x19e48a5e4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
6 CoreFoundation 0x19e4855d8 __CFRunLoopRun + 2004
7 CoreFoundation 0x19e484adc CFRunLoopRunSpecific + 464
8 GraphicsServices 0x1a840a328 GSEventRunModal + 104
9 UIKitCore 0x1a257fae0 UIApplicationMain + 1936
10 MainApplication 0x100b310e4 main + 16 (main.m:16)
11 libdyld.dylib 0x19e30e360 start + 4
Same here. How to read this?

App is getting crashed on app launch in iOS 13 beta version

Here is the crash report and the crash is only happening on iOS 13 beta version :-
Crashed: com.apple.main-thread
0 libsystem_pthread.dylib 0x1ae056484 pthread_get_qos_class_np + 8
1 Foundation 0x1ae664340 -[NSThread qualityOfService] + 80
2 Foundation 0x1ae626ebc -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] + 280
3 Foundation 0x1ae628df8 -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:] + 116
4 libAXSpeechManager.dylib 0x1d0176884 -[AXSpeechManager isSpeaking] + 112
5 libAXSpeechManager.dylib 0x1d0171b60 -[AXSpeechManager _didBeginInterruption] + 52
6 libAXSpeechManager.dylib 0x1d0171f1c -[AXSpeechManager _handleAudioInterruption:] + 504
7 CoreFoundation 0x1ae2929ac __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
8 CoreFoundation 0x1ae2929f4 ___CFXRegistrationPost1_block_invoke + 64
9 CoreFoundation 0x1ae291d54 _CFXRegistrationPost1 + 368
10 CoreFoundation 0x1ae291a20 ___CFXNotificationPost_block_invoke + 104
11 CoreFoundation 0x1ae20dd38 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1416
12 CoreFoundation 0x1ae291370 _CFXNotificationPost + 1244
13 Foundation 0x1ae5edcf8 -[NSNotificationCenter postNotificationName:object:userInfo:] + 60
14 AVFAudio 0x1bac4603c -[AVAudioSession privateInterruptionWithInfo:] + 988
15 AVFAudio 0x1bac4880c (anonymous namespace)::HandlePropertyListenerCallback(unsigned int, objc_selector*, NSObject*) + 68
16 libdispatch.dylib 0x1ae004658 _dispatch_call_block_and_release + 24
17 libdispatch.dylib 0x1ae0051cc _dispatch_client_callout + 16
18 libdispatch.dylib 0x1adfe83e0 _dispatch_main_queue_callback_4CF$VARIANT$armv81 + 996
19 CoreFoundation 0x1ae2b4c74 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
20 CoreFoundation 0x1ae2afc68 __CFRunLoopRun + 2004
21 CoreFoundation 0x1ae2af16c CFRunLoopRunSpecific + 464
22 GraphicsServices 0x1b80d9328 GSEventRunModal + 104
23 UIKitCore 0x1b2317f6c UIApplicationMain + 1936
24 Quickride 0x10086803c main + 37 (AppDelegate.swift:37)
25 libdyld.dylib 0x1ae13a424 start + 4
I have checked on various platforms for this issue. But have not found any solution related to it.Please provide any solution related to it.
It is crashing on app launch itself and this is the report it shows on fabric
I've the same issue on iOS 13 and it's my most serious crash on Crashlytics.
It occurs only in iOS 13 and above. Unfortunately also in the latest 13.1.2.
Starting by the iOS 13 release I've detected a strange warning when I put my app in background the debug console print Can't end BackgroundTask: no background task exists with identifier x, or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.
Maybe the issues are related.

iOS Keyboard Extension crash before any of my code runs

I have been getting crash reports like this for a keyboard extension I have developed and am either confused about how to read the stack trace or why it is occurring or both and I was hoping someone could help me clear this up.
Below is the stack trace:
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0xd15db9df
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x37949f66 objc_msgSend + 5
1 UIKit 0x2cd57f05 -[_UIViewControllerTransitionContext completeTransition:] + 52
2 UIKit 0x2d10ac1f __95-[_UIWindowAnimationController _performLayoutAnimationWithContext:windowGeometryUpdatingBlock:]_block_invoke88 + 26
3 UIKit 0x2cc7b8e1 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 308
4 UIKit 0x2cc7b4f9 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 184
5 UIKit 0x2cc7b40f -[UIViewAnimationState animationDidStop:finished:] + 70
6 QuartzCore 0x2c660fe7 CA::Layer::run_animation_callbacks(void*) + 234
7 libdispatch.dylib 0x37ecdc6f _dispatch_client_callout + 22
8 libdispatch.dylib 0x37ed9553 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1322
9 CoreFoundation 0x295ac889 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
10 CoreFoundation 0x295aafa9 __CFRunLoopRun + 1512
11 CoreFoundation 0x294f69a1 CFRunLoopRunSpecific + 476
12 CoreFoundation 0x294f67b3 CFRunLoopRunInMode + 106
13 GraphicsServices 0x30e911a9 GSEventRunModal + 136
14 UIKit 0x2cca7635 UIApplicationMain + 1440
15 libxpc.dylib 0x3806f9e3 _xpc_objc_main + 706
16 libxpc.dylib 0x38071009 xpc_main + 168
17 Foundation 0x2a3ec289 service_connection_handler + 162
18 PlugInKit 0x32c5ff75 -[PKService run] + 508
19 PlugInKit 0x32c5fc4b +[PKService main] + 58
20 PlugInKit 0x32c5ffa9 +[PKService _defaultRun:arguments:] + 20
21 libextension.dylib 0x371b60c5 NSExtensionMain + 48
22 libdyld.dylib 0x37f0baaf start + 2
In the left column where it lists the libraries (correct term?) I don't see any reference to my code. In other crash logs there is always some reference to a class in my app or something but I don't see that in this one. What does that mean? Is the crash occurring before my code executes and this is an Apple issue I can ignore?
It's an Apple Bug. The keyboard extension I work on has a nearly identical crash report. Fortunately, this only seems to happen on iOS 8, though I have seen a similar one that affects iOS 9.
I would file a bug report with Apple, and include a copy of the stack trace.

How to understand IOS trace logs

How to understand a trace from an IOS application
top to bottom (or) bottom to top
0 libobjc.A.dylib 0x0000000195b77bc8 objc_msgSend + 4
1 Foundation 0x0000000184edfc84 _NSDescriptionWithStringProxyFunc + 68
2 CoreFoundation 0x0000000183fa9b50 __CFStringAppendFormatCore + 6948
3 CoreFoundation 0x0000000183fa7ff0 _CFStringCreateWithFormatAndArgumentsAux2 + 244
4 CoreFoundation 0x0000000183fc59dc _CFLogvEx2 + 148
5 Foundation 0x0000000184dff660 NSLogv + 104
6 Foundation 0x0000000184dff5e8 NSLog + 20
7 My Mobile 0x00000001005819b0 -[MySDK didFailWithError:] + 272
8 My Mobile 0x00000001005d3974 -[MyServiceManager validate:didFailWithError:] + 1200
9 My Mobile 0x00000001005bb20c __60-[MyHttpCliebt validate]_block_invoke110 + 528
10 MyTIM Mobile 0x00000001005c2ca8 __84-[AFHTTPSessionManager dataTaskWithHTTPMethod:URLString:parameters:success:failure:]_block_invoke87 + 160
11 My Mobile 0x00000001005a7ef0 __72-[AFURLSessionManagerTaskDelegate URLSession:task:didCompleteWithError:]_block_invoke + 220
12 libdispatch.dylib 0x00000001961e1994 _dispatch_call_block_and_release + 20
13 libdispatch.dylib 0x00000001961e1954 _dispatch_client_callout + 12
14 libdispatch.dylib 0x00000001961e620c _dispatch_main_queue_callback_4CF + 1604
15 CoreFoundation 0x0000000183f97544 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
16 CoreFoundation 0x0000000183f955ec __CFRunLoopRun + 1488
17 CoreFoundation 0x0000000183ec0f74 CFRunLoopRunSpecific + 392
18 GraphicsServices 0x000000018d7f36fc GSEventRunModal + 164
19 UIKit 0x0000000188ac2d94 UIApplicationMain + 1484
20 MyTIM Mobile 0x00000001000de4a0 main (main.m:12)
21 libdyld.dylib 0x000000019620ea08 start + 0
Please help me in identifying where the problem actually starts, is it starts at AFURLSessionManagerTaskDelegate (or) MySDK ?
Which is causing the issue, is NSLog causing issue ? or blocks and threads causing this issue?
How to analyze a crash report is described in Technical Note TN2151.

Interpreting a TestFlight crash report

I just made some updates to my app, and have been seeing some new crash reports in TestFlight that I can't find much information on online. Can anyone help me interpret what's going on here? It's happening in different places throughout my app, so I don't think it's related to one specific function...
0 MyApp 0x000832b6 testflight_backtrace + 238
1 MyApp 0x00083fa0 TFSignalHandler + 264
2 libsystem_c.dylib 0x35e2be92 _sigtramp + 42
3 libdispatch.dylib 0x3a3c611e _dispatch_call_block_and_release + 10
4 libdispatch.dylib 0x3a3c611e _dispatch_call_block_and_release + 10
5 libdispatch.dylib 0x3a3c54b6 _dispatch_client_callout + 22
6 libdispatch.dylib 0x3a3ca1bc _dispatch_main_queue_callback_4CF$VARIANT$mp + 224
7 CoreFoundation 0x38739f3a __CFRunLoopRun + 1290
8 CoreFoundation 0x386acebc CFRunLoopRunSpecific + 356
9 CoreFoundation 0x386acd48 CFRunLoopRunInMode + 104
10 GraphicsServices 0x36c5d2ea GSEventRunModal + 74
11 UIKit 0x39e7a2f8 UIApplicationMain + 1120
12 MyApp 0x0003078a main (main.m:16)
13 MyApp 0x0003073f start + 39

Resources