<?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>77686</bug_id>
          
          <creation_ts>2012-02-02 14:55:09 -0800</creation_ts>
          <short_desc>[Chromium] WebCore::toV8Context crashes if DomWindow::frame() returns null</short_desc>
          <delta_ts>2012-02-03 17:45:35 -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>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Dmitry Lomov">dslomov</reporter>
          <assigned_to name="Dmitry Lomov">dslomov</assigned_to>
          <cc>abarth</cc>
    
    <cc>dglazkov</cc>
    
    <cc>japhet</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>548180</commentid>
    <comment_count>0</comment_count>
    <who name="Dmitry Lomov">dslomov</who>
    <bug_when>2012-02-02 14:55:09 -0800</bug_when>
    <thetext>http://crbug.com/112110</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>548181</commentid>
    <comment_count>1</comment_count>
    <who name="Dmitry Lomov">dslomov</who>
    <bug_when>2012-02-02 14:58:36 -0800</bug_when>
    <thetext>The break is introduced in http://trac.webkit.org/changeset/99311</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>548186</commentid>
    <comment_count>2</comment_count>
      <attachid>125195</attachid>
    <who name="Dmitry Lomov">dslomov</who>
    <bug_when>2012-02-02 15:09:28 -0800</bug_when>
    <thetext>Created attachment 125195
Fix</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>548187</commentid>
    <comment_count>3</comment_count>
    <who name="Nate Chapin">japhet</who>
    <bug_when>2012-02-02 15:10:56 -0800</bug_when>
    <thetext>Interesting. In what case is this happening?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>548195</commentid>
    <comment_count>4</comment_count>
      <attachid>125195</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2012-02-02 15:27:35 -0800</bug_when>
    <thetext>Comment on attachment 125195
Fix

DOMWindow::frame() is null after the Frame has been destroyed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>548196</commentid>
    <comment_count>5</comment_count>
      <attachid>125195</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-02-02 15:28:09 -0800</bug_when>
    <thetext>Comment on attachment 125195
Fix

Attachment 125195 did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11394945</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>548211</commentid>
    <comment_count>6</comment_count>
      <attachid>125203</attachid>
    <who name="Dmitry Lomov">dslomov</who>
    <bug_when>2012-02-02 15:44:29 -0800</bug_when>
    <thetext>Created attachment 125203
Typo fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>549090</commentid>
    <comment_count>7</comment_count>
      <attachid>125203</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2012-02-03 14:33:46 -0800</bug_when>
    <thetext>Comment on attachment 125203
Typo fixed.

Can we write a test using the test plugin?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>549092</commentid>
    <comment_count>8</comment_count>
      <attachid>125203</attachid>
    <who name="Nate Chapin">japhet</who>
    <bug_when>2012-02-03 14:34:48 -0800</bug_when>
    <thetext>Comment on attachment 125203
Typo fixed.

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

&gt; Source/WebCore/bindings/v8/V8Helpers.cpp:45
&gt; +    if (!domWindow || !domWindow-&gt;frame() || domWindow != domWindow-&gt;frame()-&gt;domWindow())

Do we have any idea when this happens? In theory, we shouldn&apos;t find ourselves in this state.

