I need help solving a problem where I experience an occasional EXC_BAD_ACCESS crash that occurs in the CoreMotion. Most of them happened in foreground and it's not easy to reproduce the bug.
The following is the call trace:
Thread : Crashed: Thread
0 libobjc.A.dylib 0x19618bbd0 objc_msgSend + 16
1 CoreMotion 0x184d90538 (null)
2 CoreFoundation 0x18445bfc8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
3 CoreFoundation 0x18445b0d0 __CFRunLoopDoBlocks + 312
4 CoreFoundation 0x1844592d0 __CFRunLoopRun + 696
5 CoreFoundation 0x184384f74 CFRunLoopRunSpecific + 396
6 CoreFoundation 0x1843d6ffc CFRunLoopRun + 112
7 CoreMotion 0x184d90234 (null)
8 libsystem_pthread.dylib 0x1969d7db8 _pthread_body + 164
9 libsystem_pthread.dylib 0x1969d7d14 _pthread_body
After analysing I found that some private apis called before the crash.
2 CoreMotion 0x1851285dc CLMotionCore::executeBlockOnMotionThread(void () block_pointer) + 156
3 CoreMotion 0x1851144e8 -[CMMotionManager willResignActive:] + 76
Does anybody have an idea of what could possibly be happening or what should I do to solve it? Thanks!