Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,11 @@ pid_t readPIDFromPeer(int socket)
if (ret == -1)
g_error("readPIDFromPeer: Failed to read pid from PID socket: %s", g_strerror(errno));

if (ret == 0) {
// Peer died before sending PID (e.g. SIGTERM during container teardown).
return 0;
}

if (message.msg_controllen <= 0)
g_error("readPIDFromPeer: Unexpected short read from PID socket");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,13 @@ void ProcessLauncher::launchProcess()
g_error("Failed to read pid from child process");

m_processID = IPC::readPIDFromPeer(g_socket_get_fd(pidSocket.get()));
RELEASE_ASSERT(m_processID);
if (!m_processID) {
m_socketMonitor.stop();
close(m_pidServerSocket);
m_pidServerSocket = -1;
didFinishLaunchingProcess(0, IPC::Connection::Identifier { });
return G_SOURCE_REMOVE;
}

m_socketMonitor.stop();

Expand Down