Is there any hope of a test?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>549094</commentid>
    <comment_count>9</comment_count>
    <who name="Dmitry Lomov">dslomov</who>
    <bug_when>2012-02-03 14:36:30 -0800</bug_when>
    <thetext>(In reply to comment #8)
&gt; (From update of attachment 125203 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=125203&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/bindings/v8/V8Helpers.cpp:45
&gt; &gt; +    if (!domWindow || !domWindow-&gt;frame() || domWindow != domWindow-&gt;frame()-&gt;domWindow())
&gt; 
&gt; Do we have any idea when this happens? In theory, we shouldn&apos;t find ourselves in this state.

Why? What guarantees it?

&gt; 
&gt; Is there any hope of a test?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>549095</commentid>
    <comment_count>10</comment_count>
    <who name="Dmitry Lomov">dslomov</who>
    <bug_when>2012-02-03 14:36:57 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; (From update of attachment 125203 [details])
&gt; Can we write a test using the test plugin?

Maybe - do we have any examples? Thanks</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>549096</commentid>
    <comment_count>11</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2012-02-03 14:37:02 -0800</bug_when>
    <thetext>The DOMWindow&apos;s frame pointer is null after the Frame associated with the DOMWindow has been destroyed (typically by being removed from its document).  I&apos;m not sure how this function can get called if the frame no longer exists.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>549099</commentid>
    <comment_count>12</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2012-02-03 14:37:55 -0800</bug_when>
    <thetext>Take a look in LayoutTests/plugins for a bunch of tests that use the test plugin.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>549111</commentid>
    <comment_count>13</comment_count>
    <who name="Dmitry Lomov">dslomov</who>
    <bug_when>2012-02-03 14:44:42 -0800</bug_when>
    <thetext>(In reply to comment #11)
&gt; The DOMWindow&apos;s frame pointer is null after the Frame associated with the DOMWindow has been destroyed (typically by being removed from its document).  I&apos;m not sure how this function can get called if the frame no longer exists.

Looks like NPObject is still alive and receives messages: 
Here is the call stack:
0012f26c 0207b583 chrome_1c30000!WebCore::Frame::domWindow+0x3
0012f278 0207b7f4 chrome_1c30000!WebCore::toV8Context+0x15
0012f2c4 02ccdfc2 chrome_1c30000!_NPN_GetProperty+0x3a
0012f2f0 02ccf1cd chrome_1c30000!NPObjectStub::OnGetProperty+0x6c
0012f3f4 02ccf73b chrome_1c30000!IPC::SyncMessageSchema&lt;Tuple1&lt;NPIdentifier_Param&gt;,Tuple2&lt;NPVariant_Param &amp;,bool &amp;&gt; &gt;::DispatchWithSendParams&lt;NPObjectStub,NPObjectStub,void (__thiscall NPObjectStub::*)(NPIdentifier_Param const &amp;,NPVariant_Param *,bool *)&gt;+0x87
0012f42c 02ccfb87 chrome_1c30000!NPObjectMsg_GetProperty::Dispatch&lt;NPObjectStub,NPObjectStub,void (__thiscall NPObjectStub::*)(NPIdentifier_Param const &amp;,NPVariant_Param *,bool *)&gt;+0x45
0012f5ac 01f2c969 chrome_1c30000!NPObjectStub::OnMessageReceived+0x1f1
0012f5bc 02cc8ddb chrome_1c30000!MessageRouter::RouteMessage+0x30
0012f5d4 01c75c80 chrome_1c30000!NPChannelBase::OnMessageReceived+0xd2
0012f5e0 01c6eae6 chrome_1c30000!base::internal::Invoker&lt;2,base::internal::BindState&lt;base::internal::RunnableAdapter&lt;void (__thiscall media::FFmpegAudioDecoder::*)(base::Callback&lt;void __cdecl(scoped_refptr&lt;media::Buffer&gt;)&gt; const &amp;)&gt;,void __cdecl(media::FFmpegAudioDecoder *,base::Callback&lt;void __cdecl(scoped_refptr&lt;media::Buffer&gt;)&gt; const &amp;),void __cdecl(media::FFmpegAudioDecoder *,base::Callback&lt;void __cdecl(scoped_refptr&lt;media::Buffer&gt;)&gt;)&gt;,void __cdecl(media::FFmpegAudioDecoder *,base::Callback&lt;void __cdecl(scoped_refptr&lt;media::Buffer&gt;)&gt; const &amp;)&gt;::Run+0x16
0012f6b8 01c6e7a1 chrome_1c30000!MessageLoop::RunTask+0x203
0012f708 01c75b70 chrome_1c30000!MessageLoop::DoWork+0x22c
0012f7cc 01c6e47c chrome_1c30000!base::MessagePumpDefault::Run+0x122</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>549234</commentid>
    <comment_count>14</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2012-02-03 16:44:52 -0800</bug_when>
    <thetext>That looks like a message from the plugin to the page.  Maybe this is a shutdown race whereby the plugin is getting torn down but it doesn&apos;t know it yet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>549236</commentid>
    <comment_count>15</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2012-02-03 16:46:17 -0800</bug_when>
    <thetext>That seems consistent with this crash being caused by &lt;http://trac.webkit.org/changeset/99311&gt;.  That might make it hard to test in DRT, which is single process.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>549237</commentid>
    <comment_count>16</comment_count>
      <attachid>125203</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2012-02-03 16:49:33 -0800</bug_when>
    <thetext>Comment on attachment 125203
Typo fixed.

Ok.  I don&apos;t think this is testable in DumpRenderTree.  We likely need a separate plug-in process around to test this shutdown race.

Jochen is working on getting the layout tests running in content_shell, which will provide a nice framework for testing these kinds of bugs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>549284</commentid>
    <comment_count>17</comment_count>
      <attachid>125203</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-02-03 17:45:30 -0800</bug_when>
    <thetext>Comment on attachment 125203
Typo fixed.

Clearing flags on attachment: 125203

Committed r106722: &lt;http://trac.webkit.org/changeset/106722&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>549285</commentid>
    <comment_count>18</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-02-03 17:45:35 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>125195</attachid>
            <date>2012-02-02 15:09:28 -0800</date>
            <delta_ts>2012-02-02 15:44:29 -0800</delta_ts>
            <desc>Fix</desc>
            <filename>77686.patch</filename>
            <type>text/plain</type>
            <size>1288</size>
            <attacher name="Dmitry Lomov">dslomov</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCBhNzI3ZmE3Li41MjQzMTlkIDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29y
ZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTMg
QEAKKzIwMTItMDItMDIgIERtaXRyeSBMb21vdiAgPGRzbG9tb3ZAZ29vZ2xlLmNvbT4KKworICAg
ICAgICBbQ2hyb21pdW1dIFdlYkNvcmU6OnRvVjhDb250ZXh0IGNyYXNoZXMgaWYgRG9tV2luZG93
OjpmcmFtZSgpIHJldHVybnMgbnVsbC4KKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcv
c2hvd19idWcuY2dpP2lkPTc3Njg2LgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09Q
UyEpLgorCisgICAgICAgICogYmluZGluZ3MvdjgvVjhIZWxwZXJzLmNwcDoKKyAgICAgICAgKFdl
YkNvcmU6OnRvVjhDb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dE9iamVjdC0+ZnJhbWUoKSk7CiB9Cg==
</data>
<flag name="commit-queue"
          id="126634"
          type_id="3"
          status="-"
          setter="webkit.review.bot"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>125203</attachid>
            <date>2012-02-02 15:44:29 -0800</date>
            <delta_ts>2012-02-03 17:45:30 -0800</delta_ts>
            <desc>Typo fixed.</desc>
            <filename>77686.patch</filename>
            <type>text/plain</type>
            <size>1285</size>
            <attacher name="Dmitry Lomov">dslomov</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCBhNzI3ZmE3Li41MjQzMTlkIDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29y
ZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTMg
QEAKKzIwMTItMDItMDIgIERtaXRyeSBMb21vdiAgPGRzbG9tb3ZAZ29vZ2xlLmNvbT4KKworICAg
ICAgICBbQ2hyb21pdW1dIFdlYkNvcmU6OnRvVjhDb250ZXh0IGNyYXNoZXMgaWYgRG9tV2luZG93
OjpmcmFtZSgpIHJldHVybnMgbnVsbC4KKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcv
c2hvd19idWcuY2dpP2lkPTc3Njg2LgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09Q
UyEpLgorCisgICAgICAgICogYmluZGluZ3MvdjgvVjhIZWxwZXJzLmNwcDoKKyAgICAgICAgKFdl
YkNvcmU6OnRvVjhDb250ZXh0KToKKwogMjAxMi0wMi0wMiAgSm9uIExlZSAgPGpvbmxlZUBhcHBs
ZS5jb20+CiAKICAgICAgICAgQ2xlYXIgc2hvd24gbm90aWZpY2F0aW9ucyB3aGVuIGNvbnRleHQg
a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