<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - ASSERT(m_downloads.isEmpty()) fails in DownloadProxyMap::~DownloadProxyMap()"
   href="https://bugs.webkit.org/show_bug.cgi?id=152480">152480</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ASSERT(m_downloads.isEmpty()) fails in DownloadProxyMap::~DownloadProxyMap()
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Mac OS X 10.11
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>WebKit2
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dbates&#64;webkit.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>achristensen&#64;apple.com, andersca&#64;apple.com, sam&#64;webkit.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When running TestWebKitAPI with a debug build of WebKit in Xcode, TestWebKitAPI crashes after running test ContentFiltering.BlockDownloadAfterWillSendRequest because the assertion ASSERT(m_downloads.isEmpty()) fails in DownloadProxyMap::~DownloadProxyMap(). For some reason, I have not had success reproducing this issue when running TestWebKitAPI tests using the command line script run-api-tests.

I am using a debug build of WebKit r194240.

You can reproduce this crash by performing the following:

1. Open WebKit.xcworkspace.
2. Ensure scheme is All Tools/My Mac (64-bit).
3. Choose Product &gt; Scheme &gt; Edit Scheme from the menu bar.
4. In the scheme editor, click Run in the sidebar. In the Info pane, choose executable TestWebKitAPI. Then switch to the Arguments pane and pass the following argument on launch:
--gtest_filter=ContentFiltering.AllowDownloadAfterWillSendRequest:ContentFiltering.BlockDownloadAfterWillSendRequest
5. Click the Close button to close the scheme editor.
6. Run TestWebKitAPI (if you have an existing build then choose Product &gt; Perform Action &gt; Run Without Building).

Then you will break into a debug session when the assertion fails with the following debugger output:

ASSERTION FAILED: m_downloads.isEmpty()
/Volumes/.../Source/WebKit2/UIProcess/Downloads/DownloadProxyMap.cpp(44) : WebKit::DownloadProxyMap::~DownloadProxyMap()
1   0x10188d9b0 WTFCrash
2   0x1037c66a1 WebKit::DownloadProxyMap::~DownloadProxyMap()
3   0x1037c66d5 WebKit::DownloadProxyMap::~DownloadProxyMap()
4   0x103987172 WebKit::NetworkProcessProxy::~NetworkProcessProxy()
5   0x103987215 WebKit::NetworkProcessProxy::~NetworkProcessProxy()
6   0x103987299 WebKit::NetworkProcessProxy::~NetworkProcessProxy()
7   0x103a67843 WTF::ThreadSafeRefCounted&lt;WebKit::ChildProcessProxy&gt;::deref()
8   0x104019aca void WTF::derefIfNotNull&lt;WebKit::NetworkProcessProxy&gt;(WebKit::NetworkProcessProxy*)
9   0x104019a89 WTF::RefPtr&lt;WebKit::NetworkProcessProxy&gt;::~RefPtr()
10  0x10400db75 WTF::RefPtr&lt;WebKit::NetworkProcessProxy&gt;::~RefPtr()
11  0x1040054fe WebKit::WebProcessPool::~WebProcessPool()
12  0x104005945 WebKit::WebProcessPool::~WebProcessPool()
13  0x10419d53e -[WKProcessPool dealloc]
14  0x10366c81d API::Object::deref()
15  0x103670134 void WTF::derefIfNotNull&lt;WebKit::WebProcessPool&gt;(WebKit::WebProcessPool*)
16  0x1037c5957 WTF::RefPtr&lt;WebKit::WebProcessPool&gt;::operator=(std::nullptr_t)
17  0x1037c4a82 WebKit::DownloadProxy::invalidate()
18  0x1037c68f2 WebKit::DownloadProxyMap::downloadFinished(WebKit::DownloadProxy*)
19  0x1037c50d4 WebKit::DownloadProxy::didFinish()
20  0x1037cb8e3 void IPC::callMemberFunctionImpl&lt;WebKit::DownloadProxy, void (WebKit::DownloadProxy::*)(), std::__1::tuple&lt;&gt; &gt;(WebKit::DownloadProxy*, void (WebKit::DownloadProxy::*)(), std::__1::tuple&lt;&gt;&amp;&amp;, std::index_sequence&lt;&gt;)
21  0x1037cb858 void IPC::callMemberFunction&lt;WebKit::DownloadProxy, void (WebKit::DownloadProxy::*)(), std::__1::tuple&lt;&gt;, std::make_index_sequence&lt;0ul&gt; &gt;(std::__1::tuple&lt;&gt;&amp;&amp;, WebKit::DownloadProxy*, void (WebKit::DownloadProxy::*)())
22  0x1037ca75a void IPC::handleMessage&lt;Messages::DownloadProxy::DidFinish, WebKit::DownloadProxy, void (WebKit::DownloadProxy::*)()&gt;(IPC::MessageDecoder&amp;, WebKit::DownloadProxy*, void (WebKit::DownloadProxy::*)())
23  0x1037c9d02 WebKit::DownloadProxy::didReceiveMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;)
24  0x1037c9e77 non-virtual thunk to WebKit::DownloadProxy::didReceiveMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;)
25  0x10384bfcf IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;)
26  0x1036cdc87 WebKit::ChildProcessProxy::dispatchMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;)
27  0x10398827a WebKit::NetworkProcessProxy::didReceiveMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;)
28  0x103988307 non-virtual thunk to WebKit::NetworkProcessProxy::didReceiveMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;)
29  0x1036dbe13 IPC::Connection::dispatchMessage(IPC::MessageDecoder&amp;)
30  0x1036d2d41 IPC::Connection::dispatchMessage(std::__1::unique_ptr&lt;IPC::MessageDecoder, std::__1::default_delete&lt;IPC::MessageDecoder&gt; &gt;)
31  0x1036dc40f IPC::Connection::dispatchOneMessage()</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>