<?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>22080</bug_id>
          
          <creation_ts>2008-11-04 23:49:03 -0800</creation_ts>
          <short_desc>CRASH at Scrollbar::invalidateRect due to null m_client</short_desc>
          <delta_ts>2008-11-05 10:41:41 -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>Platform</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.megajogos.com.br/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>Critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Darin Fisher (:fishd, Google)">fishd</reporter>
          <assigned_to name="Darin Fisher (:fishd, Google)">fishd</assigned_to>
          <cc>dave</cc>
    
    <cc>hyatt</cc>
    
    <cc>mihnea</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>97657</commentid>
    <comment_count>0</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2008-11-04 23:49:03 -0800</bug_when>
    <thetext>CRASH at Scrollbar::invalidateRect due to null m_client

I just updated Chrome to use the latest Scrollbar code, and our distributed reliability test is hitting a crash where m_client is null.  The stack trace looks like so:

[scrollbar.cpp:443] WebCore::Scrollbar::invalidateRect(WebCore::IntRect const &amp;)
[scrollbarthemecomposite.cpp:233] WebCore::ScrollbarThemeComposite::invalidatePart(WebCore::Scrollbar *,WebCore::ScrollbarPart)
[scrollbar.cpp:292] WebCore::Scrollbar::setHoveredPart(WebCore::ScrollbarPart)
[scrollbar.cpp:342] WebCore::Scrollbar::mouseExited()
[eventhandler.cpp:1199] WebCore::EventHandler::handleMouseMoveEvent(WebCore::PlatformMouseEvent const &amp;,WebCore::HitTestResult *)
[eventhandler.cpp:1134] WebCore::EventHandler::mouseMoved(WebCore::PlatformMouseEvent const &amp;)

I&apos;m guessing that there must be a code path that leads to setClient(0) being called on the same Scrollbar that EventHandler&apos;s m_lastScrollbarUnderMouse points to.

I suspect that the right fix involves nulling m_lastScrollbarUnderMouse at the right time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97658</commentid>
    <comment_count>1</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2008-11-04 23:51:44 -0800</bug_when>
    <thetext>more readable stack...

[scrollbar.cpp:443]
  Scrollbar::invalidateRect(IntRect const&amp;)
[scrollbarthemecomposite.cpp:233]
  ScrollbarThemeComposite::invalidatePart(Scrollbar*, ScrollbarPart)
[scrollbar.cpp:292]
  Scrollbar::setHoveredPart(ScrollbarPart)
[scrollbar.cpp:342]
  Scrollbar::mouseExited()
[eventhandler.cpp:1199]
  EventHandler::handleMouseMoveEvent(PlatformMouseEvent const&amp;, HitTestResult*)
