<?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>114733</bug_id>
          
          <creation_ts>2013-04-17 05:20:32 -0700</creation_ts>
          <short_desc>releaseExecutableMemory() should canonicalize cell liveness data before it scans the GC roots.</short_desc>
          <delta_ts>2013-04-17 09:36:20 -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>Unspecified</rep_platform>
          <op_sys>Unspecified</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="Mark Lam">mark.lam</reporter>
          <assigned_to name="Mark Lam">mark.lam</assigned_to>
          <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>mhahnenberg</cc>
    
    <cc>msaboff</cc>
    
    <cc>oliver</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>877121</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2013-04-17 05:20:32 -0700</bug_when>
    <thetext>Not doing this resulted in a runtime assertion failure due to a MarkedBlock being in the FreeListed state while releaseExecutableMemory() is calling Heap::getConservativeRegisterRoots().  This was encountered while testing script timeout code (which uses releaseExecutableMemory()).

Patch forthcoming.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>877123</commentid>
    <comment_count>1</comment_count>
      <attachid>198500</attachid>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2013-04-17 05:23:12 -0700</bug_when>
    <thetext>Created attachment 198500
the patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>877253</commentid>
    <comment_count>2</comment_count>
      <attachid>198500</attachid>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2013-04-17 08:48:49 -0700</bug_when>
    <thetext>Comment on attachment 198500
the patch.

r=me. Maybe we should add an assertion that the Heap has been canonicalized whenever we&apos;re doing anything with root scanning (i.e. inside getConservativeRegisterRoots, gatherConservativeRoots, etc.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>877339</commentid>
    <comment_count>3</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2013-04-17 09:30:12 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 198500 [details])
&gt; r=me. Maybe we should add an assertion that the Heap has been canonicalized whenever we&apos;re doing anything with root scanning (i.e. inside getConservativeRegisterRoots, gatherConservativeRoots, etc.)

i&apos;d r+ patch that did that</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>877342</commentid>
    <comment_count>4</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2013-04-17 09:31:59 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; (From update of attachment 198500 [details] [details])
&gt; &gt; r=me. Maybe we should add an assertion that the Heap has been canonicalized whenever we&apos;re doing anything with root scanning (i.e. inside getConservativeRegisterRoots, gatherConservativeRoots, etc.)
&gt; 
&gt; i&apos;d r+ patch that did that

How does one assert that the heap has be canonicalized without actually doing a canonicalizing pass?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>877344</commentid>
    <comment_count>5</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2013-04-17 09:32:53 -0700</bug_when>
    <thetext>Thanks for the review.  Landed in r148616: &lt;http://trac.webkit.org/changeset/148616&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>877345</commentid>
    <comment_count>6</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2013-04-17 09:33:31 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; (In reply to comment #2)
&gt; &gt; &gt; (From update of attachment 198500 [details] [details] [details])
&gt; &gt; &gt; r=me. Maybe we should add an assertion that the Heap has been canonicalized whenever we&apos;re doing anything with root scanning (i.e. inside getConservativeRegisterRoots, gatherConservativeRoots, etc.)
&gt; &gt; 
&gt; &gt; i&apos;d r+ patch that did that
&gt; 
&gt; How does one assert that the heap has be canonicalized without actually doing a canonicalizing pass?

No idea, that&apos;s why i said i&apos;d r+ it rather than write it :D</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>877347</commentid>
    <comment_count>7</comment_count>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2013-04-17 09:36:20 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; (In reply to comment #2)
&gt; &gt; &gt; (From update of attachment 198500 [details] [details] [details])
&gt; &gt; &gt; r=me. Maybe we should add an assertion that the Heap has been canonicalized whenever we&apos;re doing anything with root scanning (i.e. inside getConservativeRegisterRoots, gatherConservativeRoots, etc.)
&gt; &gt; 
&gt; &gt; i&apos;d r+ patch that did that
&gt; 
&gt; How does one assert that the heap has be canonicalized without actually doing a canonicalizing pass?

There&apos;s a number of ways. One would be to add a flag that states whether the Heap (or the MarkedSpace) is in the &quot;Canonicalized&quot; state. You would then set this flag whenever canonicalize gets called and unset it whenever allocation caused us to leave the &quot;Canonicalized&quot; state.

You could also just ask all of the MarkedAllocators if their internal state matches that of being canonicalized (i.e. their FreeLists are empty and their m_currentBlock == 0).</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>198500</attachid>
            <date>2013-04-17 05:23:12 -0700</date>
            <delta_ts>2013-04-17 08:48:49 -0700</delta_ts>
            <desc>the patch.</desc>
            <filename>bug-114733.patch</filename>
            <type>text/plain</type>
            <size>2534</size>
            <attacher name="Mark Lam">mark.lam</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTQ4NTk5KQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE3IEBA
CisyMDEzLTA0LTE3ICBNYXJrIExhbSAgPG1hcmsubGFtQGFwcGxlLmNvbT4KKworICAgICAgICBy
ZWxlYXNlRXhlY3V0YWJsZU1lbW9yeSgpIHNob3VsZCBjYW5vbmljYWxpemUgY2VsbCBsaXZlbmVz
cyBkYXRhIGJlZm9yZQorICAgICAgICBpdCBzY2FucyB0aGUgR0Mgcm9vdHMuCisgICAgICAgIGh0
dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xMTQ3MzMuCisKKyAgICAgICAg
UmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgKiBoZWFwL0hlYXAuY3BwOgor
ICAgICAgICAoSlNDOjpIZWFwOjpjYW5vbmljYWxpemVDZWxsTGl2ZW5lc3NEYXRhKToKKyAgICAg
ICAgKiBoZWFwL0hlYXAuaDoKKyAgICAgICAgKiBydW50aW1lL0pTR2xvYmFsRGF0YS5jcHA6Cisg
ICAgICAgIChKU0M6OkpTR2xvYmFsRGF0YTo6cmVsZWFzZUV4ZWN1dGFibGVNZW1vcnkpOgorCiAy
MDEzLTA0LTE2ICBDb21taXQgUXVldWUgIDxybml3YUB3ZWJraXQub3JnPgogCiAgICAgICAgI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ZhdGl2ZVJlZ2lzdGVyUm9vdHMocm9vdHMp
OwogICAgICAgICBIYXNoU2V0PEpTQ2VsbCo+OjppdGVyYXRvciBlbmQgPSByb290cy5lbmQoKTsK
ICAgICAgICAgZm9yIChIYXNoU2V0PEpTQ2VsbCo+OjppdGVyYXRvciBwdHIgPSByb290cy5iZWdp
bigpOyBwdHIgIT0gZW5kOyArK3B0cikgewo=
</data>
<flag name="review"
          id="220232"
          type_id="1"
          status="+"
          setter="mhahnenberg"
    />
          </attachment>
      

    </bug>

</bugzilla>