<?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>27163</bug_id>
          
          <creation_ts>2009-07-10 16:33:12 -0700</creation_ts>
          <short_desc>Fix memory leak in V8 bindings</short_desc>
          <delta_ts>2009-07-13 02:33:11 -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>WebCore JavaScript</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</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>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mads Ager">ager</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>dglazkov</cc>
    
    <cc>eric</cc>
    
    <cc>levin</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>131007</commentid>
    <comment_count>0</comment_count>
    <who name="Mads Ager">ager</who>
    <bug_when>2009-07-10 16:33:12 -0700</bug_when>
    <thetext>Reinitializing the context when clearing the V8 proxy for navigation makes us hold on to a context object per frame that we should not hold on to.  Reinitialization is not necessary.

When updating the document wrapper cache, we check that the global object handle is not empty, we should be checking the context.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>131008</commentid>
    <comment_count>1</comment_count>
      <attachid>32591</attachid>
    <who name="Mads Ager">ager</who>
    <bug_when>2009-07-10 16:34:15 -0700</bug_when>
    <thetext>Created attachment 32591
patch to avoid leaking contexts</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>131095</commentid>
    <comment_count>2</comment_count>
      <attachid>32591</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2009-07-10 23:30:41 -0700</bug_when>
    <thetext>Comment on attachment 32591
patch to avoid leaking contexts

These seem like two independent changes, but that&apos;s ok.  I don&apos;t understand why calling initContextIfNeeded() in clearForNavigation() leads to a leak, but it makes sense that this isn&apos;t needed because all the other entry points are super excited about making sure the context is initialized before they use it.

I&apos;m r+ing this, but it would be helpful for Dimitri to give his opinion as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>131109</commentid>
    <comment_count>3</comment_count>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2009-07-11 08:28:16 -0700</bug_when>
    <thetext>I am pretty sure this will work, but please make sure this doesn&apos;t break any layout tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>131115</commentid>
    <comment_count>4</comment_count>
    <who name="Mads Ager">ager</who>
    <bug_when>2009-07-11 10:23:20 -0700</bug_when>
    <thetext>I ran all layout tests in both release and debug mode before uploading the patch and saw no new failures with this change.

Adam, Dimitri, could one of you land this patch for me?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>131117</commentid>
    <comment_count>5</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2009-07-11 10:49:13 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; Adam, Dimitri, could one of you land this patch for me?

Sure, but we should wait for the canary to compile before landing this so we can see if there are regressions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>131279</commentid>
    <comment_count>6</comment_count>
    <who name="David Levin">levin</who>
    <bug_when>2009-07-13 02:18:50 -0700</bug_when>
    <thetext>A note for the future: Please make sure to put a link to the bug in the changelog.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>131281</commentid>
    <comment_count>7</comment_count>
    <who name="David Levin">levin</who>
    <bug_when>2009-07-13 02:33:11 -0700</bug_when>
    <thetext>Committed as http://trac.webkit.org/changeset/45797</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>32591</attachid>
            <date>2009-07-10 16:34:15 -0700</date>
            <delta_ts>2009-07-10 23:30:41 -0700</delta_ts>
            <desc>patch to avoid leaking contexts</desc>
            <filename>context-leak.txt</filename>
            <type>text/plain</type>
            <size>1648</size>
            <attacher name="Mads Ager">ager</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA0NTczMSkKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTggQEAKKzIwMDktMDctMTAgIE1hZHMgQWdlciAgPGFnZXJAY2hyb21pdW0ub3Jn
PgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgIEZpeCBt
ZW1vcnkgbGVhayBpbiB0aGUgVjggYmluZGluZyBsYXllci4gUmVpbml0aWFsaXppbmcgdGhlCisg
ICAgICAgIGNvbnRleHQgaXMgbm90IG5lY2Vzc2FyeSB3aGVuIGNsZWFyaW5nIHRoZSBwcm94eSBm
b3IgbmF2aWdhdGlvbgorICAgICAgICBhbmQgaXQgd2lsbCBsZWFkIHVzIHRvIGhvbGQgb24gdG8g
YW4gZW1wdHkgY29udGV4dCBmb3IgZWFjaCBmcmFtZS4KKworICAgICAgICBUZXN0IGZvciBlbXB0
eSBjb250ZXh0IGluc3RlYWQgb2YgZW1wdHkgZ2xvYmFsIG9iamVjdCBoYW5kbGUgd2hlbgorICAg
ICAgICB1cGRhdGluZyB0aGUgZG9jdW1lbnQgZm9yIGEgY29udGV4dC4KKwor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1fZ2xvYmFsLklzRW1wdHkoKSkgewotICAgICAgICBBU1NFUlQobV9jb250ZXh0Lklz
RW1wdHkoKSk7CisgICAgaWYgKG1fY29udGV4dC5Jc0VtcHR5KCkpIAogICAgICAgICByZXR1cm47
Ci0gICAgfQogCiAgICAgLy8gV2UgaGF2ZSBhIG5ldyBkb2N1bWVudCBhbmQgd2UgbmVlZCB0byB1
cGRhdGUgdGhlIGNhY2hlLgogICAgIHVwZGF0ZURvY3VtZW50V3JhcHBlckNhY2hlKCk7Cg==
</data>
<flag name="review"
          id="17008"
          type_id="1"
          status="+"
          setter="abarth"
    />
          </attachment>
      

    </bug>

</bugzilla>