Crash after block release, but thread stack trace doesn't hint anything

We have a mysterious crash which is reported only on BugSnag

StackTrace:
Code Block
EXC_BAD_ACCESS · Attempted to dereference garbage pointer 0x20.
0libobjc.A.dylib_objc_release
1libsystem_blocks.dylibBlock_release
2libdispatch.dylibdispatch_client_callout
3libdispatch.dylibdispatch_continuation_pop$VARIANT$armv81
4libdispatch.dylibdispatch_source_invoke$VARIANT$armv81
5libdispatch.dylibdispatch_lane_serial_drain$VARIANT$armv81
6libdispatch.dylibdispatch_lane_invoke$VARIANT$armv81
7libdispatch.dylibdispatch_workloop_worker_thread
8libsystem_pthread.dylibpthread_wqthread


I wonder what I should look for in Threads section?
Do you have any generic clue?

These problems are often caused by a memory management bug. As I’m sure you’re aware, blocks capture state from their surrounding scope. This will increment the reference count on any captured objects. When the block gets deallocated, it releases those references. If something has corrupted memory in the meantime, you’ll crash like this.

Tracking down problems like this from a crash report is tricky. The place I’d start is running your app under the standard memory debugging tools to see if that can reproduce the problem in your office.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
Crash after block release, but thread stack trace doesn't hint anything
 
 
Q