Anyone had experience diagnosing these crashes? I have a single user getting them consistently, and though I found an iOS related post, my app is not crashing on the same type of operation...
default-qos. overcommit" Periodic crashes are occurring in areas where a frequent number of dispatches to the Default QOS queue are occuring. A search about this identifier generally says that there are too many items submitted to this queue and that iOS will not run the method, and that it can lead to a crash.
EXC_BREAKPOINT (SIGTRAP) is a trace trap interrupted the process. It gives an attached debugger, if any, a chance to interrupt the process at a specific point in its execution.
Reason:
in iOS / tvOS there are queues / threads, each thread has its own type or priority also known as a "quality of service" or for short "QOS", which means the level of urgency that the cpu should handle this thread, the possibilities are:
once you run too many tasks at the same time in the same queue, then the OS notifies you that it cannot perform all this tasks at the same time in the same priority (there is a limit to the size of the stack for each queue), there for it says "OverCommit", which means you have over committed the queue (in your case the "Default-QOS" queue) and it exits since it cannot receive more tasks at this time and execute them at the fashion you want.
solution:
what you should do is first find the "dispatch_async" command that causes this crash, then use one of the other queues (it means expecting slower response then expected for that task),
usually developer don't think about it and simply use main queue which is the default priority / queue like this:
dispatch_async(dispatch_get_main_queue()) { // some task to perform print("This is my task") }
in order to fix this (if the app notifies you that you have overcommitted the main queue) is to change it to one of the other queues like this:
let qualityOfServiceClass = QOS_CLASS_BACKGROUND let backgroundQueue = dispatch_get_global_queue(qualityOfServiceClass, 0) dispatch_async(backgroundQueue, { // some task to perform print("This is my task") })
if you do not require a background (or parallel) execution, you can even ignore the dispatch_async command altogether and simply execute you commands like this:
// some task to perform print("This is my task")
Rewrite Shaybc's answer in Swift 3:
DispatchQueue.global(qos: .background).async { // some task to perform print("This is my task") })
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With