A new instance of CMMotionManager results in a Thread Checker warning

Originator:futuretap
Number:rdar://46210367 Date Originated:22-Nov-2018 10:46 AM
Status:Duplicate/31658500/Closed Resolved:
Product:iOS + SDK Product Version:12.1
Classification:Serious Bug Reproducible:Always
 
Summary:
This is a duplicate of radar #45003816. We encounter the same issue when using UIInterpolatingMotionEffect. The Main Thread Checker kicks in on an iPhone XS@12.1. 
iPhone X@12.1.1, iPhone 6s@11.4.1, iPhone 6s Plus@11.4.1 all work fine so it seems to depend on the new hardware.



Creating a new instance of CMMotionManager always results in a Thread Checker exception


Steps to Reproduce:
Instantiate a new CMMotionManager in the main thread:
      let motion = CMMotionManager()

Expected Results:
No exception is raised

Actual Results:
The thread checker kicks in:
```
Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 9123, TID: 1958556, Thread name: com.apple.CoreMotion.MotionThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4   libobjc.A.dylib                     0x00000002079d7894 <redacted> + 56
5   CoreMotion                          0x000000020e2387a4 CoreMotion + 305060
6   CoreMotion                          0x000000020e238cd8 CoreMotion + 306392
7   CoreMotion                          0x000000020e238be8 CoreMotion + 306152
8   CoreMotion                          0x000000020e26a3cc CoreMotion + 508876
9   CoreMotion                          0x000000020e26a42c CoreMotion + 508972
10  CoreFoundation                      0x0000000208770888 <redacted> + 28
11  CoreFoundation                      0x000000020877016c <redacted> + 276
12  CoreFoundation                      0x000000020876af54 <redacted> + 1016
13  CoreFoundation                      0x000000020876a844 CFRunLoopRunSpecific + 452
14  CoreFoundation                      0x000000020876b5a8 CFRunLoopRun + 84
15  CoreMotion                          0x000000020e269d64 CoreMotion + 507236
16  libsystem_pthread.dylib             0x00000002083e5a04 <redacted> + 132
17  libsystem_pthread.dylib             0x00000002083e5960 _pthread_start + 52
18  libsystem_pthread.dylib             0x00000002083eddf4 thread_start + 4
2018-10-04 12:09:35.737994+0200 test[9123:1958556] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 9123, TID: 1958556, Thread name: com.apple.CoreMotion.MotionThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
```

Version/Build:
iOS 12
Xcode Version 10.0 (10A255)

Version:
12.1

Notes:

Comments

Happening for me as well, lot of things getting impacted, and yeah only happens on XS, XS Max, and XR

By jchaudhry at May 6, 2019, 11:36 p.m. (reply...)

This issue still happens. Should I file yet another bug report with Apple?

Any update on this issue, seems like this is massively impacting a lot of projects


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!