<?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>86035</bug_id>
          
          <creation_ts>2012-05-09 16:23:20 -0700</creation_ts>
          <short_desc>Crash in FrameView::windowClipRectForFrameOwner after r116371</short_desc>
          <delta_ts>2012-05-14 14:51:39 -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>Plug-ins</component>
          <version>528+ (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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Julien Chaffraix">jchaffraix</reporter>
          <assigned_to name="Julien Chaffraix">jchaffraix</assigned_to>
          <cc>abarth</cc>
    
    <cc>eric</cc>
    
    <cc>tony</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>619991</commentid>
    <comment_count>0</comment_count>
    <who name="Julien Chaffraix">jchaffraix</who>
    <bug_when>2012-05-09 16:23:20 -0700</bug_when>
    <thetext>Example stack-trace:

0x67258b37	 [chrome.dll]	 - frameview.cpp:2573	WebCore::FrameView::windowClipRectForFrameOwner(WebCore::HTMLFrameOwnerElement const *,bool)
0x67258ae1	 [chrome.dll]	 - frameview.cpp:2564	WebCore::FrameView::windowClipRect(bool)
0x67258bde	 [chrome.dll]	 - frameview.cpp:2587	WebCore::FrameView::windowClipRectForFrameOwner(WebCore::HTMLFrameOwnerElement const *,bool)
0x67cde64f	 [chrome.dll]	 - webplugincontainerimpl.cpp:718	WebKit::WebPluginContainerImpl::windowClipRect()
0x67cdee3f	 [chrome.dll]	 - webplugincontainerimpl.cpp:697	WebKit::WebPluginContainerImpl::calculateGeometry(WebCore::IntRect const &amp;,WebCore::IntRect &amp;,WebCore::IntRect &amp;,WTF::Vector&lt;WebCore::IntRect,0&gt; &amp;)
0x67cdef4e	 [chrome.dll]	 - webplugincontainerimpl.cpp:326	WebKit::WebPluginContainerImpl::reportGeometry()
0x67cde32c	 [chrome.dll]	 - webplugincontainerimpl.cpp:239	WebKit::WebPluginContainerImpl::setParent(WebCore::ScrollView *)
0x66c64205	 [chrome.dll]	 - scrollview.cpp:74	WebCore::ScrollView::addChild(WTF::PassRefPtr&lt;WebCore::Widget&gt;)
0x671dd73f	 [chrome.dll]	 - renderwidget.cpp:91	WebCore::moveWidgetToParentSoon
0x671ddddb	 [chrome.dll]	 - renderwidget.cpp:219	WebCore::RenderWidget::setWidget(WTF::PassRefPtr&lt;WebCore::Widget&gt;)
0x671d673a	 [chrome.dll]	 - renderpart.cpp:55	WebCore::RenderPart::setWidget(WTF::PassRefPtr&lt;WebCore::Widget&gt;)
0x675a56f2	 [chrome.dll]	 - subframeloader.cpp:383	WebCore::SubframeLoader::loadPlugin(WebCore::HTMLPlugInImageElement *,WebCore::KURL const &amp;,WTF::String const &amp;,WTF::Vector&lt;WTF::String,0&gt; const &amp;,WTF::Vector&lt;WTF::String,0&gt; const &amp;,bool)
0x675a4918	 [chrome.dll]	 - subframeloader.cpp:131	WebCore::SubframeLoader::requestPlugin(WebCore::HTMLPlugInImageElement *,WebCore::KURL const &amp;,WTF::String const &amp;,WTF::Vector&lt;WTF::String,0&gt; const &amp;,WTF::Vector&lt;WTF::String,0&gt; const &amp;,bool)
0x675a4a43	 [chrome.dll]	 - subframeloader.cpp:151	WebCore::SubframeLoader::requestObject(WebCore::HTMLPlugInImageElement *,WTF::String const &amp;,WTF::AtomicString const &amp;,WTF::String const &amp;,WTF::Vector&lt;WTF::String,0&gt; const &amp;,WTF::Vector&lt;WTF::String,0&gt; const &amp;)
0x675efa5f	 [chrome.dll]	 - htmlembedelement.cpp:177	WebCore::HTMLEmbedElement::updateWidget(WebCore::PluginCreationOption)
0x67258913	 [chrome.dll]	 - frameview.cpp:2290	WebCore::FrameView::updateWidget(WebCore::RenderEmbeddedObject *)
0x66b599f7	 [chrome.dll]	 - frameview.cpp:2323	WebCore::FrameView::updateWidgets()
0x66b56390	 [chrome.dll]	 - frameview.cpp:2376	WebCore::FrameView::performPostLayoutTasks()
0x66b396e2	 [chrome.dll]	 - frameview.cpp:1166	WebCore::FrameView::layout(bool)
0x67258732	 [chrome.dll]	 - frameview.cpp:2029	WebCore::FrameView::layoutTimerFired(WebCore::Timer&lt;WebCore::FrameView&gt; *)
0x66e8815b	 [chrome.dll]	 - timer.h:100	WebCore::Timer&lt;WebCore::CachedImage&gt;::fired()
0x66b68a42	 [chrome.dll]	 - threadtimers.cpp:115	WebCore::ThreadTimers::sharedTimerFiredInternal()
0x66b688fc	 [chrome.dll]	 - threadtimers.cpp:93	WebCore::ThreadTimers::sharedTimerFired()
0x66a0ebde	 [chrome.dll]	 - timer.cc:179	base::Timer::RunScheduledTask()
0x66a0eb49	 [chrome.dll]	 - timer.cc:44	base::BaseTimerTaskInternal::Run()
0x669c772d	 [chrome.dll]	 - message_loop.cc:458	MessageLoop::RunTask(base::PendingTask const &amp;)
0x669c6c44	 [chrome.dll]	 - message_loop.cc:685	MessageLoop::DoDelayedWork(base::TimeTicks *)
0x669d81cc	 [chrome.dll]	 - message_pump_default.cc:32	base::MessagePumpDefault::Run(base::MessagePump::Delegate *)
0x669c5fa6	 [chrome.dll]	 - message_loop.cc:390	MessageLoop::RunHandler()
0x669c5f54	 [chrome.dll]	 - message_loop.cc:300	MessageLoop::Run()
0x66a48893	 [chrome.dll]	 - renderer_main.cc:271	RendererMain(content::MainFunctionParams const &amp;)
0x669c242b	 [chrome.dll]	 - content_main_runner.cc:292	`anonymous namespace&apos;::RunNamedProcessTypeMain(std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; const &amp;,content::MainFunctionParams const &amp;,content::ContentMainDelegate *)
0x669c23b0	 [chrome.dll]	 - content_main_runner.cc:550	`anonymous namespace&apos;::ContentMainRunnerImpl::Run()
0x669b44d7	 [chrome.dll]	 - content_main.cc:35	content::ContentMain(HINSTANCE__ *,sandbox::SandboxInterfaceInfo *,content::ContentMainDelegate *)
0x669b4462	 [chrome.dll]	 - chrome_main.cc:28	ChromeMain
0x00ee7fa1	 [chrome.exe]	 - client_util.cc:423	MainDllLoader::Launch(HINSTANCE__ *,sandbox::SandboxInterfaceInfo *)
0x00ee72a4	 [chrome.exe]	 - chrome_exe_main_win.cc:31	RunChrome(HINSTANCE__ *)
0x00ee730f	 [chrome.exe]	 - chrome_exe_main_win.cc:47	wWinMain
0x00f07788	 [chrome.exe]	 - crt0.c:263	__tmainCRTStartup
0x75723676	 [kernel32.dll]	 + 0x00013676]	BaseThreadInitThunk
0x77d19f41	 [ntdll.dll]	 + 0x00039f41]	__RtlUserThreadStart
0x77d19f14	 [ntdll.dll]	 + 0x00039f14]	_RtlUserThreadStart

