<?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>23212</bug_id>
          
          <creation_ts>2009-01-09 13:03:07 -0800</creation_ts>
          <short_desc>Crash in HTMLCanvasElement</short_desc>
          <delta_ts>2009-04-07 06:39:09 -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>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</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>P1</priority>
          <bug_severity>Critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mike Belshe">mbelshe</reporter>
          <assigned_to name="Mike Belshe">mbelshe</assigned_to>
          <cc>darin</cc>
    
    <cc>eric</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>105045</commentid>
    <comment_count>0</comment_count>
    <who name="Mike Belshe">mbelshe</who>
    <bug_when>2009-01-09 13:03:07 -0800</bug_when>
    <thetext>Attached is a simple web page which can crash webkit.  The problem is a null-dereference problem when we can&apos;t create the ImageBuffer.  On Chromium, this is fairly easy to reproduce.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105046</commentid>
    <comment_count>1</comment_count>
      <attachid>26571</attachid>
    <who name="Mike Belshe">mbelshe</who>
    <bug_when>2009-01-09 13:04:06 -0800</bug_when>
    <thetext>Created attachment 26571
The test page which can crash

Crashing is somewhat platform dependent, as it requires a case where the ImageBuffer::create() call fails.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105048</commentid>
    <comment_count>2</comment_count>
      <attachid>26572</attachid>
    <who name="Mike Belshe">mbelshe</who>
    <bug_when>2009-01-09 13:13:44 -0800</bug_when>
    <thetext>Created attachment 26572
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105050</commentid>
    <comment_count>3</comment_count>
      <attachid>26572</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-01-09 13:17:10 -0800</bug_when>
    <thetext>Comment on attachment 26572
Patch

The change looks great.  Is there a way to make a LayoutTest for this for run-webkit-tests?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105053</commentid>
    <comment_count>4</comment_count>
      <attachid>26572</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-01-09 13:27:24 -0800</bug_when>
    <thetext>Comment on attachment 26572
Patch

Code change looks good.

How did you discover this bug? Can you write a regression test?

Normally we require a regression test for every bug fix unless there&apos;s a reason that&apos;s impractical.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105135</commentid>
    <comment_count>5</comment_count>
      <attachid>26572</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-01-10 14:36:27 -0800</bug_when>
    <thetext>Comment on attachment 26572
Patch

For now, review- because of the lack of a regression test.

If it&apos;s not possible to make one, please explain why in the change log and put a new patch up for review.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105397</commentid>
    <comment_count>6</comment_count>
    <who name="Jon@Chromium">jon</who>
    <bug_when>2009-01-12 14:44:59 -0800</bug_when>
    <thetext>Filed in Chromium as http://code.google.com/p/chromium/issues/detail?id=5452</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109504</commentid>
    <comment_count>7</comment_count>
    <who name="Mike Belshe">mbelshe</who>
    <bug_when>2009-02-12 10:36:54 -0800</bug_when>
    <thetext>Sorry for not having had time to get the regression test yet; the attached page reproduces the problem.  I&apos;ll get to this eventually; I think the fix is simple enough it could go as-is.  If someone else wants to take a shot at the layout test in the interim, please do.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111552</commentid>
    <comment_count>8</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-02-27 14:27:11 -0800</bug_when>
    <thetext>*** Bug 24209 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116589</commentid>
    <comment_count>9</comment_count>
      <attachid>26572</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-04-06 01:22:57 -0700</bug_when>
    <thetext>Comment on attachment 26572
Patch

I recommend we land this w/o test case.  I just attempted to make one and found bug 25055.  The test case I&apos;ve attached to bug 25055 could possibly catch this on some platforms.

This exact crash is sorta protected against by 
IntSize HTMLCanvasElement::convertLogicalToDevice(const FloatSize&amp; logicalSize) const

which makes sure that logicalSize is &lt; MaxCanvasSize.  however testing max canvas size (as I did in bug 25055) reveals that we fail in other parts of the code (making it difficult to test for a crash here on platforms that might fail earlier than CG does.

Mike, since I can never remember if you have commit-bit or not, I&apos;ll land this, with additional information in the ChangeLog about why a test case could not be created.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116757</commentid>
    <comment_count>10</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-04-07 06:39:09 -0700</bug_when>
    <thetext>http://trac.webkit.org/changeset/42236</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>26571</attachid>
            <date>2009-01-09 13:04:06 -0800</date>
            <delta_ts>2009-01-09 13:04:06 -0800</delta_ts>
            <desc>The test page which can crash</desc>
            <filename>reduction.html</filename>
            <type>text/html</type>
            <size>958</size>
            <attacher name="Mike Belshe">mbelshe</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBYSFRNTCAxLjEvL0VOIiAiaHR0cDov
L3d3dy53My5vcmcvVFIveGh0bWwxMS9E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95YWxwZWRvYy5nb29nbGVwYWdlcy5jb20vMS5qcGciIGFsdD0iaW1hZ2UgMSIg
aWQ9ImltZzEiLz4NCjxici8+PGJyIC8+DQoNCjwvYm9keT4NCjwvaHRtbD4NCg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>26572</attachid>
            <date>2009-01-09 13:13:44 -0800</date>
            <delta_ts>2009-04-06 01:22:57 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>patch</filename>
            <type>text/plain</type>
            <size>1452</size>
            <attacher name="Mike Belshe">mbelshe</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiAzOTc1NykKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTYgQEAKKzIwMDktMDEtMDkgIE1pa2UgQmVsc2hlIDxtaWtlQGJlbHNoZS5jb20+
CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgCisgICAg
ICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0yMzIxMgorICAgICAg
ICBIVE1MQ2FudmFzRWxlbWVudCBjcmFzaCB3aGVuIEltYWdlQnVmZmVyIGNyZWF0aW9uIGZhaWxz
LgorICAgICAgICAKKyAgICAgICAgQ2hlY2sgZm9yIG51bGwgYmVmb3JlIHVzaW5nIHRoZSBidWZm
ZXIuCisgICAgICAgIAorICAgICAgICAqIGh0bWwvSFRNTENhbnZhc0VsZW1lbnQuY3BwOgorICAg
ICAgICAoV2ViQ29yZTo6SFRNTENhbnZhc0VsZW1lbnQ6OmNyZWF0ZUltYWdlQnVmZm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JhbnNm
b3Jtcyh0cnVlKTsKKyAgICB9CiB9CiAKIEdyYXBoaWNzQ29udGV4dCogSFRNTENhbnZhc0VsZW1l
bnQ6OmRyYXdpbmdDb250ZXh0KCkgY29uc3QK
</data>
<flag name="review"
          id="12627"
          type_id="1"
          status="+"
          setter="eric"
    />
          </attachment>
      

    </bug>

</bugzilla>