Skip to content
Permalink
Browse files
Reviewed by Darin Adler and Anders Carlsson.
        https://bugs.webkit.org/show_bug.cgi?id=53593
        <rdar://problem/8948380> Crash beneath HistoryController::recursiveSetProvisionalItem in web
        process (preceded by assertion failure) if UI process exits while
        Messages::WebPage::RestoreSessionAndNavigateToCurrentItem is being handled

        Can't test exiting the UI process.

        * Platform/CoreIPC/Connection.cpp: (CoreIPC::Connection::sendSyncMessage):
        * Platform/CoreIPC/Connection.h: (CoreIPC::Connection::Client::didFailToSendSyncMessage):
        Notify connection client when the connection fails to send a sync message.

        * WebProcess/WebProcess.cpp: (WebKit::WebProcess::didFailToSendSyncMessage):
        * WebProcess/WebProcess.h:
        Quit the web process immediately if it tried to send a sync message to a dead UI process.
        It never needs to continue and handle an unexpected null "reply".

        * PluginProcess/PluginProcess.cpp: (WebKit::PluginProcess::didFailToSendSyncMessage):
        * PluginProcess/PluginProcess.h:
        Ditto. There is no need for a plug-in to keep running even briefly if it couldn't get a
        reply to a sync message.



Canonical link: https://commits.webkit.org/68395@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@78392 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
aproskuryakov committed Feb 12, 2011
1 parent 2243f56 commit 2accec16e141e0b939bfde9274baa464fc208e74
@@ -1,3 +1,28 @@
2011-02-11 Alexey Proskuryakov <ap@apple.com>

Reviewed by Darin Adler and Anders Carlsson.

https://bugs.webkit.org/show_bug.cgi?id=53593
<rdar://problem/8948380> Crash beneath HistoryController::recursiveSetProvisionalItem in web
process (preceded by assertion failure) if UI process exits while
Messages::WebPage::RestoreSessionAndNavigateToCurrentItem is being handled

Can't test exiting the UI process.

* Platform/CoreIPC/Connection.cpp: (CoreIPC::Connection::sendSyncMessage):
* Platform/CoreIPC/Connection.h: (CoreIPC::Connection::Client::didFailToSendSyncMessage):
Notify connection client when the connection fails to send a sync message.

* WebProcess/WebProcess.cpp: (WebKit::WebProcess::didFailToSendSyncMessage):
* WebProcess/WebProcess.h:
Quit the web process immediately if it tried to send a sync message to a dead UI process.
It never needs to continue and handle an unexpected null "reply".

* PluginProcess/PluginProcess.cpp: (WebKit::PluginProcess::didFailToSendSyncMessage):
* PluginProcess/PluginProcess.h:
Ditto. There is no need for a plug-in to keep running even briefly if it couldn't get a
reply to a sync message.

2011-02-11 Anders Carlsson <andersca@apple.com>

Reviewed by Sam Weinig.
@@ -255,14 +255,18 @@ PassOwnPtr<ArgumentDecoder> Connection::sendSyncMessage(MessageID messageID, uin
// We only allow sending sync messages from the client run loop.
ASSERT(RunLoop::current() == m_clientRunLoop);

if (!isValid())
if (!isValid()) {
m_client->didFailToSendSyncMessage(this);
return 0;
}

// Push the pending sync reply information on our stack.
{
MutexLocker locker(m_syncReplyStateMutex);
if (!m_shouldWaitForSyncReplies)
if (!m_shouldWaitForSyncReplies) {
m_client->didFailToSendSyncMessage(this);
return 0;
}

m_pendingSyncReplies.append(PendingSyncReply(syncRequestID));
}
@@ -295,7 +299,10 @@ PassOwnPtr<ArgumentDecoder> Connection::sendSyncMessage(MessageID messageID, uin
}
}
}


if (!reply)
m_client->didFailToSendSyncMessage(this);

return reply.release();
}

@@ -90,6 +90,7 @@ class Connection : public ThreadSafeShared<Connection> {
public:
virtual void didClose(Connection*) = 0;
virtual void didReceiveInvalidMessage(Connection*, MessageID) = 0;
virtual void didFailToSendSyncMessage(Connection*) { }
};

#if PLATFORM(MAC)
@@ -111,6 +111,13 @@ void PluginProcess::didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::Mess
{
}

void PluginProcess::didFailToSendSyncMessage(CoreIPC::Connection*)
{
// We were making a synchronous call to a web process that doesn't exist any more.
// Callers are unlikely to be prepared for an error like this, so it's best to exit immediately.
exit(0);
}

void PluginProcess::initializePluginProcess(const PluginProcessCreationParameters& parameters)
{
ASSERT(!m_pluginModule);
@@ -65,6 +65,7 @@ class PluginProcess : ChildProcess {
virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
virtual void didClose(CoreIPC::Connection*);
virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
virtual void didFailToSendSyncMessage(CoreIPC::Connection*);

// Message handlers.
void didReceivePluginProcessMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
@@ -567,6 +567,13 @@ void WebProcess::didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::Message
// we'll let it slide.
}

void WebProcess::didFailToSendSyncMessage(CoreIPC::Connection*)
{
// We were making a synchronous call to a UI process that doesn't exist any more.
// Callers are unlikely to be prepared for an error like this, so it's best to exit immediately.
exit(0);
}

WebFrame* WebProcess::webFrame(uint64_t frameID) const
{
return m_frameMap.get(frameID);
@@ -156,6 +156,7 @@ class WebProcess : ChildProcess {
CoreIPC::SyncReplyMode didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, CoreIPC::ArgumentEncoder*);
void didClose(CoreIPC::Connection*);
void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
void didFailToSendSyncMessage(CoreIPC::Connection*);

// Implemented in generated WebProcessMessageReceiver.cpp
void didReceiveWebProcessMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);

0 comments on commit 2accec1

Please sign in to comment.