Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIKit work is done on the main thread #19

Open
orta opened this issue Mar 25, 2018 · 2 comments
Open

UIKit work is done on the main thread #19

orta opened this issue Mar 25, 2018 · 2 comments

Comments

@orta
Copy link
Collaborator

orta commented Mar 25, 2018

In Folio, which may have more things turned on - I get errors about doing UI work on a background thread. This could be the cause of some of our crashes. /cc @alloy

Main Thread Checker: UI API called on a background thread: -[UIView layer]
PID: 67828, TID: 2321153, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 21
Backtrace:
4   FolioDev                            0x00000001057cde2b -[ARTiledImageView drawRect:] + 107
5   UIKit                               0x00000001096ab1c5 -[UIView(CALayerDelegate) drawLayer:inContext:] + 487
6   QuartzCore                          0x000000010903e254 -[CALayer drawInContext:] + 267
7   QuartzCore                          0x0000000108f88764 _ZL18tiled_layer_renderP16_CAImageProviderjjjjPv + 1817
8   QuartzCore                          0x000000010901488e _ZL21CAImageProviderThreadPjb + 789
9   libdispatch.dylib                   0x000000010db8533d _dispatch_client_callout + 8
10  libdispatch.dylib                   0x000000010db8a251 _dispatch_queue_override_invoke + 1458
11  libdispatch.dylib                   0x000000010db91102 _dispatch_root_queue_drain + 772
12  libdispatch.dylib                   0x000000010db90da0 _dispatch_worker_thread3 + 132
13  libsystem_pthread.dylib             0x000000010e051169 _pthread_wqthread + 1387
14  libsystem_pthread.dylib             0x000000010e050be9 start_wqthread + 13

2018-03-25 14:42:35.225523-0400 FolioDev[67828:2321153] [reports] Main Thread Checker: UI API called on a background thread: -[UIView layer]
PID: 67828, TID: 2321153, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 21
Backtrace:
4   FolioDev                            0x00000001057cde2b -[ARTiledImageView drawRect:] + 107
5   UIKit                               0x00000001096ab1c5 -[UIView(CALayerDelegate) drawLayer:inContext:] + 487
6   QuartzCore                          0x000000010903e254 -[CALayer drawInContext:] + 267
7   QuartzCore                          0x0000000108f88764 _ZL18tiled_layer_renderP16_CAImageProviderjjjjPv + 1817
8   QuartzCore                          0x000000010901488e _ZL21CAImageProviderThreadPjb + 789
9   libdispatch.dylib                   0x000000010db8533d _dispatch_client_callout + 8
10  libdispatch.dylib                   0x000000010db8a251 _dispatch_queue_override_invoke + 1458
11  libdispatch.dylib                   0x000000010db91102 _dispatch_root_queue_drain + 772
12  libdispatch.dylib                   0x000000010db90da0 _dispatch_worker_thread3 + 132
13  libsystem_pthread.dylib             0x000000010e051169 _pthread_wqthread + 1387
14  libsystem_pthread.dylib             0x000000010e050be9 start_wqthread + 13
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIView bounds]
PID: 67828, TID: 2321098, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 21
Backtrace:
4   FolioDev                            0x00000001057ce3a8 -[ARTiledImageView drawRect:] + 1512
5   UIKit                               0x00000001096ab1c5 -[UIView(CALayerDelegate) drawLayer:inContext:] + 487
6   QuartzCore                          0x000000010903e254 -[CALayer drawInContext:] + 267
7   QuartzCore                          0x0000000108f88764 _ZL18tiled_layer_renderP16_CAImageProviderjjjjPv + 1817
8   QuartzCore                          0x000000010901488e _ZL21CAImageProviderThreadPjb + 789
9   libdispatch.dylib                   0x000000010db8533d _dispatch_client_callout + 8
10  libdispatch.dylib                   0x000000010db8a251 _dispatch_queue_override_invoke + 1458
11  libdispatch.dylib                   0x000000010db91102 _dispatch_root_queue_drain + 772
12  libdispatch.dylib                   0x000000010db90da0 _dispatch_worker_thread3 + 132
13  libsystem_pthread.dylib             0x000000010e051169 _pthread_wqthread + 1387
14  libsystem_pthread.dylib             0x000000010e050be9 start_wqthread + 13
@orta
Copy link
Collaborator Author

orta commented Mar 25, 2018

screen shot 2018-03-25 at 3 16 39 pm

Perhaps a later iOS allowed drawrect on a BG thread? Seems off to me

@alloy
Copy link

alloy commented Mar 26, 2018

Pretty sure that was never allowed, but looking at this stack trace it does appear to come out of legit call sites so kinda weird that it would invoke code on the wrong thread 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants