<?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>21057</bug_id>
          
          <creation_ts>2008-09-24 06:48:02 -0700</creation_ts>
          <short_desc>Crash in RegisterID::deref() running fast/canvas/canvas-putImageData.html</short_desc>
          <delta_ts>2008-09-24 10:54:19 -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>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</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>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexey Proskuryakov">ap</reporter>
          <assigned_to name="Geoffrey Garen">ggaren</assigned_to>
          <cc>ggaren</cc>
    
    <cc>oliver</cc>
    
    <cc>zwarich</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>92512</commentid>
    <comment_count>0</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-09-24 06:48:02 -0700</bug_when>
    <thetext>Reliably crashes under GuardMalloc:

run-webkit-tests -g fast/canvas/canvas-putImageData.html

Thread 0 Crashed:
0   com.apple.JavaScriptCore      	0x004569c8 JSC::RegisterID::deref() + 16 (RegisterID.h:91)
1   com.apple.JavaScriptCore      	0x00459ad9 WTF::RefPtr&lt;JSC::RegisterID&gt;::~RefPtr() + 31
2   com.apple.JavaScriptCore      	0x00490b8e JSC::CodeGenerator::~CodeGenerator() + 194
3   com.apple.JavaScriptCore      	0x00446098 JSC::ProgramNode::generateCode(JSC::ScopeChainNode*) + 430 (nodes.cpp:1851)
4   com.apple.JavaScriptCore      	0x004ca159 JSC::ProgramNode::byteCode(JSC::ScopeChainNode*) + 43 (nodes.h:2205)
5   com.apple.JavaScriptCore      	0x004b7a52 JSC::Machine::execute(JSC::ProgramNode*, JSC::ExecState*, JSC::ScopeChainNode*, JSC::JSObject*, JSC::JSValue**) + 62 (Machine.cpp:885)
6   com.apple.JavaScriptCore      	0x00442927 JSC::Interpreter::evaluate(JSC::ExecState*, JSC::ScopeChain&amp;, JSC::UString const&amp;, int, WTF::PassRefPtr&lt;JSC::SourceProvider&gt;, JSC::JSValue*) + 427 (interpreter.cpp:83)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92514</commentid>
    <comment_count>1</comment_count>
    <who name="Cameron Zwarich (cpst)">zwarich</who>
    <bug_when>2008-09-24 07:01:04 -0700</bug_when>
    <thetext>This is likely caused by r36821, since that is where the only RefPtr&lt;RegisterID&gt; instance variable for CodeGenerator was defined:

http://trac.webkit.org/changeset/36821
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92518</commentid>
    <comment_count>2</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2008-09-24 07:57:36 -0700</bug_when>
    <thetext>Ah, looks like the RefPtr destructor runs after the SegmentedVector destructor. Should be easy to fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92528</commentid>
    <comment_count>3</comment_count>
      <attachid>23750</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2008-09-24 08:38:17 -0700</bug_when>
    <thetext>Created attachment 23750
patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92529</commentid>
    <comment_count>4</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2008-09-24 08:39:20 -0700</bug_when>
    <thetext>I haven&apos;t been able to verify this patch with the original test case, because DRT with GuardMalloc crashes in LaunchServices on my machine. However, I did verify that this patch fixes the destructor order.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92532</commentid>
    <comment_count>5</comment_count>
      <attachid>23750</attachid>
    <who name="Cameron Zwarich (cpst)">zwarich</who>
    <bug_when>2008-09-24 09:02:43 -0700</bug_when>
    <thetext>Comment on attachment 23750
patch

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92553</commentid>
    <comment_count>6</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2008-09-24 10:54:19 -0700</bug_when>
    <thetext>Committed revision 36853.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>23750</attachid>
            <date>2008-09-24 08:38:17 -0700</date>
            <delta_ts>2008-09-24 09:02:43 -0700</delta_ts>
            <desc>patch</desc>
            <filename>ro.txt</filename>
            <type>text/plain</type>
            <size>1440</size>
            <attacher name="Geoffrey Garen">ggaren</attacher>
            
              <data encoding="base64">SW5kZXg6IENoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBDaGFuZ2VMb2cJKHJldmlzaW9uIDM2ODQ4
KQorKysgQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTQgQEAKKzIwMDgtMDkt
MjQgIEdlb2ZmcmV5IEdhcmVuICA8Z2dhcmVuQGFwcGxlLmNvbT4KKworICAgICAgICBSZXZpZXdl
ZCBieSBOT0JPRFkgKE9PUFMhKS4KKyAgICAgICAgCisgICAgICAgIEZpeGVkIGh0dHBzOi8vYnVn
cy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0yMTA1NworICAgICAgICBDcmFzaCBpbiBSZWdp
c3RlcklEOjpkZXJlZigpIHJ1bm5pbmcgZmFzdC9jYW52YXMvY2FudmFzLXB1dEltYWdlR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AgIFNlZ21lbnRlZFZlY3RvcjxSZWdpc3RlcklELCA1MTI+IG1fZ2xvYmFsczsK
ICAgICAgICAgU2VnbWVudGVkVmVjdG9yPExhYmVsSUQsIDUxMj4gbV9sYWJlbHM7CisgICAgICAg
IFJlZlB0cjxSZWdpc3RlcklEPiBtX2xhc3RDb25zdGFudDsKICAgICAgICAgaW50IG1fZmluYWxs
eURlcHRoOwogICAgICAgICBpbnQgbV9keW5hbWljU2NvcGVEZXB0aDsKICAgICAgICAgQ29kZVR5
cGUgbV9jb2RlVHlwZTsK
</data>
<flag name="review"
          id="10676"
          type_id="1"
          status="+"
          setter="zwarich"
    />
          </attachment>
      

    </bug>

</bugzilla>