Looking at the error and the code, it seems like it is possible for windowClipRect to get a NULL parentView. I don&apos;t have a reproduction case unfortunately.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>620020</commentid>
    <comment_count>1</comment_count>
      <attachid>141050</attachid>
    <who name="Julien Chaffraix">jchaffraix</who>
    <bug_when>2012-05-09 16:41:32 -0700</bug_when>
    <thetext>Created attachment 141050
Proposed blind fix. Added a NULL-check.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>620047</commentid>
    <comment_count>2</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2012-05-09 17:04:31 -0700</bug_when>
    <thetext>I&apos;m not a good reviewer for this.  Maybe Adam is?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>620091</commentid>
    <comment_count>3</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2012-05-09 17:29:00 -0700</bug_when>
    <thetext>Have you tried using the beforeload event on the &lt;object&gt; element to screw around with the DOM below FrameView::updateWidget ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>620092</commentid>
    <comment_count>4</comment_count>
      <attachid>141050</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-05-09 17:29:16 -0700</bug_when>
    <thetext>Comment on attachment 141050
Proposed blind fix. Added a NULL-check.

Why is something calling windowClipRect w/o this being a child FrameView?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>620093</commentid>
    <comment_count>5</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-05-09 17:30:18 -0700</bug_when>
    <thetext>Is WebKit::WebPluginContainerImpl::setParent calling this before actually setting the parent?  Is somethign else executing to remove this widget from the hierarchy before this executes?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>620583</commentid>
    <comment_count>6</comment_count>
      <attachid>141050</attachid>
    <who name="Julien Chaffraix">jchaffraix</who>
    <bug_when>2012-05-10 07:56:57 -0700</bug_when>
    <thetext>Comment on attachment 141050
