Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[iOS Sim Debug] ASSERTION FAILED: m_downloads.isEmpty() Layout Test h…
…ttp/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):

Canonical link: https://commits.webkit.org/211126@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244217 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
cdumez committed Apr 12, 2019
1 parent 993d8a9 commit 74b52f1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
21 changes: 21 additions & 0 deletions Source/WebKit/ChangeLog
@@ -1,3 +1,24 @@
2019-04-12 Chris Dumez <cdumez@apple.com>

[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):

2019-04-11 Carlos Garcia Campos <cgarcia@igalia.com>

[GTK] REGRESSION(r243860): Many tests failing
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/UIProcess/Downloads/DownloadProxyMap.cpp
Expand Up @@ -110,7 +110,7 @@ void DownloadProxyMap::downloadFinished(DownloadProxy& downloadProxy)
}
}

void DownloadProxyMap::processDidClose()
void DownloadProxyMap::invalidate()
{
// Invalidate all outstanding downloads.
for (const auto& download : m_downloads.values()) {
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/UIProcess/Downloads/DownloadProxyMap.h
Expand Up @@ -59,7 +59,7 @@ class DownloadProxyMap : public CanMakeWeakPtr<DownloadProxyMap> {

bool isEmpty() const { return m_downloads.isEmpty(); }

void processDidClose();
void invalidate();

void applicationDidEnterBackground();
void applicationWillEnterForeground();
Expand Down
5 changes: 4 additions & 1 deletion Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
Expand Up @@ -97,6 +97,9 @@ NetworkProcessProxy::~NetworkProcessProxy()
proxy->removeNetworkProcess(*this);
#endif

if (m_downloadProxyMap)
m_downloadProxyMap->invalidate();

for (auto& reply : m_pendingConnectionReplies)
reply.second({ });
}
Expand Down Expand Up @@ -273,7 +276,7 @@ void NetworkProcessProxy::didClose(IPC::Connection&)
auto protectedProcessPool = makeRef(m_processPool);

if (m_downloadProxyMap)
m_downloadProxyMap->processDidClose();
m_downloadProxyMap->invalidate();
#if ENABLE(LEGACY_CUSTOM_PROTOCOL_MANAGER)
m_customProtocolManagerProxy.invalidate();
#endif
Expand Down

0 comments on commit 74b52f1

Please sign in to comment.