Bug 159301 - [iOS] WebContent processes do not exit promptly
Summary: [iOS] WebContent processes do not exit promptly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-06-30 09:05 PDT by Chris Dumez
Modified: 2016-08-18 15:28 PDT (History)
9 users (show)

See Also:


Attachments
WIP Patch (6.44 KB, patch)
2016-06-30 09:14 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (8.19 KB, patch)
2016-06-30 14:25 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (17.21 KB, patch)
2016-06-30 15:21 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (17.92 KB, patch)
2016-06-30 15:50 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (17.92 KB, patch)
2016-06-30 16:09 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews106 for mac-yosemite-wk2 (575.59 KB, application/zip)
2016-06-30 16:33 PDT, Build Bot
no flags Details
Patch (18.00 KB, patch)
2016-06-30 16:38 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (18.00 KB, patch)
2016-06-30 17:51 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-06-30 09:05:23 PDT
WebContent processes do not exit promptly, they hang around for 10 seconds until the watchdog forcefully calls exit().
Comment 1 Chris Dumez 2016-06-30 09:05:42 PDT
<rdar://problem/26965488>
Comment 2 Chris Dumez 2016-06-30 09:14:24 PDT
Created attachment 282445 [details]
WIP Patch
Comment 3 Chris Dumez 2016-06-30 09:23:16 PDT
Comment on attachment 282445 [details]
WIP Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=282445&action=review

> Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:76
> +                xpc_object_t leakedReplyForBoosting = xpc_dictionary_create_reply(event);

Sadly, this does not appear to work in practice. While it no longer prevents XPC exit, the WebContent process no longer gets boosted either :/
Comment 4 Chris Dumez 2016-06-30 14:25:58 PDT
Created attachment 282465 [details]
Patch
Comment 5 Chris Dumez 2016-06-30 15:21:14 PDT
Created attachment 282474 [details]
Patch
Comment 6 Chris Dumez 2016-06-30 15:22:18 PDT
Updated based on offline review feedback from Anders. It fixes the issue and is a bit nicer now.
Comment 7 Chris Dumez 2016-06-30 15:50:30 PDT
Created attachment 282482 [details]
Patch
Comment 8 Chris Dumez 2016-06-30 16:09:59 PDT
Created attachment 282488 [details]
Patch
Comment 9 Build Bot 2016-06-30 16:33:39 PDT
Comment on attachment 282488 [details]
Patch

Attachment 282488 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/1603188

Number of test failures exceeded the failure limit.
Comment 10 Build Bot 2016-06-30 16:33:44 PDT
Created attachment 282490 [details]
Archive of layout-test-results from ews106 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 11 Chris Dumez 2016-06-30 16:38:17 PDT
Created attachment 282491 [details]
Patch
Comment 12 Chris Dumez 2016-06-30 16:44:49 PDT
Comment on attachment 282491 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=282491&action=review

> Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:84
> +    parameters.priorityBoostMessage = priorityBoostMessage ? adoptOSObject(xpc_retain(priorityBoostMessage)) : nullptr;

The crashes on the Mac bots were because we only use priority boosting for the NetworkProcess on Mac. Therefore, for other processes would have a null priorityBoostMessage and calling xpc_retain() on nullptr crashes. I added a null check here.

> Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:74
> +                if (priorityBoostMessage)

Also added a null check to avoid calling xlc_release() on null.
Comment 13 Chris Dumez 2016-06-30 17:51:08 PDT
Created attachment 282495 [details]
Patch
Comment 14 Chris Dumez 2016-06-30 18:30:13 PDT
Comment on attachment 282495 [details]
Patch

Clearing flags on attachment: 282495

Committed r202723: <http://trac.webkit.org/changeset/202723>
Comment 15 Chris Dumez 2016-06-30 18:30:19 PDT
All reviewed patches have been landed.  Closing bug.