<?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>114217</bug_id>
          
          <creation_ts>2013-04-08 14:13:03 -0700</creation_ts>
          <short_desc>Web/Plugin process deadlock initializing async plugins</short_desc>
          <delta_ts>2013-04-11 10:16:59 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit2</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</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="Brady Eidson">beidson</reporter>
          <assigned_to name="Brady Eidson">beidson</assigned_to>
          <cc>andersca</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>871163</commentid>
    <comment_count>0</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2013-04-08 14:13:03 -0700</bug_when>
    <thetext>Web/Plugin process deadlock initializing async plugins

Imagine:

-A WebProcess is instantiating a plugin, so it synchronously asks for a new plugin process connection.
-Once it gets the connection, it asynchronously asks for a plugin to initialize.
-While that one is initializing, it&apos;s instantiating another plugin.
-It synchronously asks for a new plugin process connection.

In this scenario, when the plugin process finishes up the async initialization, it notifies the web process with a synchronous message.

So it&apos;s synchronously waiting on the WebProcess, and the WebProcess is synchronously waiting on the plugin process.

Deadlock.

I think this is an easy fix because I don&apos;t now why the plugin process notification to the WebProcess is synchronous - the replies are empty.

In radar as &lt;rdar://problem/13525232&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>871166</commentid>
    <comment_count>1</comment_count>
      <attachid>196954</attachid>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2013-04-08 14:15:32 -0700</bug_when>
    <thetext>Created attachment 196954
Patch v1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>871176</commentid>
    <comment_count>2</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2013-04-08 14:30:28 -0700</bug_when>
    <thetext>http://trac.webkit.org/changeset/147953</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>871287</commentid>
    <comment_count>3</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2013-04-08 17:18:24 -0700</bug_when>
    <thetext>This caused platform/mac-wk2/plugins/slow/asynchronous-plugin-initialization-multiple.html to fail.  Looking in to it now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>871299</commentid>
    <comment_count>4</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2013-04-08 17:26:34 -0700</bug_when>
    <thetext>Here&apos;s what happens in the test:

1 - PluginProcess gets 20 requests to async init.  Those 20 messages are queued up.
2 - It starts the first 1, which takes 0.5 seconds
3 - During that time, the WebProcess tells it to destroy all of them.  These 20 messages are sync messages, and presumably get queued up behind those 20 in step one.

In the working case, those 20 &quot;Destroy&quot; messages are handled immediately after the first plugin is finished initializing, even though there&apos;s 19 requests to create waiting.

In the failing case, all 20 requests to create are handled before any of the requests to destroy are handled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>871305</commentid>
    <comment_count>5</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2013-04-08 17:38:08 -0700</bug_when>
    <thetext>Skipped in r147968 while I explore this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>871306</commentid>
    <comment_count>6</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2013-04-08 17:38:33 -0700</bug_when>
    <thetext>Reopening - the failure shows the patch broke the async plugin feature.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>873282</commentid>
    <comment_count>7</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2013-04-10 15:57:46 -0700</bug_when>
    <thetext>This probably wasn&apos;t necessary, and we should roll it out.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>873969</commentid>
    <comment_count>8</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2013-04-11 10:16:59 -0700</bug_when>
    <thetext>Rolled out in http://trac.webkit.org/changeset/148214</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>196954</attachid>
            <date>2013-04-08 14:15:32 -0700</date>
            <delta_ts>2013-04-08 14:16:53 -0700</delta_ts>
            <desc>Patch v1</desc>
            <filename>patch</filename>
            <type>text/plain</type>
            <size>2806</size>
            <attacher name="Brady Eidson">beidson</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJLaXQyL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJLaXQyL0No
YW5nZUxvZwppbmRleCA4YTEwNWU3Li40MmI5NDFjIDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViS2l0
Mi9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYktpdDIvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTYg
QEAKKzIwMTMtMDQtMDggIEJyYWR5IEVpZHNvbiAgPGJlaWRzb25AYXBwbGUuY29tPgorCisgICAg
ICAgIFdlYi9QbHVnaW4gcHJvY2VzcyBkZWFkbG9jayBpbml0aWFsaXppbmcgYXN5bmMgcGx1Z2lu
cy4KKyAgICAgICAgPHJkYXI6Ly9wcm9ibGVtLzEzNTI1MjMyPiBhbmQgaHR0cHM6Ly9idWdzLndl
YmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTExNDIxNworCisgICAgICAgIFJldmlld2V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VBsdWdpbigpIC0+ICgpCisgICAgRGlkRmFpbFRvQ3JlYXRlUGx1Z2luKCkK
IH0KIAogI2VuZGlmCg==
</data>
<flag name="review"
          id="219088"
          type_id="1"
          status="+"
          setter="andersca"
    />
          </attachment>
      

    </bug>

</bugzilla>