I've been hitting my head against the wall with a strange (to me) EXC_BAD_ACCESS crash and I was wondering if any of you could help.
The short of it is I'm taking raw email data, scanning what I need, and then sending it up to Firebase. This all happens through several function calls. The initial function call is made inside of a `dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND,0)){...}` block. If I put it on the main queue crash doesn't happen. Currently, I've made the crash stop by putting the to-Firebase function on the background a second time. Obviously this is not a real solution, but I am stumped as to what the problem or type of problem could be.
The crash always seems to happen at the top of whatever function the problematic code is in. I consoldiated all the code into the dispatch_async block and the EXC_BAD_ACCESS happened at the very first line.
Sometimes it looks like it happens on an NSDateFormatter singleton.
It's currently still in Swift 2.3.