Title: [243085] trunk/Source/WebCore
Revision
243085
Author
[email protected]
Date
2019-03-18 11:27:42 -0700 (Mon, 18 Mar 2019)

Log Message

[iOS] The network process sometimes gets killed for trying to suspend while holding locked files
https://bugs.webkit.org/show_bug.cgi?id=195890
<rdar://problem/48934338>

Reviewed by Geoffrey Garen.

The network process sometimes gets killed for trying to suspend while holding locked files while
under SQLiteDatabase::open(). The SQLiteDatabaseTracker normally keeps tracking of "transactions"
in progress so we know that we're holding locked files and the WebSQLiteDatabaseTracker takes
care of notifying the UIProcess via IPC that it should hold a background assertion on our behalf
to avoid trying to suspend while holding locked files.
However, we were missing a SQLiteTransactionInProgressAutoCounter when trying to execute the
PRAGMA statement.

Note that we have a similar SQLiteTransactionInProgressAutoCounter in SQLiteDatabase::useWALJournalMode()
when executing such PRAGMA statement already.

* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::open):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (243084 => 243085)


--- trunk/Source/WebCore/ChangeLog	2019-03-18 18:17:12 UTC (rev 243084)
+++ trunk/Source/WebCore/ChangeLog	2019-03-18 18:27:42 UTC (rev 243085)
@@ -1,3 +1,25 @@
+2019-03-18  Chris Dumez  <[email protected]>
+
+        [iOS] The network process sometimes gets killed for trying to suspend while holding locked files
+        https://bugs.webkit.org/show_bug.cgi?id=195890
+        <rdar://problem/48934338>
+
+        Reviewed by Geoffrey Garen.
+
+        The network process sometimes gets killed for trying to suspend while holding locked files while
+        under SQLiteDatabase::open(). The SQLiteDatabaseTracker normally keeps tracking of "transactions"
+        in progress so we know that we're holding locked files and the WebSQLiteDatabaseTracker takes
+        care of notifying the UIProcess via IPC that it should hold a background assertion on our behalf
+        to avoid trying to suspend while holding locked files.
+        However, we were missing a SQLiteTransactionInProgressAutoCounter when trying to execute the
+        PRAGMA statement.
+
+        Note that we have a similar SQLiteTransactionInProgressAutoCounter in SQLiteDatabase::useWALJournalMode()
+        when executing such PRAGMA statement already.
+
+        * platform/sql/SQLiteDatabase.cpp:
+        (WebCore::SQLiteDatabase::open):
+
 2019-03-18  Ryan Haddad  <[email protected]>
 
         Unreviewed, rolling out r243037.

Modified: trunk/Source/WebCore/platform/sql/SQLiteDatabase.cpp (243084 => 243085)


--- trunk/Source/WebCore/platform/sql/SQLiteDatabase.cpp	2019-03-18 18:17:12 UTC (rev 243084)
+++ trunk/Source/WebCore/platform/sql/SQLiteDatabase.cpp	2019-03-18 18:27:42 UTC (rev 243085)
@@ -123,8 +123,11 @@
     else
         m_openErrorMessage = "sqlite_open returned null";
 
-    if (!SQLiteStatement(*this, "PRAGMA temp_store = MEMORY;"_s).executeCommand())
-        LOG_ERROR("SQLite database could not set temp_store to memory");
+    {
+        SQLiteTransactionInProgressAutoCounter transactionCounter;
+        if (!SQLiteStatement(*this, "PRAGMA temp_store = MEMORY;"_s).executeCommand())
+            LOG_ERROR("SQLite database could not set temp_store to memory");
+    }
 
     if (openMode != OpenMode::ReadOnly)
         useWALJournalMode();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to