<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>166034</bug_id>
          
          <creation_ts>2016-12-19 13:51:20 -0800</creation_ts>
          <short_desc>Web Inspector: Assertion seen in InspectorDebuggerAgent::refAsyncCallData with Inspector open</short_desc>
          <delta_ts>2016-12-19 14:45:46 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joseph Pecoraro">joepeck</reporter>
          <assigned_to name="Joseph Pecoraro">joepeck</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>inspector-bugzilla-changes</cc>
    
    <cc>joepeck</cc>
    
    <cc>keith_miller</cc>
    
    <cc>mark.lam</cc>
    
    <cc>msaboff</cc>
    
    <cc>saam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1261197</commentid>
    <comment_count>0</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2016-12-19 13:51:20 -0800</bug_when>
    <thetext>Summary:
Assertion seen in InspectorDebuggerAgent::refAsyncCallData with Inspector open

Test:
&lt;script&gt;
interval = setTimeout(() =&gt; {
    clearInterval(interval);
    setTimeout(() =&gt; {}, 0);
}, 0);
&lt;/script&gt;

Steps to Reproduce:
1. Inspect test page with Debug build
2. Reload
  =&gt; ASSERT

Assert:
Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x00000000bbadbeef
Exception Note:        EXC_CORPSE_NOTIFY

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.JavaScriptCore      	0x0000000106c834c4 WTFCrash + 36 (Assertions.cpp:323)
1   com.apple.JavaScriptCore      	0x00000001065e0290 Inspector::InspectorDebuggerAgent::refAsyncCallData(std::__1::pair&lt;int, int&gt; const&amp;) + 192 (InspectorDebuggerAgent.cpp:1145)
2   com.apple.JavaScriptCore      	0x00000001065e0057 Inspector::InspectorDebuggerAgent::didScheduleAsyncCall(JSC::ExecState*, int, int, bool) + 391 (InspectorDebuggerAgent.cpp:272)
3   com.apple.WebCore             	0x000000010b530a8f WebCore::didScheduleAsyncCall(WebCore::InstrumentingAgents&amp;, WebCore::AsyncCallType, int, WebCore::ScriptExecutionContext&amp;, bool) + 111 (InspectorInstrumentation.cpp:106)
4   com.apple.WebCore             	0x000000010b530954 WebCore::InspectorInstrumentation::didInstallTimerImpl(WebCore::InstrumentingAgents&amp;, int, std::__1::chrono::duration&lt;long long, std::__1::ratio&lt;1l, 1000l&gt; &gt;, bool, WebCore::ScriptExecutionContext&amp;) + 116 (InspectorInstrumentation.cpp:344)
5   com.apple.WebCore             	0x000000010ad20404 WebCore::InspectorInstrumentation::didInstallTimer(WebCore::ScriptExecutionContext&amp;, int, std::__1::chrono::duration&lt;long long, std::__1::ratio&lt;1l, 1000l&gt; &gt;, bool) + 116 (InspectorInstrumentation.h:650)
6   com.apple.WebCore             	0x000000010ad20314 WebCore::DOMTimer::install(WebCore::ScriptExecutionContext&amp;, std::__1::unique_ptr&lt;WebCore::ScheduledAction, std::__1::default_delete&lt;WebCore::ScheduledAction&gt; &gt;, std::__1::chrono::duration&lt;long long, std::__1::ratio&lt;1l, 1000l&gt; &gt;, bool) + 788 (DOMTimer.cpp:224)
7   com.apple.WebCore             	0x000000010ad36d1f WebCore::DOMWindow::setTimeout(std::__1::unique_ptr&lt;WebCore::ScheduledAction, std::__1::default_delete&lt;WebCore::ScheduledAction&gt; &gt;, int) + 671 (DOMWindow.cpp:1670)
8   com.apple.WebCore             	0x000000010b895e5b WebCore::JSDOMWindow::setTimeout(JSC::ExecState&amp;) + 1131 (JSDOMWindowCustom.cpp:501)
9   com.apple.WebCore             	0x000000010b88d4a9 WebCore::jsDOMWindowInstanceFunctionSetTimeoutCaller(JSC::ExecState*, WebCore::JSDOMWindow*, JSC::ThrowScope&amp;) + 105 (JSDOMWindow.cpp:30532)
10  com.apple.WebCore             	0x000000010b84fd68 long long WebCore::BindingCaller&lt;WebCore::JSDOMWindow&gt;::callOperation&lt;&amp;(WebCore::jsDOMWindowInstanceFunctionSetTimeoutCaller(JSC::ExecState*, WebCore::JSDOMWindow*, JSC::ThrowScope&amp;)), (WebCore::CastedThisErrorBehavior)0&gt;(JSC::ExecState*, char const*) + 632 (JSDOMBinding.h:363)
11  com.apple.WebCore             	0x000000010b84fadc WebCore::jsDOMWindowInstanceFunctionSetTimeout(JSC::ExecState*) + 28 (JSDOMWindow.cpp:30523)
...

