<?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>191812</bug_id>
          
          <creation_ts>2018-11-17 14:11:58 -0800</creation_ts>
          <short_desc>Regression(r238330) ProcessSwap.WebInspector API test is a flaky crash in debug</short_desc>
          <delta_ts>2018-11-18 23:31:18 -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>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=191814</see_also>
          <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>
          
          <blocked>191740</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Chris Dumez">cdumez</reporter>
          <assigned_to name="Joseph Pecoraro">joepeck</assigned_to>
          <cc>bburg</cc>
    
    <cc>commit-queue</cc>
    
    <cc>hi</cc>
    
    <cc>inspector-bugzilla-changes</cc>
    
    <cc>joepeck</cc>
    
    <cc>koivisto</cc>
    
    <cc>rniwa</cc>
    
    <cc>ryanhaddad</cc>
    
    <cc>timothy</cc>
    
    <cc>tsavell</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1479967</commentid>
    <comment_count>0</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2018-11-17 14:11:58 -0800</bug_when>
    <thetext>ProcessSwap.WebInspector API test is a flaky crash in debug:

TestWebKitAPI.ProcessSwap.WebInspector
        _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
        Received data during response processing, queuing it.
        _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
        _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
        Received data during response processing, queuing it.
        ASSERTION FAILED: !m_frontendConnection
        /Volumes/Data/slave/mojave-debug/build/Source/WebKit/WebProcess/WebPage/WebInspector.cpp(80) : void WebKit::WebInspector::setFrontendConnection(IPC::Attachment)
        1   0x646e526f9 WTFCrash
        2   0x630002a2b WTFCrashWithInfo(int, char const*, char const*, int)
        3   0x631030c2a WebKit::WebInspector::setFrontendConnection(IPC::Attachment)
        4   0x6310f1d48 void IPC::callMemberFunctionImpl&lt;WebKit::WebInspector, void (WebKit::WebInspector::*)(IPC::Attachment), std::__1::tuple&lt;IPC::Attachment&gt;, 0ul&gt;(WebKit::WebInspector*, void (WebKit::WebInspector::*)(IPC::Attachment), std::__1::tuple&lt;IPC::Attachment&gt;&amp;&amp;, std::__1::integer_sequence&lt;unsigned long, 0ul&gt;)
        5   0x6310f1c70 void IPC::callMemberFunction&lt;WebKit::WebInspector, void (WebKit::WebInspector::*)(IPC::Attachment), std::__1::tuple&lt;IPC::Attachment&gt;, std::__1::integer_sequence&lt;unsigned long, 0ul&gt; &gt;(std::__1::tuple&lt;IPC::Attachment&gt;&amp;&amp;, WebKit::WebInspector*, void (WebKit::WebInspector::*)(IPC::Attachment))
        6   0x6310f16a4 void IPC::handleMessage&lt;Messages::WebInspector::SetFrontendConnection, WebKit::WebInspector, void (WebKit::WebInspector::*)(IPC::Attachment)&gt;(IPC::Decoder&amp;, WebKit::WebInspector*, void (WebKit::WebInspector::*)(IPC::Attachment))
        7   0x6310f092c WebKit::WebInspector::didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;)
        8   0x63111ad32 WebKit::WebPage::didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;)
        9   0x6300b1e9a IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&amp;, IPC::Decoder&amp;)
        10  0x630db5b1d WebKit::WebProcess::didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;)
        11  0x630049f2c IPC::Connection::dispatchMessage(IPC::Decoder&amp;)
        12  0x63003c311 IPC::Connection::dispatchMessage(std::__1::unique_ptr&lt;IPC::Decoder, std::__1::default_delete&lt;IPC::Decoder&gt; &gt;)
        13  0x63004acf7 IPC::Connection::dispatchOneIncomingMessage()
        14  0x63006b828 IPC::Connection::enqueueIncomingMessage(std::__1::unique_ptr&lt;IPC::Decoder, std::__1::default_delete&lt;IPC::Decoder&gt; &gt;)::$_14::operator()()
        15  0x63006b739 WTF::Function&lt;void ()&gt;::CallableWrapper&lt;IPC::Connection::enqueueIncomingMessage(std::__1::unique_ptr&lt;IPC::Decoder, std::__1::default_delete&lt;IPC::Decoder&gt; &gt;)::$_14&gt;::call()
        16  0x646e79ffd WTF::Function&lt;void ()&gt;::operator()() const
        17  0x646ed2e5d WTF::RunLoop::performWork()
        18  0x646ed3704 WTF::RunLoop::performWork(void*)
        19  0x7fff4189cf09 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
        20  0x7fff4189ceaf __CFRunLoopDoSource0
        21  0x7fff41880d5c __CFRunLoopDoSources0
        22  0x7fff41880303 __CFRunLoopRun
        23  0x7fff4187fbe6 CFRunLoopRunSpecific
        24  0x7fff43c043ba -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
        25  0x7fff43c0428f -[NSRunLoop(NSRunLoop) run]
        26  0x7fff6ed31ee6 _xpc_objc_main
        27  0x7fff6ed319e5 _xpc_copy_xpcservice_dictionary
        28  0x1073c2055 WebKit::XPCServiceMain(int, char const**)
        29  0x1073c2342 main
        30  0x7fff6eafb08d start
        _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
        Received data during response processing, queuing it.
        Received data during response processing, queuing it.
        LEAK: 2 WebProcessPool
        
        /Volumes/Data/slave/mojave-debug/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:2075
        Expected: (pid2) != (pid3), actual: 29417 vs 29417
        
        
        /Volumes/Data/slave/mojave-debug/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:2076
        Expected equality of these values:
          numberOfDecidePolicyCalls
            Which is: 4
          3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1479968</commentid>
    <comment_count>1</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2018-11-17 14:13:14 -0800</bug_when>
    <thetext>https://build.webkit.org/builders/Apple%20Mojave%20Debug%20WK1%20%28Tests%29/builds/739/steps/run-api-tests/logs/stdio</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1479971</commentid>
    <comment_count>2</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2018-11-17 14:16:26 -0800</bug_when>
    <thetext>I was unable to reproduce locally.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480008</commentid>
    <comment_count>3</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2018-11-17 17:26:49 -0800</bug_when>
    <thetext>I can reproduce it locally on iMac Pro:

