Changeset 233939 in webkit
- Timestamp:
- Jul 18, 2018 4:13:36 PM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r233932 r233939 1 2018-07-18 Chris Dumez <cdumez@apple.com> 2 3 WebContent crash in WebProcess::ensureNetworkProcessConnection 4 https://bugs.webkit.org/show_bug.cgi?id=187791 5 <rdar://problem/41995022> 6 7 Reviewed by Ryosuke Niwa. 8 9 If the WebProcessProxy::GetNetworkProcessConnection synchronous IPC between the WebProcess 10 and the UIProcess succeeded but we received an invalid connection identifier, then try 11 once more. This may indicate the network process has crashed, in which case it will be 12 relaunched. 13 14 * WebProcess/WebProcess.cpp: 15 (WebKit::getNetworkProcessConnection): 16 (WebKit::WebProcess::ensureNetworkProcessConnection): 17 1 18 2018-07-18 Per Arne Vollan <pvollan@apple.com> 2 19 -
trunk/Source/WebKit/WebProcess/WebProcess.cpp
r233784 r233939 1098 1098 } 1099 1099 1100 static IPC::Connection::Identifier getNetworkProcessConnection(IPC::Connection& connection) 1101 { 1102 IPC::Attachment encodedConnectionIdentifier; 1103 if (!connection.sendSync(Messages::WebProcessProxy::GetNetworkProcessConnection(), Messages::WebProcessProxy::GetNetworkProcessConnection::Reply(encodedConnectionIdentifier), 0, Seconds::infinity(), IPC::SendSyncOption::DoNotProcessIncomingMessagesWhenWaitingForSyncReply)) { 1104 #if PLATFORM(GTK) || PLATFORM(WPE) 1105 // GTK+ and WPE ports don't exit on send sync message failure. 1106 // In this particular case, the network process can be terminated by the UI process while the 1107 // Web process is still initializing, so we always want to exit instead of crashing. This can 1108 // happen when the WebView is created and then destroyed quickly. 1109 // See https://bugs.webkit.org/show_bug.cgi?id=183348. 1110 exit(0); 1111 #else 1112 CRASH(); 1113 #endif 1114 } 1115 1116 #if USE(UNIX_DOMAIN_SOCKETS) 1117 return encodedConnectionIdentifier.releaseFileDescriptor(); 1118 #elif OS(DARWIN) 1119 return encodedConnectionIdentifier.port(); 1120 #elif OS(WINDOWS) 1121 return encodedConnectionIdentifier.handle(); 1122 #else 1123 ASSERT_NOT_REACHED(); 1124 return IPC::Connection::Identifier(); 1125 #endif 1126 } 1127 1100 1128 NetworkProcessConnection& WebProcess::ensureNetworkProcessConnection() 1101 1129 { … … 1104 1132 // If we've lost our connection to the network process (e.g. it crashed) try to re-establish it. 1105 1133 if (!m_networkProcessConnection) { 1106 IPC::Attachment encodedConnectionIdentifier; 1107 1108 if (!parentProcessConnection()->sendSync(Messages::WebProcessProxy::GetNetworkProcessConnection(), Messages::WebProcessProxy::GetNetworkProcessConnection::Reply(encodedConnectionIdentifier), 0, Seconds::infinity(), IPC::SendSyncOption::DoNotProcessIncomingMessagesWhenWaitingForSyncReply)) { 1109 #if PLATFORM(GTK) || PLATFORM(WPE) 1110 // GTK+ and WPE ports don't exit on send sync message failure. 1111 // In this particular case, the network process can be terminated by the UI process while the 1112 // Web process is still initializing, so we always want to exit instead of crashing. This can 1113 // happen when the WebView is created and then destroyed quickly. 1114 // See https://bugs.webkit.org/show_bug.cgi?id=183348. 1115 exit(0); 1116 #else 1117 CRASH(); 1118 #endif 1119 } 1120 1121 #if USE(UNIX_DOMAIN_SOCKETS) 1122 IPC::Connection::Identifier connectionIdentifier = encodedConnectionIdentifier.releaseFileDescriptor(); 1123 #elif OS(DARWIN) 1124 IPC::Connection::Identifier connectionIdentifier(encodedConnectionIdentifier.port()); 1125 #elif OS(WINDOWS) 1126 IPC::Connection::Identifier connectionIdentifier(encodedConnectionIdentifier.handle()); 1127 #else 1128 ASSERT_NOT_REACHED(); 1129 #endif 1134 IPC::Connection::Identifier connectionIdentifier = getNetworkProcessConnection(*parentProcessConnection()); 1135 1136 // Retry once if the IPC to get the connectionIdentifier succeeded but the connectionIdentifier we received 1137 // is invalid. This may indicate that the network process has crashed. 1138 if (!IPC::Connection::identifierIsValid(connectionIdentifier)) 1139 connectionIdentifier = getNetworkProcessConnection(*parentProcessConnection()); 1140 1130 1141 if (!IPC::Connection::identifierIsValid(connectionIdentifier)) 1131 1142 CRASH(); 1143 1132 1144 m_networkProcessConnection = NetworkProcessConnection::create(connectionIdentifier); 1133 1145 }
Note: See TracChangeset
for help on using the changeset viewer.