⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243903 in webkit


Ignore:
Timestamp:
Apr 4, 2019, 1:53:22 PM (7 years ago)
Author:
sihui_liu@apple.com
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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r243901 r243903  
     12019-04-04  Sihui Liu  <sihui_liu@apple.com>
     2
     3        Leak of UniqueIDBDatabase in network process running layout tests
     4        https://bugs.webkit.org/show_bug.cgi?id=196565
     5        <rdar://problem/49346139>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        UniqueIDBDatabase will null itself after it receives confirmation about connecton close from its clients, but it
     10        is possible that the web process to network process connection closes before servers gets the
     11        confirmDidCloseFromServer. Therefore, we should let UniqueIDBDatabase forget connection when it receives a
     12        conenctionClosedFromClient.
     13
     14        No new test because this bug is caused by race between network receiving conenctionClosedFromClient and
     15        receiving confirmDidCloseFromServer. This is testable by running some existing layout tests in a row with leak
     16        option.
     17
     18        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
     19        (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
     20        (WebCore::IDBServer::UniqueIDBDatabase::confirmDidCloseFromServer):
     21
    1222019-04-04  Chris Dumez  <cdumez@apple.com>
    223
  • trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp

    r243807 r243903  
    17341734    LOG(IndexedDB, "(main) UniqueIDBDatabase::connectionClosedFromClient - %s (%" PRIu64 ")", connection.openRequestIdentifier().loggingString().utf8().data(), connection.identifier());
    17351735
     1736    if (m_serverClosePendingDatabaseConnections.contains(&connection)) {
     1737        m_serverClosePendingDatabaseConnections.remove(&connection);
     1738        if (m_hardClosedForUserDelete)
     1739            maybeFinishHardClose();
     1740        return;
     1741    }
     1742
    17361743    Ref<UniqueIDBDatabaseConnection> protectedConnection(connection);
    17371744    m_openDatabaseConnections.remove(&connection);
     
    18131820    LOG(IndexedDB, "UniqueIDBDatabase::confirmDidCloseFromServer - %s (%" PRIu64 ")", connection.openRequestIdentifier().loggingString().utf8().data(), connection.identifier());
    18141821
     1822    if (!m_serverClosePendingDatabaseConnections.contains(&connection))
     1823        return;
     1824    m_serverClosePendingDatabaseConnections.remove(&connection);
     1825
    18151826    if (m_hardClosedForUserDelete)
    18161827        maybeFinishHardClose();
    1817     ASSERT(m_serverClosePendingDatabaseConnections.contains(&connection));
    1818     m_serverClosePendingDatabaseConnections.remove(&connection);
    18191828}
    18201829
Note: See TracChangeset for help on using the changeset viewer.