REGRESSION: Crash in com.apple.WebKit: IPC::Connection::sendMessage(std::__1::unique_...
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Jan 2017 21:28:01 +0000 (21:28 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Jan 2017 21:28:01 +0000 (21:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=165854
rdar://problem/29757269

Reviewed by Tim Horton.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::sendMessage):
Add assertion.

(IPC::Connection::initializeSendSource):
Turns out the event handler can be called spuriously, so guard against that.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210596 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm

index 0fc35ba..1ac297f 100644 (file)
@@ -1,3 +1,18 @@
+2017-01-11  Anders Carlsson  <andersca@apple.com>
+
+        REGRESSION: Crash in com.apple.WebKit: IPC::Connection::sendMessage(std::__1::unique_ptr<IPC::MachMessage, std::__1::default_delete<IPC::MachMessage> >) + 27
+        https://bugs.webkit.org/show_bug.cgi?id=165854
+        rdar://problem/29757269
+
+        Reviewed by Tim Horton.
+
+        * Platform/IPC/mac/ConnectionMac.mm:
+        (IPC::Connection::sendMessage):
+        Add assertion.
+
+        (IPC::Connection::initializeSendSource):
+        Turns out the event handler can be called spuriously, so guard against that.
+
 2017-01-11  Chris Dumez  <cdumez@apple.com>
 
         [iOS][WK2] KeyboardEvent.key always returns an empty string
index 7fe009b..e3a3de5 100644 (file)
@@ -263,6 +263,7 @@ bool Connection::open()
 
 bool Connection::sendMessage(std::unique_ptr<MachMessage> message)
 {
+    ASSERT(message);
     ASSERT(!m_pendingOutgoingMachMessage);
 
     // Send the message.
@@ -399,7 +400,9 @@ void Connection::initializeSendSource()
         }
 
         if (data & DISPATCH_MACH_SEND_POSSIBLE) {
-            connection->sendMessage(WTFMove(connection->m_pendingOutgoingMachMessage));
+            // FIXME: Figure out why we get spurious DISPATCH_MACH_SEND_POSSIBLE events.
+            if (connection->m_pendingOutgoingMachMessage)
+                connection->sendMessage(WTFMove(connection->m_pendingOutgoingMachMessage));
             connection->sendOutgoingMessages();
             return;
         }