<?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>56645</bug_id>
          
          <creation_ts>2011-03-18 07:55:32 -0700</creation_ts>
          <short_desc>Assertion fires when hidden Find-on-Page matches are encountered in WebKit2</short_desc>
          <delta_ts>2011-03-18 08:31:00 -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>FIXED</resolution>
          
          
          <bug_file_loc>http://amazon.com</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="John Sullivan">sullivan</reporter>
          <assigned_to name="John Sullivan">sullivan</assigned_to>
          <cc>jeffm</cc>
    
    <cc>mitz</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>369624</commentid>
    <comment_count>0</comment_count>
    <who name="John Sullivan">sullivan</who>
    <bug_when>2011-03-18 07:55:32 -0700</bug_when>
    <thetext>To reproduce:


1. visit amazon.com in a client using a debug build of WebKit2
2. use the Find-on-page UI to search for &quot;the&quot;
3. (If necessary), do Find Again a few times

An assertion fires:


ASSERTION FAILED: size

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   com.apple.WebKit2             	0x0000000100312b39 WebKit::SharedMemory::create(unsigned long) + 65 (SharedMemoryMac.cpp:94)
1   com.apple.WebKit2             	0x00000001003b58c7 WebKit::ShareableBitmap::createShareable(WebCore::IntSize const&amp;) + 47 (ShareableBitmap.cpp:51)
2   com.apple.WebKit2             	0x000000010035b397 WebKit::FindController::updateFindIndicator(WebCore::Frame*, bool) + 323 (FindController.cpp:164)
3   com.apple.WebKit2             	0x000000010035b942 WebKit::FindController::findString(WTF::String const&amp;, WebKit::FindOptions, unsigned int) + 378 (FindController.cpp:116)
4   com.apple.WebKit2             	0x000000010027d47c WebKit::WebPage::findString(WTF::String const&amp;, unsigned int, unsigned int) + 48 (WebPage.cpp:1590)
&lt;etc&gt;

updateFindIndicator is computing an empty selection rect, and then trying to create a zero-sized ShareableBitmap, which hits the assertion in SharedMemory::create().

I&apos;ve got a patch forthcoming.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>369625</commentid>
    <comment_count>1</comment_count>
      <attachid>86164</attachid>
    <who name="John Sullivan">sullivan</who>
    <bug_when>2011-03-18 07:59:31 -0700</bug_when>
    <thetext>Created attachment 86164
Patch to bail out earlier for empty selection rect</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>369626</commentid>
    <comment_count>2</comment_count>
    <who name="John Sullivan">sullivan</who>
    <bug_when>2011-03-18 08:01:44 -0700</bug_when>
    <thetext>In radar as 9154276.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>369627</commentid>
    <comment_count>3</comment_count>
    <who name="">mitz</who>
    <bug_when>2011-03-18 08:03:45 -0700</bug_when>
    <thetext>I seem to remember that Jeff Miller fixed a bug like this. Was his fix Windows-specific? Can his change be reverted?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>369633</commentid>
    <comment_count>4</comment_count>
    <who name="John Sullivan">sullivan</who>
    <bug_when>2011-03-18 08:16:05 -0700</bug_when>
    <thetext>I found Jeff&apos;s fix -- it is &lt;http://trac.webkit.org/changeset/77091&gt;.

Jeff&apos;s fix prevented a crash after creating a zero-sized ShareableBitmap in this same updateFindIndicator function. This fix prevents an assertion while trying to create a zero-sized ShareableBitmap. svn blame reveals that the assertion was added after Jeff&apos;s fix, in 77968.

I think both tests are valid. It&apos;s good to bail out as soon as possible by testing for the empty selection rect (my fix). It&apos;s also good to bail out if the attempt to create a ShareableBitmap fails (perhaps there is some failure possibility other than zero-size-ness).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>369640</commentid>
    <comment_count>5</comment_count>
    <who name="John Sullivan">sullivan</who>
    <bug_when>2011-03-18 08:31:00 -0700</bug_when>
    <thetext>Fixed in &lt;http://trac.webkit.org/changeset/81472&gt;.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>86164</attachid>
            <date>2011-03-18 07:59:31 -0700</date>
            <delta_ts>2011-03-18 08:21:17 -0700</delta_ts>
            <desc>Patch to bail out earlier for empty selection rect</desc>
            <filename>findAssertion_patch.txt</filename>
            <type>text/plain</type>
            <size>1623</size>
            <attacher name="John Sullivan">sullivan</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJLaXQyL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
S2l0Mi9DaGFuZ2VMb2cJKHJldmlzaW9uIDgxNDY5KQorKysgU291cmNlL1dlYktpdDIvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTYgQEAKKzIwMTEtMDMtMTggIEpvaG4gU3Vs
bGl2YW4gIDxzdWxsaXZhbkBhcHBsZS5jb20+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZ
IChPT1BTISkuCisKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dp
P2lkPTU2NjQ1CisgICAgICAgIEFzc2VydGlvbiBmaXJlcyB3aGVuIGhpZGRlbiBGaW5kLW9uLVBh
Z2UgbWF0Y2hlcyBhcmUgZW5jb3V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jdGlvblJlY3QgPSBl
bmNsb3NpbmdJbnRSZWN0KHNlbGVjdGVkRnJhbWUtPnNlbGVjdGlvbigpLT5ib3VuZHMoKSk7Cisg
ICAgCisgICAgLy8gU2VsZWN0aW9uIHJlY3QgY2FuIGJlIGVtcHR5IGZvciBtYXRjaGVzIHRoYXQg
YXJlIGN1cnJlbnRseSBvYnNjdXJlZCBmcm9tIHZpZXcuCisgICAgaWYgKHNlbGVjdGlvblJlY3Qu
aXNFbXB0eSgpKQorICAgICAgICByZXR1cm4gZmFsc2U7CiAKICAgICAvLyBXZSB3YW50IHRoZSBz
ZWxlY3Rpb24gcmVjdCBpbiB3aW5kb3cgY29vcmRpbmF0ZXMuCiAgICAgSW50UmVjdCBzZWxlY3Rp
b25SZWN0SW5XaW5kb3dDb29yZGluYXRlcyA9IHNlbGVjdGVkRnJhbWUtPnZpZXcoKS0+Y29udGVu
dHNUb1dpbmRvdyhzZWxlY3Rpb25SZWN0KTsK
</data>
<flag name="review"
          id="78402"
          type_id="1"
          status="+"
          setter="mitz"
    />
          </attachment>
      

    </bug>

</bugzilla>