Title: [218741] trunk/Source/WebKit2
Revision
218741
Author
[email protected]
Date
2017-06-23 04:14:44 -0700 (Fri, 23 Jun 2017)

Log Message

[WPE] Crash in wpe_view_backend_get_renderer_host_fd
https://bugs.webkit.org/show_bug.cgi?id=173760

Reviewed by Žan Doberšek.

This can happen if views are created and destroyed quickly. The problem is that CompositingManagerProxy adds a
message receiver but never removes it, so it's possible that the message arrives right after the view has been
destroyed. This is happening most of the times running /wpe/WebKitAutomationSession/request-session that creates
3 web views in a row that are deleted when the test finishes.

Fixes /wpe/WebKitAutomationSession/request-session.

* UIProcess/API/wpe/CompositingManagerProxy.cpp:
(WebKit::CompositingManagerProxy::finalize): Remove the message handler.
* UIProcess/API/wpe/CompositingManagerProxy.h:
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::View::~View): Call CompositingManagerProxy::finalize().

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (218740 => 218741)


--- trunk/Source/WebKit2/ChangeLog	2017-06-23 11:11:22 UTC (rev 218740)
+++ trunk/Source/WebKit2/ChangeLog	2017-06-23 11:14:44 UTC (rev 218741)
@@ -1,5 +1,25 @@
 2017-06-23  Carlos Garcia Campos  <[email protected]>
 
+        [WPE] Crash in wpe_view_backend_get_renderer_host_fd
+        https://bugs.webkit.org/show_bug.cgi?id=173760
+
+        Reviewed by Žan Doberšek.
+
+        This can happen if views are created and destroyed quickly. The problem is that CompositingManagerProxy adds a
+        message receiver but never removes it, so it's possible that the message arrives right after the view has been
+        destroyed. This is happening most of the times running /wpe/WebKitAutomationSession/request-session that creates
+        3 web views in a row that are deleted when the test finishes.
+
+        Fixes /wpe/WebKitAutomationSession/request-session.
+
+        * UIProcess/API/wpe/CompositingManagerProxy.cpp:
+        (WebKit::CompositingManagerProxy::finalize): Remove the message handler.
+        * UIProcess/API/wpe/CompositingManagerProxy.h:
+        * UIProcess/API/wpe/WPEView.cpp:
+        (WKWPE::View::~View): Call CompositingManagerProxy::finalize().
+
+2017-06-23  Carlos Garcia Campos  <[email protected]>
+
         [WPE] User script messages don't work
         https://bugs.webkit.org/show_bug.cgi?id=173712
 

Modified: trunk/Source/WebKit2/UIProcess/API/wpe/CompositingManagerProxy.cpp (218740 => 218741)


--- trunk/Source/WebKit2/UIProcess/API/wpe/CompositingManagerProxy.cpp	2017-06-23 11:11:22 UTC (rev 218740)
+++ trunk/Source/WebKit2/UIProcess/API/wpe/CompositingManagerProxy.cpp	2017-06-23 11:14:44 UTC (rev 218741)
@@ -47,6 +47,11 @@
     m_view.page().process().processPool().addMessageReceiver(Messages::CompositingManagerProxy::messageReceiverName(), m_view.page().pageID(), *this);
 }
 
+void CompositingManagerProxy::finalize()
+{
+    m_view.page().process().processPool().removeMessageReceiver(Messages::CompositingManagerProxy::messageReceiverName(), m_view.page().pageID());
+}
+
 void CompositingManagerProxy::establishConnection(IPC::Attachment& connectionHandle)
 {
     connectionHandle = IPC::Attachment(wpe_view_backend_get_renderer_host_fd(m_view.backend()));

Modified: trunk/Source/WebKit2/UIProcess/API/wpe/CompositingManagerProxy.h (218740 => 218741)


--- trunk/Source/WebKit2/UIProcess/API/wpe/CompositingManagerProxy.h	2017-06-23 11:11:22 UTC (rev 218740)
+++ trunk/Source/WebKit2/UIProcess/API/wpe/CompositingManagerProxy.h	2017-06-23 11:14:44 UTC (rev 218741)
@@ -45,6 +45,7 @@
     virtual ~CompositingManagerProxy();
 
     void initialize();
+    void finalize();
 
 private:
     // IPC::MessageReceiver

Modified: trunk/Source/WebKit2/UIProcess/API/wpe/WPEView.cpp (218740 => 218741)


--- trunk/Source/WebKit2/UIProcess/API/wpe/WPEView.cpp	2017-06-23 11:11:22 UTC (rev 218740)
+++ trunk/Source/WebKit2/UIProcess/API/wpe/WPEView.cpp	2017-06-23 11:14:44 UTC (rev 218741)
@@ -130,6 +130,7 @@
 
 View::~View()
 {
+    m_compositingManagerProxy.finalize();
     wpe_view_backend_destroy(m_backend);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to