$ ./Tools/Scripts/run-api-tests --debug ProcessSwap.WebInspector
Running tests       
    _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
    Received data during response processing, queuing it.
    _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
    _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
    ASSERTION FAILED: !m_frontendConnection
    /Volumes/Data/webkit2/Source/WebKit/WebProcess/WebPage/WebInspector.cpp(80) : void WebKit::WebInspector::setFrontendConnection(IPC::Attachment)
    1   0x11f66f419 WTFCrash
    2   0x10af0d19b WTFCrashWithInfo(int, char const*, char const*, int)
    3   0x10bf349ea WebKit::WebInspector::setFrontendConnection(IPC::Attachment)
    4   0x10bff5d78 void IPC::callMemberFunctionImpl&lt;WebKit::WebInspector, void (WebKit::WebInspector::*)(IPC::Attachment), std::__1::tuple&lt;IPC::Attachment&gt;, 0ul&gt;(WebKit::WebInspector*, void (WebKit::WebInspector::*)(IPC::Attachment), std::__1::tuple&lt;IPC::Attachment&gt;&amp;&amp;, std::__1::integer_sequence&lt;unsigned long, 0ul&gt;)
    5   0x10bff5ca0 void IPC::callMemberFunction&lt;WebKit::WebInspector, void (WebKit::WebInspector::*)(IPC::Attachment), std::__1::tuple&lt;IPC::Attachment&gt;, std::__1::integer_sequence&lt;unsigned long, 0ul&gt; &gt;(std::__1::tuple&lt;IPC::Attachment&gt;&amp;&amp;, WebKit::WebInspector*, void (WebKit::WebInspector::*)(IPC::Attachment))
    6   0x10bff56d4 void IPC::handleMessage&lt;Messages::WebInspector::SetFrontendConnection, WebKit::WebInspector, void (WebKit::WebInspector::*)(IPC::Attachment)&gt;(IPC::Decoder&amp;, WebKit::WebInspector*, void (WebKit::WebInspector::*)(IPC::Attachment))
    7   0x10bff495c WebKit::WebInspector::didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;)
    8   0x10c01efe2 WebKit::WebPage::didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;)
    9   0x10afbc5da IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&amp;, IPC::Decoder&amp;)
    10  0x10bcbc45d WebKit::WebProcess::didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;)
    11  0x10af5466c IPC::Connection::dispatchMessage(IPC::Decoder&amp;)
    12  0x10af46a51 IPC::Connection::dispatchMessage(std::__1::unique_ptr&lt;IPC::Decoder, std::__1::default_delete&lt;IPC::Decoder&gt; &gt;)
    13  0x10af55437 IPC::Connection::dispatchOneIncomingMessage()
    14  0x10af75f68 IPC::Connection::enqueueIncomingMessage(std::__1::unique_ptr&lt;IPC::Decoder, std::__1::default_delete&lt;IPC::Decoder&gt; &gt;)::$_14::operator()()
    15  0x10af75e79 WTF::Function&lt;void ()&gt;::CallableWrapper&lt;IPC::Connection::enqueueIncomingMessage(std::__1::unique_ptr&lt;IPC::Decoder, std::__1::default_delete&lt;IPC::Decoder&gt; &gt;)::$_14&gt;::call()
    16  0x11f696c5d WTF::Function&lt;void ()&gt;::operator()() const
    17  0x11f6ef90d WTF::RunLoop::performWork()
    18  0x11f6f01b4 WTF::RunLoop::performWork(void*)