Notes:

void InspectorDebuggerAgent::refAsyncCallData(const AsyncCallIdentifier&amp; identifier)
{
    auto iterator = m_asyncCallIdentifierToData.find(identifier);
    ASSERT(iterator != m_asyncCallIdentifierToData.end()); // &lt;---
    if (iterator == m_asyncCallIdentifierToData.end())
        return;

    iterator-&gt;value.referenceCount++;
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1261198</commentid>
    <comment_count>1</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2016-12-19 13:51:32 -0800</bug_when>
    <thetext>&lt;rdar://problem/29554366&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1261199</commentid>
    <comment_count>2</comment_count>
      <attachid>297475</attachid>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2016-12-19 13:54:59 -0800</bug_when>
    <thetext>Created attachment 297475
[PATCH] Proposed Fix</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1261210</commentid>
    <comment_count>3</comment_count>
      <attachid>297475</attachid>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2016-12-19 14:20:15 -0800</bug_when>
    <thetext>Comment on attachment 297475
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=297475&amp;action=review

rs=me

&gt; Source/JavaScriptCore/ChangeLog:13
&gt; +        no async data was found for the given identifier.

It would be nice to add a reduced test case to LayoutTests so that this doesn&apos;t regress for some other reason when we change this code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1261211</commentid>
    <comment_count>4</comment_count>
      <attachid>297475</attachid>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2016-12-19 14:20:32 -0800</bug_when>
    <thetext>Comment on attachment 297475
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=297475&amp;action=review

rs=me

&gt;&gt; Source/JavaScriptCore/ChangeLog:13
&gt;&gt; +        no async data was found for the given identifier.
&gt; 
&gt; It would be nice to add a reduced test case to LayoutTests so that this doesn&apos;t regress for some other reason when we change this code.

It would be nice to add a reduced test case to LayoutTests so that this doesn&apos;t regress for some other reason when we change this code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1261219</commentid>
    <comment_count>5</comment_count>
      <attachid>297475</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-12-19 14:45:42 -0800</bug_when>
    <thetext>Comment on attachment 297475
[PATCH] Proposed Fix

Clearing flags on attachment: 297475

Committed r209998: &lt;http://trac.webkit.org/changeset/209998&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1261220</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-12-19 14:45:46 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>297475</attachid>
            <date>2016-12-19 13:54:59 -0800</date>
            <delta_ts>2016-12-19 14:45:42 -0800</delta_ts>
            <desc>[PATCH] Proposed Fix</desc>
            <filename>remove-assert-1.patch</filename>
            <type>text/plain</type>
            <size>1659</size>
            <attacher name="Joseph Pecoraro">joepeck</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cgYi9Tb3VyY2UvSmF2
YVNjcmlwdENvcmUvQ2hhbmdlTG9nCmluZGV4IGVmNTUxOTMuLmVlYTZlODQgMTAwNjQ0Ci0tLSBh
L1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL0phdmFTY3JpcHRD
b3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE3IEBACisyMDE2LTEyLTE5ICBKb3NlcGggUGVjb3Jh
cm8gIDxwZWNvcmFyb0BhcHBsZS5jb20+CisKKyAgICAgICAgV2ViIEluc3BlY3RvcjogQXNzZXJ0
aW9uIHNlZW4gaW4gSW5zcGVjdG9yRGVidWdnZXJBZ2VudDo6cmVmQXN5bmNDYWxsRGF0YSB3aXRo
IEluc3BlY3RvciBvcGVuCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVn
LmNnaT9pZD0xNjYwMzQKKyAgICAgICAgPHJkYXI6Ly9wcm9ibGVtLzI5NTU0MzY2PgorCisgICAg
ICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgICogaW5zcGVjdG9yL2Fn
ZW50cy9JbnNwZWN0b3JEZWJ1Z2dlckFnZW50LmNwcDoKKyAgICAgICAgKEluc3BlY3Rvcjo6SW5z
cGVjdG9yRGVidWdnZXJBZ2VudDo6cmVmQXN5bmNDYWxsRGF0YSk6CisgICAgIC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