Proposed blind fix. Added a NULL-check.

(In reply to comment #3)
&gt; Have you tried using the beforeload event on the &lt;object&gt; element to screw around with the DOM below FrameView::updateWidget ?

I haven&apos;t as I didn&apos;t know this code enough to create a test on the spot. Let me regroup and come back to you with hopefully a test case!

&gt; Is WebKit::WebPluginContainerImpl::setParent calling this before actually setting the parent?  Is somethign else executing to remove this widget from the hierarchy before this executes?

It&apos;s difficult for me to answer any question without a reproduction (I don&apos;t hide it&apos;s a blind fix based on the stack-trace). My understanding is that it&apos;s possible for |parentView| to be NULL (as mentioned in Document.h). The code prior to r116371 was doing NULL checking the enclosingLayer() which may explain how they go away with that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>623200</commentid>
    <comment_count>7</comment_count>
    <who name="Julien Chaffraix">jchaffraix</who>
    <bug_when>2012-05-14 12:18:01 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; (From update of attachment 141050 [details])
&gt; (In reply to comment #3)
&gt; &gt; Have you tried using the beforeload event on the &lt;object&gt; element to screw around with the DOM below FrameView::updateWidget ?
&gt; 
&gt; I haven&apos;t as I didn&apos;t know this code enough to create a test on the spot. Let me regroup and come back to you with hopefully a test case!

OK, unfortunately that didn&apos;t help (tried to kill one of our parent FrameView) nor did the Chromium crash reports so far.

&gt; &gt; Is WebKit::WebPluginContainerImpl::setParent calling this before actually setting the parent? 

Looking at the code in WebPluginContainerImpl, that&apos;s not the case:

Widget::setParent(view);
if (view)
    reportGeometry();

(the crash is below reportGeometry)

&gt; Is somethign else executing to remove this widget from the hierarchy before this executes?

I wonder about that. This is a big crasher on Youtube but it&apos;s very flaky (no video seems to reproduce the issue more than a couple of times).

This may as well indicate a race condition in the Chromium code or just in WebKit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>623354</commentid>
    <comment_count>8</comment_count>
      <attachid>141050</attachid>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2012-05-14 14:41:54 -0700</bug_when>
    <thetext>Comment on attachment 141050
Proposed blind fix. Added a NULL-check.

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>623361</commentid>
    <comment_count>9</comment_count>
      <attachid>141050</attachid>
    <who name="Julien Chaffraix">jchaffraix</who>
    <bug_when>2012-05-14 14:51:30 -0700</bug_when>
    <thetext>Comment on attachment 141050
Proposed blind fix. Added a NULL-check.

Landed in http://trac.webkit.org/changeset/117005.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>141050</attachid>
            <date>2012-05-09 16:41:32 -0700</date>
            <delta_ts>2012-05-14 14:51:30 -0700</delta_ts>
            <desc>Proposed blind fix. Added a NULL-check.</desc>
            <filename>bug-86035-20120509164131.patch</filename>
            <type>text/plain</type>
            <size>1693</size>
            <attacher name="Julien Chaffra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