...
    Received data during response processing, queuing it.
    Received data during response processing, queuing it.
    LEAK: 2 WebProcessPool
    
    /Volumes/Data/webkit2/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:2076
    Expected: (pid2) != (pid3), actual: 36821 vs 36821
    
    
    /Volumes/Data/webkit2/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:2077
    Expected equality of these values:
      numberOfDecidePolicyCalls
        Which is: 4
      3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480117</commentid>
    <comment_count>4</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2018-11-18 20:38:30 -0800</bug_when>
    <thetext>(In reply to Ryosuke Niwa from comment #3)
&gt; I can reproduce it locally on iMac Pro:
&gt; 
&gt; $ ./Tools/Scripts/run-api-tests --debug ProcessSwap.WebInspector

This also reproduces the issue for me. I&apos;m taking a look.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480118</commentid>
    <comment_count>5</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2018-11-18 20:43:14 -0800</bug_when>
    <thetext>(In reply to Joseph Pecoraro from comment #4)
&gt; (In reply to Ryosuke Niwa from comment #3)
&gt; &gt; I can reproduce it locally on iMac Pro:
&gt; &gt; 
&gt; &gt; $ ./Tools/Scripts/run-api-tests --debug ProcessSwap.WebInspector
&gt; 
&gt; This also reproduces the issue for me. I&apos;m taking a look.

FYI, https://bugs.webkit.org/show_bug.cgi?id=191814 is probably more urgent.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480120</commentid>
    <comment_count>6</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2018-11-18 21:23:43 -0800</bug_when>
    <thetext>My understanding of what is going on so far is:

    • WebProcess (A) asks UIProcess for inspector
      • UIProcess launches InspectorProcess
        • InspectorProcess launches, sends new connection attachment (1) to UIProcess (on way to WebProcess)

    * UIProcess navigates
      * Swaps WebProcess (A) swaps to (B)
        * Asks InspectorProcess for a new connection
          * InspectorProcess, sends new connection attachment (2) to UIProcess (on way to WebProcess)

    • UIProcess receives (1) sends to current WebProcess (B)
    • UIProcess receives (2) sends to current WebProcess (B)

So this looks like its just message ordering due to very quickly performing actions in the UIProcess before receiving messages from the InspectorProcess. In this case it would be harmless for WebProcess (B) to use the latest IPC attachment, and in fact we will always want to use the most current IPC::Attachment.

I just want to verify a few things, like that we aren&apos;t getting messages in suspended processes.

Maybe it&apos;s possible for the UIProcess avoid sending multiple messages to a WebProcess but just using the latest is the simplest path forward.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480130</commentid>
    <comment_count>7</comment_count>
      <attachid>355255</attachid>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2018-11-18 22:01:13 -0800</bug_when>
    <thetext>Created attachment 355255
[PATCH] Proposed Fix</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480155</commentid>
    <comment_count>8</comment_count>
      <attachid>355255</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2018-11-18 23:29:22 -0800</bug_when>
    <thetext>Comment on attachment 355255
[PATCH] Proposed Fix

Clearing flags on attachment: 355255

Committed r238369: &lt;https://trac.webkit.org/changeset/238369&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480156</commentid>
    <comment_count>9</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2018-11-18 23:29:24 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480157</commentid>
    <comment_count>10</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-11-18 23:31:18 -0800</bug_when>
    <thetext>&lt;rdar://problem/46162470&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>355255</attachid>
            <date>2018-11-18 22:01:13 -0800</date>
            <delta_ts>2018-11-18 23:29:22 -0800</delta_ts>
            <desc>[PATCH] Proposed Fix</desc>
            <filename>swap-1.patch</filename>
            <type>text/plain</type>
            <size>1936</size>
            <attacher name="Joseph Pecoraro">joepeck</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJLaXQvQ2hhbmdlTG9nIGIvU291cmNlL1dlYktpdC9DaGFu
Z2VMb2cKaW5kZXggMjk1YjM1MTQ1ZjEuLmZkZTYzMzgzOTJlIDEwMDY0NAotLS0gYS9Tb3VyY2Uv
V2ViS2l0L0NoYW5nZUxvZworKysgYi9Tb3VyY2UvV2ViS2l0L0NoYW5nZUxvZwpAQCAtMSwzICsx
LDE4IEBACisyMDE4LTExLTE4ICBKb3NlcGggUGVjb3Jhcm8gIDxwZWNvcmFyb0BhcHBsZS5jb20+
CisKKyAgICAgICAgUmVncmVzc2lvbihyMjM4MzMwKSBQcm9jZXNzU3dhcC5XZWJJbnNwZWN0b3Ig
QVBJIHRlc3QgaXMgYSBmbGFreSBjcmFzaCBpbiBkZWJ1ZworICAgICAgICBodHRwczovL2J1Z3Mu
d2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MTkxODEyCisKKyAgICAgICAgUmV2aWV3ZWQgYnkg
Tk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgKiBXZWJQcm9jZXNzL1dlYlBhZ2UvV2ViSW5z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