Title: [243903] trunk/Source/WebCore
- Revision
- 243903
- Author
- [email protected]
- Date
- 2019-04-04 13:53:22 -0700 (Thu, 04 Apr 2019)
Log Message
Leak of UniqueIDBDatabase in network process running layout tests
https://bugs.webkit.org/show_bug.cgi?id=196565
<rdar://problem/49346139>
Reviewed by Geoffrey Garen.
UniqueIDBDatabase will null itself after it receives confirmation about connecton close from its clients, but it
is possible that the web process to network process connection closes before servers gets the
confirmDidCloseFromServer. Therefore, we should let UniqueIDBDatabase forget connection when it receives a
conenctionClosedFromClient.
No new test because this bug is caused by race between network receiving conenctionClosedFromClient and
receiving confirmDidCloseFromServer. This is testable by running some existing layout tests in a row with leak
option.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
(WebCore::IDBServer::UniqueIDBDatabase::confirmDidCloseFromServer):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (243902 => 243903)
--- trunk/Source/WebCore/ChangeLog 2019-04-04 20:51:45 UTC (rev 243902)
+++ trunk/Source/WebCore/ChangeLog 2019-04-04 20:53:22 UTC (rev 243903)
@@ -1,3 +1,24 @@
+2019-04-04 Sihui Liu <[email protected]>
+
+ Leak of UniqueIDBDatabase in network process running layout tests
+ https://bugs.webkit.org/show_bug.cgi?id=196565
+ <rdar://problem/49346139>
+
+ Reviewed by Geoffrey Garen.
+
+ UniqueIDBDatabase will null itself after it receives confirmation about connecton close from its clients, but it
+ is possible that the web process to network process connection closes before servers gets the
+ confirmDidCloseFromServer. Therefore, we should let UniqueIDBDatabase forget connection when it receives a
+ conenctionClosedFromClient.
+
+ No new test because this bug is caused by race between network receiving conenctionClosedFromClient and
+ receiving confirmDidCloseFromServer. This is testable by running some existing layout tests in a row with leak
+ option.
+
+ * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+ (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
+ (WebCore::IDBServer::UniqueIDBDatabase::confirmDidCloseFromServer):
+
2019-04-04 Chris Dumez <[email protected]>
Unreviewed, fix iOS build with recent SDKs.
Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (243902 => 243903)
--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp 2019-04-04 20:51:45 UTC (rev 243902)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp 2019-04-04 20:53:22 UTC (rev 243903)
@@ -1733,6 +1733,13 @@
ASSERT(isMainThread());
LOG(IndexedDB, "(main) UniqueIDBDatabase::connectionClosedFromClient - %s (%" PRIu64 ")", connection.openRequestIdentifier().loggingString().utf8().data(), connection.identifier());
+ if (m_serverClosePendingDatabaseConnections.contains(&connection)) {
+ m_serverClosePendingDatabaseConnections.remove(&connection);
+ if (m_hardClosedForUserDelete)
+ maybeFinishHardClose();
+ return;
+ }
+
Ref<UniqueIDBDatabaseConnection> protectedConnection(connection);
m_openDatabaseConnections.remove(&connection);
@@ -1812,10 +1819,12 @@
ASSERT(isMainThread());
LOG(IndexedDB, "UniqueIDBDatabase::confirmDidCloseFromServer - %s (%" PRIu64 ")", connection.openRequestIdentifier().loggingString().utf8().data(), connection.identifier());
+ if (!m_serverClosePendingDatabaseConnections.contains(&connection))
+ return;
+ m_serverClosePendingDatabaseConnections.remove(&connection);
+
if (m_hardClosedForUserDelete)
maybeFinishHardClose();
- ASSERT(m_serverClosePendingDatabaseConnections.contains(&connection));
- m_serverClosePendingDatabaseConnections.remove(&connection);
}
void UniqueIDBDatabase::enqueueTransaction(Ref<UniqueIDBDatabaseTransaction>&& transaction)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes