<?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>23973</bug_id>
          
          <creation_ts>2009-02-16 08:54:43 -0800</creation_ts>
          <short_desc>Chromium crashes at times when the view is being closed.</short_desc>
          <delta_ts>2009-02-26 11:33:32 -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>Layout and Rendering</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</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="Ananta Iyengar">ananta</reporter>
          <assigned_to name="Ananta Iyengar">ananta</assigned_to>
          <cc>fishd</cc>
    
    <cc>hyatt</cc>
    
    <cc>jon</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>109853</commentid>
    <comment_count>0</comment_count>
    <who name="Ananta Iyengar">ananta</who>
    <bug_when>2009-02-16 08:54:43 -0800</bug_when>
    <thetext>We don&apos;t have a definite reproducible case for this crash. While the crash occurs in Chromium, the callstack suggests that this could in other webkit browsers as well. The callstack is as below:-

This occurs when the view is being closed and the scrollcontents method in the ScrollView object is called. It attempts to call the repaint method on the HostWindow object returned via FrameView::hostWindow. This method can return NULL in scenarios where the frame is NULL, or if the underlying page is destroyed. I think that a NULL check for the return value of the FrameView::hostWindow call is warranted. 

I will submit a patch for this in a bit.

Thread 1 *CRASHED* (EXCEPTION_ACCESS_VIOLATION @0x00000000)

0x62d3789e	 [chrome.dll	 - scrollview.cpp:438]	 WebCore::ScrollView::scrollContents(WebCore::IntSize const &amp;)
0x62d37831	 [chrome.dll	 - scrollview.cpp:420]	 WebCore::ScrollView::updateScrollbars(WebCore::IntSize const &amp;)
0x62d37009	 [chrome.dll	 - scrollview.cpp:116]	 WebCore::ScrollView::setScrollbarModes(WebCore::ScrollbarMode,WebCore::ScrollbarMode)
0x62d5d8e4	 [chrome.dll	 - frameview.cpp:231]	 WebCore::FrameView::resetScrollbars()
0x62d5d7f8	 [chrome.dll	 - frameview.cpp:197]	 WebCore::FrameView::~FrameView()
0x62d5d6d6	 [chrome.dll	 + 0x003ed6d6]	 WebCore::FrameView::`vector deleting destructor&apos;(unsigned int)
0x62e309d8	 [chrome.dll	 - renderpart.cpp:56]	 WebCore::RenderPart::~RenderPart()
0x62e30998	 [chrome.dll	 + 0x004c0998]	 WebCore::RenderPart::`vector deleting destructor&apos;(unsigned int)
0x62d6885f	 [chrome.dll	 - renderobject.cpp:2670]	 WebCore::RenderObject::arenaDelete(WebCore::RenderArena *,void *)
0x62dadd8b	 [chrome.dll	 - renderwidget.cpp:213]	 WebCore::RenderWidget::deref(WebCore::RenderArena *)
0x62dadabc	 [chrome.dll	 - renderwidget.cpp:103]	 WebCore::RenderWidget::destroy()
0x62d18d19	 [chrome.dll	 - node.cpp:1060]	 WebCore::Node::detach()
0x62d55b4c	 [chrome.dll	 - containernode.cpp:593]	 WebCore::ContainerNode::detach()
0x62d55b4c	 [chrome.dll	 - containernode.cpp:593]	 WebCore::ContainerNode::detach()
0x62d55b4c	 [chrome.dll	 - containernode.cpp:593]	 WebCore::ContainerNode::detach()
0x62d55b4c	 [chrome.dll	 - containernode.cpp:593]	 WebCore::ContainerNode::detach()
0x62cfd86b	 [chrome.dll	 - document.cpp:1412]	 WebCore::Document::detach()
0x62ce59d4	 [chrome.dll	 - frame.cpp:217]	 WebCore::Frame::setView(WebCore::FrameView *)
0x62cf23a2	 [chrome.dll	 - frameloader.cpp:3474]	 WebCore::FrameLoader::detachFromParent()
0x62cf22d8	 [chrome.dll	 - frameloader.cpp:3452]	 WebCore::FrameLoader::frameDetached()
0x62cb57a4	 [chrome.dll	 - webview_impl.cc:776]	 WebViewImpl::Close()
0x62984cb2	 [chrome.dll	 - render_widget.cc:639]	 RenderWidget::Close()
0x62984236	 [chrome.dll	 - render_widget.cc:225]	 RenderWidget::OnClose()
0x629803d7	 [chrome.dll	 - ipc_message.h:125]	 IPC::Message::Dispatch&lt;RenderWidget&gt;(IPC::Message const *,RenderWidget *,void ( RenderWidget::*)(void))
0x62984007	 [chrome.dll	 - render_widget.cc:157]	 RenderWidget::OnMessageReceived(IPC::Message const &amp;)
0x62979fc3	 [chrome.dll	 - render_view.cc:400]	 RenderView::OnMessageReceived(IPC::Message const &amp;)
0x62997262	 [chrome.dll	 - message_router.cc:39]	 MessageRouter::RouteMessage(IPC::Message const &amp;)
0x6299723c	 [chrome.dll	 - message_router.cc:30]	 MessageRouter::OnMessageReceived(IPC::Message const &amp;)
0x62976ba4	 [chrome.dll	 - render_thread.cc:174]	 RenderThread::OnMessageReceived(IPC::Message const &amp;)
0x62ae6dab	 [chrome.dll	 - task.h:312]	 RunnableMethod&lt;SafeBrowsingService,void ( SafeBrowsingService::*)(SafeBrowsingService::BlockingPageParam const &amp;),Tuple1&lt;SafeBrowsingService::BlockingPageParam&gt; &gt;::Run()
0x62b56ebc	 [chrome.dll	 - message_loop.cc:308]	 MessageLoop::RunTask(Task *)
0x62b56ef3	 [chrome.dll	 - message_loop.cc:316]	 MessageLoop::DeferOrRunPendingTask(MessageLoop::PendingTask const &amp;)
0x62b57081	 [chrome.dll	 - message_loop.cc:408]	 MessageLoop::DoWork()
0x62b6dccf	 [chrome.dll	 - message_pump_default.cc:50]	 base::MessagePumpDefault::Run(base::MessagePump::Delegate *)
0x62b56d8d	 [chrome.dll	 - message_loop.cc:197]	 MessageLoop::RunInternal()
0x62b56d5a	 [chrome.dll	 - message_loop.cc:180]	 MessageLoop::RunHandler()
0x62b56cfd	 [chrome.dll	 - message_loop.cc:154]	 MessageLoop::Run()
0x62b5cfdf	 [chrome.dll	 - thread.cc:153]	 base::Thread::ThreadMain()
0x62b5a8a9	 [chrome.dll	 - platform_thread_win.cc:26]	 `anonymous namespace&apos;::ThreadFunc(void *)
0x76fb4910	 [kernel32.dll	 + 0x00044910]	 BaseThreadInitThunk
0x7711e4b5	 [ntdll.dll	 + 0x0003e4b5]	 __RtlUserThreadStart
0x7711e488	 [ntdll.dll	 + 0x0003e488]	 _RtlUserThreadStart</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109857</commentid>
    <comment_count>1</comment_count>
      <attachid>27699</attachid>
    <who name="Ananta Iyengar">ananta</who>
    <bug_when>2009-02-16 10:04:13 -0800</bug_when>
    <thetext>Created attachment 27699
Initial attempt at a patch for this issue</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111058</commentid>
    <comment_count>2</comment_count>
    <who name="Jon@Chromium">jon</who>
    <bug_when>2009-02-25 15:47:50 -0800</bug_when>
    <thetext>I need to get this reviewed so we can (hopefully) close the bug.

Also reported in http://code.google.com/p/chromium/issues/detail?id=6319</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111231</commentid>
    <comment_count>3</comment_count>
      <attachid>27699</attachid>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2009-02-26 11:00:27 -0800</bug_when>
    <thetext>Comment on attachment 27699
Initial attempt at a patch for this issue

&gt;Index: WebCore/platform/ScrollView.cpp
...
&gt; void ScrollView::scrollContents(const IntSize&amp; scrollDelta)
&gt; {
&gt;+    if (!hostWindow())
&gt;+      return;
&gt;+

nit: the return statement should be indented by 4 spaces.  R- because
of this.

ScrollView appears to be designed with the assumption that the hostWindow
will never be null, but I can see from the callstack that assumption seems
to be invalid.  So, I think your solution is probably the best we can do.

Are any of the other ScrollView methods reachable from ~FrameView?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111239</commentid>
    <comment_count>4</comment_count>
      <attachid>28024</attachid>
    <who name="Ananta Iyengar">ananta</who>
    <bug_when>2009-02-26 11:22:54 -0800</bug_when>
    <thetext>Created attachment 28024
Updated patch with the indentation fixed.

The functions in ScrollView.cpp reachable from ~FrameView are as below:-
1. ScrollView::setScrollbarModes which calls into updateScrollbars and ends up   
   in scrollcontents where hostwindow is dereferenced.

2. ScrollView::setHasHorizontalScrollbar and 
   ScrollView::setHasVerticalScrollbar.
   These functions internally call ScrollView::removeChild. They don&apos;t reference
   hostWindow().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111241</commentid>
    <comment_count>5</comment_count>
      <attachid>28024</attachid>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2009-02-26 11:25:09 -0800</bug_when>
    <thetext>Comment on attachment 28024
Updated patch with the indentation fixed.

LGTM</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111246</commentid>
    <comment_count>6</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2009-02-26 11:33:32 -0800</bug_when>
    <thetext>Landed as http://trac.webkit.org/changeset/41260</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>27699</attachid>
            <date>2009-02-16 10:04:13 -0800</date>
            <delta_ts>2009-02-26 11:22:54 -0800</delta_ts>
            <desc>Initial attempt at a patch for this issue</desc>
            <filename>ScrollViewCrash.txt</filename>
            <type>text/plain</type>
            <size>1438</size>
            <attacher name="Ananta Iyengar">ananta</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA0MTAxOSkKKysrIFdlYkNvcmUvQ2hhbm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PT09PT09PT09Ci0tLSBXZWJDb3JlL3BsYXRmb3JtL1Njcm9sbFZpZXcuY3BwCShyZXZpc2lvbiA0
MTAxOSkKKysrIFdlYkNvcmUvcGxhdGZvcm0vU2Nyb2xsVmlldy5jcHAJKHdvcmtpbmcgY29weSkK
QEAgLTQzNiw2ICs0MzYsOSBAQCBjb25zdCBpbnQgcGFuSWNvblNpemVMZW5ndGggPSAyMDsKIAog
dm9pZCBTY3JvbGxWaWV3OjpzY3JvbGxDb250ZW50cyhjb25zdCBJbnRTaXplJiBzY3JvbGxEZWx0
YSkKIHsKKyAgICBpZiAoIWhvc3RXaW5kb3coKSkKKyAgICAgIHJldHVybjsKKwogICAgIC8vIFNp
bmNlIHNjcm9sbGluZyBpcyBkb3VibGUgYnVmZmVyZWQsIHdlIHdpbGwgYmUgYmxpdHRpbmcgdGhl
IHNjcm9sbCB2aWV3J3MgaW50ZXJzZWN0aW9uCiAgICAgLy8gd2l0aCB0aGUgY2xpcCByZWN0IGV2
ZXJ5IHRpbWUgdG8ga2VlcCBpdCBzbW9vdGguCiAgICAgSW50UmVjdCBjbGlwUmVjdCA9IHdpbmRv
d0NsaXBSZWN0KCk7Cg==
</data>
<flag name="review"
          id="13452"
          type_id="1"
          status="-"
          setter="fishd"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>28024</attachid>
            <date>2009-02-26 11:22:54 -0800</date>
            <delta_ts>2009-02-26 11:25:09 -0800</delta_ts>
            <desc>Updated patch with the indentation fixed.</desc>
            <filename>ScrollViewCrash.txt</filename>
            <type>text/plain</type>
            <size>1492</size>
            <attacher name="Ananta Iyengar">ananta</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nDQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQotLS0gV2ViQ29yZS9DaGFuZ2VM
b2cJKHJldmlzaW9uI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sYXRmb3JtL1Njcm9sbFZpZXcuY3BwDQo9PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQotLS0gV2Vi
Q29yZS9wbGF0Zm9ybS9TY3JvbGxWaWV3LmNwcAkocmV2aXNpb24gNDEwMTkpDQorKysgV2ViQ29y
ZS9wbGF0Zm9ybS9TY3JvbGxWaWV3LmNwcAkod29ya2luZyBjb3B5KQ0KQEAgLTQzNiw2ICs0MzYs
OSBAQCBjb25zdCBpbnQgcGFuSWNvblNpemVMZW5ndGggPSAyMDsNCiANCiB2b2lkIFNjcm9sbFZp
ZXc6OnNjcm9sbENvbnRlbnRzKGNvbnN0IEludFNpemUmIHNjcm9sbERlbHRhKQ0KIHsNCisgICAg
aWYgKCFob3N0V2luZG93KCkpDQorICAgICAgICByZXR1cm47DQorDQogICAgIC8vIFNpbmNlIHNj
cm9sbGluZyBpcyBkb3VibGUgYnVmZmVyZWQsIHdlIHdpbGwgYmUgYmxpdHRpbmcgdGhlIHNjcm9s
bCB2aWV3J3MgaW50ZXJzZWN0aW9uDQogICAgIC8vIHdpdGggdGhlIGNsaXAgcmVjdCBldmVyeSB0
aW1lIHRvIGtlZXAgaXQgc21vb3RoLg0KICAgICBJbnRSZWN0IGNsaXBSZWN0ID0gd2luZG93Q2xp
cFJlY3QoKTsNCg==
</data>
<flag name="review"
          id="13658"
          type_id="1"
          status="+"
          setter="fishd"
    />
          </attachment>
      

    </bug>

</bugzilla>