Bug 182166
| Summary: | ServicesController::refreshExistingServices invokes NSSharingService sharingServicesForItems in a background thread | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> |
| Component: | WebKit2 | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED WONTFIX | ||
| Severity: | Normal | CC: | beidson, mitz, thorton, wenson_hsieh |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Ryosuke Niwa
NSSharingService sharingServicesForItems calls into AppKit so can't be called in a background thread but we're doing that in ServicesController::refreshExistingServices
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Ryosuke Niwa
Main Thread Checker: UI API called on a background thread: -[NSCell image]
PID: 33220, TID: 7447672, Thread name: (none), Queue name: com.apple.WebKit.ServicesController, QoS: 0
Backtrace:
4 ShareKit 0x00007fff600a7d16 __72+[SHKSandbox filteredItemsFromAttributedString:processWithPID:textView:]_block_invoke + 348
5 Foundation 0x00007fff4165a6ca -[NSAttributedString enumerateAttribute:inRange:options:usingBlock:] + 397
6 ShareKit 0x00007fff600a7a59 +[SHKSandbox filteredItemsFromAttributedString:processWithPID:textView:] + 421
7 ShareKit 0x00007fff600a6759 +[SHKSandbox filteredItemsFromSingleItem:processWithPID:] + 218
8 ShareKit 0x00007fff600a65b3 +[SHKSandbox filteredItemsFromItems:processWithPID:] + 439
9 ShareKit 0x00007fff600a06ad +[SHKSharingService sharingServicesForItems:mask:invokedByPicker:] + 249
10 AppKit 0x00007fff3cb1a3fa +[NSSharingService sharingServicesForItems:mask:] + 67
11 WebKit 0x00000001050fe7fa _ZN6WebKitL29hasCompatibleServicesForItemsEP7NSArray + 42
12 WebKit 0x00000001050fe70f ___ZN6WebKit18ServicesController23refreshExistingServicesEb_block_invoke + 495
13 libdispatch.dylib 0x000000010962ec3d _dispatch_call_block_and_release + 12
14 libdispatch.dylib 0x0000000109626d1f _dispatch_client_callout + 8
15 libdispatch.dylib 0x000000010963cbac _dispatch_queue_serial_drain + 1169
16 libdispatch.dylib 0x000000010962e790 _dispatch_queue_invoke + 322
17 libdispatch.dylib 0x000000010963dfbb _dispatch_root_queue_drain_deferred_wlh + 785
18 libdispatch.dylib 0x0000000109642e94 _dispatch_workloop_worker_thread + 892
19 libsystem_pthread.dylib 0x00000001096a302b _pthread_wqthread + 980
20 libsystem_pthread.dylib 0x00000001096a2c45 start_wqthread + 13
mitz
This is done because calling it on the main thread caused noticeable delays. The API was made safe to call on a background thread via <rdar://problem/18139613> but has since regressed. Fixing the regression is tracked in <rdar://problem/32116152> and others.
mitz
And this is <rdar://problem/31798317>
Tim Horton
Right, what Dan said.