Changeset 244217 in webkit


Ignore:
Timestamp:
Apr 12, 2019 9:11:46 AM (5 years ago)
Author:
Chris Dumez
Message:

[iOS Sim Debug] ASSERTION FAILED: m_downloads.isEmpty() Layout Test http/tests/websocket/tests/hybi/network-process-crash-error.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=196781
<rdar://problem/49789381>

Reviewed by Darin Adler.

When the network process gets terminated by the client, the NetworkProcessProxy object (and thus its DownloadProxyMap member) get
destroyed right away, before we get a call to didClose(IPC::Connection&). As a result, if there are ongoing downloads at the time
of the termination, we will hit the assertion above. To address the issue, update the NetworkProcessProxy destructor to invalidate
its DownloadProxyMap member, similator to what it does in didClose(IPC::Connection&).

  • UIProcess/Downloads/DownloadProxyMap.cpp:

(WebKit::DownloadProxyMap::invalidate):
(WebKit::DownloadProxyMap::processDidClose): Deleted.

  • UIProcess/Downloads/DownloadProxyMap.h:
  • UIProcess/Network/NetworkProcessProxy.cpp:

(WebKit::NetworkProcessProxy::~NetworkProcessProxy):
(WebKit::NetworkProcessProxy::didClose):

Location:
trunk/Source/WebKit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r244212 r244217  
     12019-04-12  Chris Dumez  <cdumez@apple.com>
     2
     3        [iOS Sim Debug] ASSERTION FAILED: m_downloads.isEmpty() Layout Test http/tests/websocket/tests/hybi/network-process-crash-error.html is a flaky crash
     4        https://bugs.webkit.org/show_bug.cgi?id=196781
     5        <rdar://problem/49789381>
     6
     7        Reviewed by Darin Adler.
     8
     9        When the network process gets terminated by the client, the NetworkProcessProxy object (and thus its DownloadProxyMap member) get
     10        destroyed right away, before we get a call to didClose(IPC::Connection&). As a result, if there are ongoing downloads at the time
     11        of the termination, we will hit the assertion above. To address the issue, update the NetworkProcessProxy destructor to invalidate
     12        its DownloadProxyMap member, similator to what it does in didClose(IPC::Connection&).
     13
     14        * UIProcess/Downloads/DownloadProxyMap.cpp:
     15        (WebKit::DownloadProxyMap::invalidate):
     16        (WebKit::DownloadProxyMap::processDidClose): Deleted.
     17        * UIProcess/Downloads/DownloadProxyMap.h:
     18        * UIProcess/Network/NetworkProcessProxy.cpp:
     19        (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
     20        (WebKit::NetworkProcessProxy::didClose):
     21
    1222019-04-11  Carlos Garcia Campos  <cgarcia@igalia.com>
    223
  • trunk/Source/WebKit/UIProcess/Downloads/DownloadProxyMap.cpp

    r243110 r244217  
    111111}
    112112
    113 void DownloadProxyMap::processDidClose()
     113void DownloadProxyMap::invalidate()
    114114{
    115115    // Invalidate all outstanding downloads.
  • trunk/Source/WebKit/UIProcess/Downloads/DownloadProxyMap.h

    r243110 r244217  
    6060    bool isEmpty() const { return m_downloads.isEmpty(); }
    6161
    62     void processDidClose();
     62    void invalidate();
    6363
    6464    void applicationDidEnterBackground();
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp

    r244077 r244217  
    9898#endif
    9999
     100    if (m_downloadProxyMap)
     101        m_downloadProxyMap->invalidate();
     102
    100103    for (auto& reply : m_pendingConnectionReplies)
    101104        reply.second({ });
     
    274277
    275278    if (m_downloadProxyMap)
    276         m_downloadProxyMap->processDidClose();
     279        m_downloadProxyMap->invalidate();
    277280#if ENABLE(LEGACY_CUSTOM_PROTOCOL_MANAGER)
    278281    m_customProtocolManagerProxy.invalidate();
Note: See TracChangeset for help on using the changeset viewer.