[eventhandler.cpp:1134]
  EventHandler::mouseMoved(PlatformMouseEvent const&amp;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97659</commentid>
    <comment_count>2</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2008-11-05 00:22:01 -0800</bug_when>
    <thetext>Our crash data shows that this bug happens frequently on http://www.megajogos.com.br/

I could not manually repro, but one thing I noticed about that site is that it repeatedly creates and destroys a DIV with overflow.  The contents of the widget titled &quot;Megajogos Informa&quot; appears to change over time.  Sometimes the DIV requires scrollbars, and sometimes it does not.

Given the way EventHandler and Scrollbar work (namely that Scrollbar is a reference counted object), I&apos;m beginning to suspect that the right answer is for Scrollbar to null-check all accesses to its m_client.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97660</commentid>
    <comment_count>3</comment_count>
      <attachid>24906</attachid>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2008-11-05 00:36:22 -0800</bug_when>
    <thetext>Created attachment 24906
v1 patch

Simple null checking.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97674</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-11-05 04:47:38 -0800</bug_when>
    <thetext>See also: bug 22074.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97691</commentid>
    <comment_count>5</comment_count>
      <attachid>24906</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2008-11-05 09:19:09 -0800</bug_when>
    <thetext>Comment on attachment 24906
v1 patch

+    return m_client ? m_client-&gt;isActive() : false;

I usually write those using &amp;&amp; rather than ?:, but this seems fine.

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97701</commentid>
    <comment_count>6</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2008-11-05 10:23:41 -0800</bug_when>
    <thetext>I&apos;m happy to change to &amp;&amp;.  That sounds better to me too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97703</commentid>
    <comment_count>7</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2008-11-05 10:25:52 -0800</bug_when>
    <thetext>*** Bug 22074 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97709</commentid>
    <comment_count>8</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2008-11-05 10:41:41 -0800</bug_when>
    <thetext>http://trac.webkit.org/changeset/38130</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>24906</attachid>
            <date>2008-11-05 00:36:22 -0800</date>
            <delta_ts>2008-11-05 09:19:09 -0800</delta_ts>
            <desc>v1 patch</desc>
            <filename>null_check_1.diff</filename>
            <type>text/plain</type>
            <size>1291</size>
            <attacher name="Darin Fisher (:fishd, Google)">fishd</attacher>
            
              <data encoding="base64">SW5kZXg6IENoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBDaGFuZ2VMb2cJKHJldmlzaW9uIDM4MTE5
KQorKysgQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTQgQEAKKzIwMDgtMTEt
MDUgIERhcmluIEZpc2hlciAgPGRhcmluQGNocm9taXVtLm9yZz4KKworICAgICAgICBSZXZpZXdl
ZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBDUkFTSCBhdCBTY3JvbGxiYXI6OmludmFs
aWRhdGVSZWN0IGR1ZSB0byBudWxsIG1fY2xpZW50CisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJr
aXQub3JnL3Nob3dfYnVnLmNnaT9pZD0yMjA4MAorCisgICAgICAgICogcGxhdGZvcm0vU2Nyb2xs
YmFyLmNwcDoKKyAgICAgICAgKFdlYkNvcmU6OlNjcm9sbGJhcjo6aXNXaW5kb3dBY3RpdmUpOgor
ICAgICAgICAoV2ViQ29yZTo6U2Nyb2xsYmFyOjppbnZhbGlkYXRlUmVjdCk6CisKIDIwMDgtMTEt
MDQgIENhbWVyb24gWndhcmljaCAgPHp3YXJpY2hAYXBwbGUuY29tPgogCiAgICAgICAgIFJ1YmJl
ci1zdGFtcGVkIGJ5IFNhbSBXZWluaWcuCkluZGV4OiBwbGF0Zm9ybS9TY3JvbGxiYXIuY3BwCj09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT0KLS0tIHBsYXRmb3JtL1Njcm9sbGJhci5jcHAJKHJldmlzaW9uIDM4MTE5KQorKysg
cGxhdGZvcm0vU2Nyb2xsYmFyLmNwcAkod29ya2luZyBjb3B5KQpAQCAtNDMzLDE0ICs0MzMsMTUg
QEAgdm9pZCBTY3JvbGxiYXI6OnNldEVuYWJsZWQoYm9vbCBlKQogCiBib29sIFNjcm9sbGJhcjo6
aXNXaW5kb3dBY3RpdmUoKSBjb25zdAogewotICAgIHJldHVybiBtX2NsaWVudC0+aXNBY3RpdmUo
KTsKKyAgICByZXR1cm4gbV9jbGllbnQgPyBtX2NsaWVudC0+aXNBY3RpdmUoKSA6IGZhbHNlOwog
fQogIAogdm9pZCBTY3JvbGxiYXI6OmludmFsaWRhdGVSZWN0KGNvbnN0IEludFJlY3QmIHJlY3Qp
CiB7CiAgICAgaWYgKHN1cHByZXNzSW52YWxpZGF0aW9uKCkpCiAgICAgICAgIHJldHVybjsKLSAg
ICBtX2NsaWVudC0+aW52YWxpZGF0ZVNjcm9sbGJhclJlY3QodGhpcywgcmVjdCk7CisgICAgaWYg
KG1fY2xpZW50KQorICAgICAgICBtX2NsaWVudC0+aW52YWxpZGF0ZVNjcm9sbGJhclJlY3QodGhp
cywgcmVjdCk7CiB9CiAKIFBsYXRmb3JtTW91c2VFdmVudCBTY3JvbGxiYXI6OnRyYW5zZm9ybUV2
ZW50KGNvbnN0IFBsYXRmb3JtTW91c2VFdmVudCYgZXZlbnQpCg==
</data>
<flag name="review"
          id="11421"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>