Bug 174065 - WebContent processes crash when the network process crashes with pending connection requests
Summary: WebContent processes crash when the network process crashes with pending conn...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-06-30 21:18 PDT by Ryosuke Niwa
Modified: 2017-07-03 12:47 PDT (History)
7 users (show)

See Also:


Attachments
Fixes the bug (21.43 KB, patch)
2017-06-30 21:46 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Patch for landing (21.58 KB, patch)
2017-07-03 11:50 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2017-06-30 21:18:56 PDT
When the network process crashes after a CreateNetworkConnectionToWebProcess is sent from UI process (in response to GetNetworkProcessConnection) but before the reply is provided, the originating WebContent process crashes inside ensureNetworkProcessConnection.

Here's one way to reproduce this crash:
1. Start two WebContent process A and B
2. Kill the network process
3. Load a new page in process A
4. Suspend the network process newly created in step 3 (kill -STOP pid)
5. Load a new page in process B
6. Kill the network process suspended in step 4
7. WebContent process B crashes.

In the actual crash happening in the field, step 4 is likely some sort of a spin or a delay in IPC. What’s important is the network process crasehs after process B requested a new network connection but before fulfilling the reply. In that case, networkProcessCrashedOrFailedToLaunch would simply return 0 in GetNetworkProcessConnection::DelayedReply, and this causes the originating WebContent process to crash inside ensureNetworkProcessConnection.
Comment 1 Ryosuke Niwa 2017-06-30 21:19:19 PDT
<rdar://problem/30359835>
Comment 2 Ryosuke Niwa 2017-06-30 21:46:32 PDT
Created attachment 314370 [details]
Fixes the bug
Comment 3 Ryosuke Niwa 2017-07-02 17:26:49 PDT
Ping reviewers.
Comment 4 Tim Horton 2017-07-03 11:46:27 PDT
Comment on attachment 314370 [details]
Fixes the bug

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

> Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h:78
> +- (pid_t)_networkProcessIdentifier;

Availability macros.
Comment 5 Ryosuke Niwa 2017-07-03 11:50:00 PDT
Created attachment 314504 [details]
Patch for landing
Comment 6 WebKit Commit Bot 2017-07-03 12:47:14 PDT
Comment on attachment 314504 [details]
Patch for landing

Clearing flags on attachment: 314504

Committed r219087: <http://trac.webkit.org/changeset/219087>
Comment 7 WebKit Commit Bot 2017-07-03 12:47:16 PDT
All reviewed patches have been landed.  Closing bug.