Database Process: ASSERTION FAILED: paths.size() == handles.size() with SANDBOX_EXTEN...
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jul 2016 05:16:01 +0000 (05:16 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jul 2016 05:16:01 +0000 (05:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=160188

Reviewed by Sergio Villar Senin.

This happens in ports with sandbox extensions disabled, and it's making several tests to crash in debug
builds. The SandboxExtension implementation is empty in case of building with sandbox extensions disabled, so
that we are actually allocating no extensions at all in
NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs(). When the message arrives to database
process, we have a list of paths, but an empty list of hanldes which causes the assertion. We can just avoid
that message entirely in case of building without sandbox extensions.

* DatabaseProcess/DatabaseProcess.cpp:
* DatabaseProcess/DatabaseProcess.h:
* DatabaseProcess/DatabaseProcess.messages.in:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs):

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

Source/WebKit2/ChangeLog
Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp
Source/WebKit2/DatabaseProcess/DatabaseProcess.h
Source/WebKit2/DatabaseProcess/DatabaseProcess.messages.in
Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp

index eb5c929..a9b7688 100644 (file)
@@ -1,3 +1,23 @@
+2016-07-28  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        Database Process: ASSERTION FAILED: paths.size() == handles.size() with SANDBOX_EXTENSIONS disabled
+        https://bugs.webkit.org/show_bug.cgi?id=160188
+
+        Reviewed by Sergio Villar Senin.
+
+        This happens in ports with sandbox extensions disabled, and it's making several tests to crash in debug
+        builds. The SandboxExtension implementation is empty in case of building with sandbox extensions disabled, so
+        that we are actually allocating no extensions at all in
+        NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs(). When the message arrives to database
+        process, we have a list of paths, but an empty list of hanldes which causes the assertion. We can just avoid
+        that message entirely in case of building without sandbox extensions.
+
+        * DatabaseProcess/DatabaseProcess.cpp:
+        * DatabaseProcess/DatabaseProcess.h:
+        * DatabaseProcess/DatabaseProcess.messages.in:
+        * UIProcess/Network/NetworkProcessProxy.cpp:
+        (WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs):
+
 2016-07-28  Myles C. Maxfield  <mmaxfield@apple.com>
 
         Remove deprecated SPI for video inline / fullscreen controls
index 03d4bc2..91bc26b 100644 (file)
@@ -238,6 +238,7 @@ void DatabaseProcess::deleteWebsiteDataForOrigins(WebCore::SessionID, OptionSet<
 #endif
 }
 
+#if ENABLE(SANDBOX_EXTENSIONS)
 void DatabaseProcess::grantSandboxExtensionsForBlobs(const Vector<String>& paths, const SandboxExtension::HandleArray& handles)
 {
     ASSERT(paths.size() == handles.size());
@@ -247,6 +248,7 @@ void DatabaseProcess::grantSandboxExtensionsForBlobs(const Vector<String>& paths
         ASSERT_UNUSED(result, result.isNewEntry);
     }
 }
+#endif
 
 #if ENABLE(INDEXED_DATABASE)
 void DatabaseProcess::prepareForAccessToTemporaryFile(const String& path)
index e83bc31..49d0c1e 100644 (file)
@@ -103,7 +103,9 @@ private:
     void fetchWebsiteData(WebCore::SessionID, OptionSet<WebsiteDataType> websiteDataTypes, uint64_t callbackID);
     void deleteWebsiteData(WebCore::SessionID, OptionSet<WebsiteDataType> websiteDataTypes, std::chrono::system_clock::time_point modifiedSince, uint64_t callbackID);
     void deleteWebsiteDataForOrigins(WebCore::SessionID, OptionSet<WebsiteDataType> websiteDataTypes, const Vector<WebCore::SecurityOriginData>& origins, uint64_t callbackID);
+#if ENABLE(SANDBOX_EXTENSIONS)
     void grantSandboxExtensionsForBlobs(const Vector<String>& paths, const SandboxExtension::HandleArray&);
+#endif
 
     void didGetSandboxExtensionsForBlobFiles(uint64_t requestID, SandboxExtension::HandleArray&&);
 
index 278ebd2..98704f6 100644 (file)
@@ -32,7 +32,9 @@ messages -> DatabaseProcess LegacyReceiver {
     FetchWebsiteData(WebCore::SessionID sessionID, OptionSet<WebKit::WebsiteDataType> websiteDataTypes, uint64_t callbackID)
     DeleteWebsiteData(WebCore::SessionID sessionID, OptionSet<WebKit::WebsiteDataType> websiteDataTypes, std::chrono::system_clock::time_point modifiedSince, uint64_t callbackID)
     DeleteWebsiteDataForOrigins(WebCore::SessionID sessionID, OptionSet<WebKit::WebsiteDataType> websiteDataTypes, Vector<WebCore::SecurityOriginData> origins, uint64_t callbackID)
+#if ENABLE(SANDBOX_EXTENSIONS)
     GrantSandboxExtensionsForBlobs(Vector<String> paths, WebKit::SandboxExtension::HandleArray extensions)
+#endif
 
     DidGetSandboxExtensionsForBlobFiles(uint64_t requestID, WebKit::SandboxExtension::HandleArray extensions)
 }
index 7878b8d..03bcb61 100644 (file)
@@ -280,6 +280,7 @@ void NetworkProcessProxy::didDeleteWebsiteDataForOrigins(uint64_t callbackID)
 void NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs(uint64_t requestID, const Vector<String>& paths)
 {
 #if ENABLE(DATABASE_PROCESS)
+#if ENABLE(SANDBOX_EXTENSIONS)
     SandboxExtension::HandleArray extensions;
     extensions.allocate(paths.size());
     for (size_t i = 0; i < paths.size(); ++i) {
@@ -288,6 +289,7 @@ void NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs(uint64
     }
 
     m_processPool.sendToDatabaseProcessRelaunchingIfNecessary(Messages::DatabaseProcess::GrantSandboxExtensionsForBlobs(paths, extensions));
+#endif
     connection()->send(Messages::NetworkProcess::DidGrantSandboxExtensionsToDatabaseProcessForBlobs(requestID), 0);
 #endif
 }