iOS app crash - NSURLConnection+MPIntercept.m - ios

I'm struggling to debug a crash that's being reported repeatedly in Crashlytics. Here is a screenshot of the report. Seems that it's caused by Google Analytics (reporting the crash on the GAIThread) but not sure what steps I need to take to address this? I've been unable to reproduce the issue and not even sure what is triggering this.
Has anyone else had experience with EXC_BAD_ACCESS KERN_PROTECTION_FAILURE caused by GA or similar?

Former Crashlytics SDK maintainer here. Information might be stale - best to check in with them for latest information.
The crashtlyics SDK protects itself from infinite recursion (which can produce hundreds of thousands of frames) by truncating repeated frames after a certain threshold. To me, it looks like that's exactly what happened here. The crash occurred in a random function that just happened to be running when the stack overflowed.
What I would do is, first, make sure you have the latest version of this Google SDK. I then might check in with them to see if they know of any reason why that function might recurse. Or, perhaps some documentation covers those conditions and/or options that might affect it's behavior.

Related

Users experiencing crash related to Firestore Pod's internal grpc::ClientAsyncReaderWriter<grpc::ByteBuffer, grpc::ByteBuffer>::Finish

Users are getting this crash in testing. My first guess was that it's memory-related but I don't have much more to go off of than that. Looking deeper into the code, I thought this might have been a Main Thread issue but it looks like listeners are removed on a background thread, so I'm skeptical that that's the reason.
I thought that removing any active listeners when the app backgrounds and re-adding them when the app foregrounds might negate this crash but it doesn't seem to have helped.
Any advice on how to fix this crash? Thanks!
Edit: I left the simulator open for long enough and I got this, which is probably the same crash.
Edit 2: Profiling with the Leaks Instrument didn't turn up anything related to Firestore. It only had 7 small leaks related to Foundation and UIKit after the app closed
Looks like this was introduced in 0.15.0 – https://github.com/firebase/firebase-ios-sdk/issues/2138

Understanding Crashlytics Error Logs

I am using Crashlytics to track and fix crashes in my live app. However, I am not very knowledgeable on how to understand what the thread is telling me.
Usually on XCode, you get specific information regarding the error (such as, "unexpectedly found nil", etc.). Is there such information in a Crashlytics Dashboard? If not, how can I understand better what is causing the crash in the app?
Here is a picture of an example crash.
Thanks!
You error is inside cellForRowAtIndexPath. If I'm not mistaken, The blue labels are methods inside your classes.
And they work like a bread crumbs trail for all the processes that happened until the crash. 0 is the first interaction where N is the last method triggered before your app crashed.
But you must agreed with me that your problem probably isn't inside UIKit or Foundation methods, right?
Is that helpful?
If not, feel free to contact their support, they are really responsive!
Here is they're email: support#fabric.io

Disable generation of crash logs in iOS application

Is it possible to prevent an iOS application from generating crash logs? I have tried searching for relevant ways and options, but I could not find anything useful.
Yes, absolutely. It's very simple: Avoid bugs that crash your application. You can avoid these bugs by analysing crash logs and figuring out what caused those crashes.

How to debug syscall_thread_switch in iOS 8.3?

Since moving to iOS 8.3, I'm encountering this error where the main thread will get stuck in this call. A few other threads are also stuck in that call. There is none of my code in any thread that leads to this call, so I'm stumped as to why this is happening. It happens randomly, sometimes, when tapping a button bar item, sometimes while redrawing charts (using ShinobiCharts), etc.
Here is the stack trace from Xcode:
Anybody has any clue as to why this is happening and how to fix it? It's very annoying because when I get stuck there, I have to relaunch the app. Note that this is happening in the simulator so far. I'm in the early stage of developing this app and spend most of my time in the simulator. I haven't seen the error happening yet on a real device but, again, I haven't run the app that often on the device.
Knock on wood, but I think I figured it out (at least in my instance).
What led to the solution was a search for syscall_thread_switch, which led me to this answer here:
https://stackoverflow.com/a/30333203/978509
Which, if you look at the backtrace I linked (https://gist.github.com/Shalmezad/65ff89d20aa7e0a9d094), every syscall_thread_switch is preceded by OSSpinLockLockSlow, which the answer notes looks like Livelock, but due to the low CPU usage, is more evident of a deadlock.
Going through my code, I found that for every background task, I created a new dispatch_queue_t each time. I since redid how that works to use the same queue, which seems to have fixed the issue.
Without further information from nemesis (mainly some code snippets showing how he's setting up background tasks), I cannot answer their specific question, however this should point people in the right direction for fixing the issue.

iOS: signal SIGTRAP with no breakpoints?

I'm working on an iPad application and a recent change I made is causing the app to die with "signal SIGTRAP". The stack trace doesn't help and I can't pinpoint what part of the code is causing this to happen (but I do know which function it starts from).
Without going into details about the application I was wondering if there are some general tips for debugging this kind of thing (SIGTRAP)?
I've managed to narrow down which function call causes this to happen. The weird thing is that if I break and step into the function then it works fine. But if I let it run without a breakpoint then it crashes.
The function calls a bunch of other things which also involve asynchronous network connections. I put logs all over my code and all my logs print fine, so it seems something "under the hood" is causing this failure. I'm also using a 3rd party framework which may be causing this issue?
Is this even a code-related issue? I read somewhere that SIGTRAP is a debugger thing.
What causes this kind of crash and where should I be focusing my efforts to fix it?
Any help you can provide is greatly appreciated.
Thanks!

Resources