<?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>98693</bug_id>
          
          <creation_ts>2012-10-08 15:03:46 -0700</creation_ts>
          <short_desc>After r130344, OpaqueJSString::identifier() adds wrapped String to identifier table</short_desc>
          <delta_ts>2012-10-09 11:38:07 -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>All</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>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>98300</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Saboff">msaboff</reporter>
          <assigned_to name="Michael Saboff">msaboff</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>737094</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2012-10-08 15:03:46 -0700</bug_when>
    <thetext>The update in r130344 to OpaqueJSString::identifier() creates an Identifier using m_string which will add m_string to the identifier table of the passed in JSGlobalData.  This unintended side effect is incompatible with OpaqueJSString being a thread safe string abstraction.

The fix is to create a new string for the Identifier by using one of the character pointer / length based constructors.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>737103</commentid>
    <comment_count>1</comment_count>
      <attachid>167626</attachid>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2012-10-08 15:07:44 -0700</bug_when>
    <thetext>Created attachment 167626
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>737227</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2012-10-08 16:53:17 -0700</bug_when>
    <thetext>The ChangeLog and this Bugzilla should really contain references to the Radar that motivated this change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>737240</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2012-10-08 17:05:30 -0700</bug_when>
    <thetext>In Radar as &lt;rdar://problem/12450118&gt; (and &lt;rdar://problem/12449570&gt; which has been made a duplicate).

Tested this fix against &lt;rdar://problem/12449570&gt; and it fixes the problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>737245</commentid>
    <comment_count>4</comment_count>
      <attachid>167651</attachid>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2012-10-08 17:09:45 -0700</bug_when>
    <thetext>Created attachment 167651
Added Radar reference to ChangeLog</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>737771</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2012-10-09 07:46:48 -0700</bug_when>
    <thetext>Committed r130761: &lt;http://trac.webkit.org/changeset/130761&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>737891</commentid>
    <comment_count>6</comment_count>
      <attachid>167651</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2012-10-09 09:58:43 -0700</bug_when>
    <thetext>Comment on attachment 167651
Added Radar reference to ChangeLog

View in context: https://bugs.webkit.org/attachment.cgi?id=167651&amp;action=review

&gt; Source/JavaScriptCore/ChangeLog:11
&gt; +        Use Identifier(LChar*, length) or Identifier(UChar*, length) constructors so that we don&apos;t
&gt; +        add the String instance in the OpaqueJSString to any identifier tables.

This doesn’t seem right architecturally. What prevents callers from doing this by calling string() and then turning it into an Identifier later?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>737977</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2012-10-09 11:30:11 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; (From update of attachment 167651 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=167651&amp;action=review
&gt; 
&gt; &gt; Source/JavaScriptCore/ChangeLog:11
&gt; &gt; +        Use Identifier(LChar*, length) or Identifier(UChar*, length) constructors so that we don&apos;t
&gt; &gt; +        add the String instance in the OpaqueJSString to any identifier tables.
&gt; 
&gt; This doesn’t seem right architecturally. What prevents callers from doing this by calling string() and then turning it into an Identifier later?

Created https://bugs.webkit.org/show_bug.cgi?id=98801 &quot;After r130344, OpaqueJSString::string() shouldn&apos;t directly return the wrapped String&quot; to track this.

Probably the best way to handle this is to create a copy of the wrapped String and return it.  This will make the code prior to 130344 except we now use a String instead of a UChar[] to store the text.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>167626</attachid>
            <date>2012-10-08 15:07:44 -0700</date>
            <delta_ts>2012-10-08 17:09:45 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>98693.patch</filename>
            <type>text/plain</type>
            <size>1535</size>
            <attacher name="Michael Saboff">msaboff</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTMwNjg5KQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE2IEBA
CisyMDEyLTEwLTA4ICBNaWNoYWVsIFNhYm9mZiAgPG1zYWJvZmZAYXBwbGUuY29tPgorCisgICAg
ICAgI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Zy5jcHAJKHdvcmtpbmcgY29weSkKQEAgLTQ0LDUgKzQ0LDgg
QEAgSWRlbnRpZmllciBPcGFxdWVKU1N0cmluZzo6aWRlbnRpZmllcihKUwogICAgIGlmICghdGhp
cyB8fCAhbV9zdHJpbmcubGVuZ3RoKCkpCiAgICAgICAgIHJldHVybiBJZGVudGlmaWVyKGdsb2Jh
bERhdGEsIHN0YXRpY19jYXN0PGNvbnN0IGNoYXIqPigwKSk7CiAKLSAgICByZXR1cm4gSWRlbnRp
ZmllcihnbG9iYWxEYXRhLCBtX3N0cmluZyk7CisgICAgaWYgKG1fc3RyaW5nLmlzOEJpdCgpKQor
ICAgICAgICByZXR1cm4gSWRlbnRpZmllcihnbG9iYWxEYXRhLCBtX3N0cmluZy5jaGFyYWN0ZXJz
OCgpLCBtX3N0cmluZy5sZW5ndGgoKSk7CisKKyAgICByZXR1cm4gSWRlbnRpZmllcihnbG9iYWxE
YXRhLCBtX3N0cmluZy5jaGFyYWN0ZXJzMTYoKSwgbV9zdHJpbmcubGVuZ3RoKCkpOwogfQo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>167651</attachid>
            <date>2012-10-08 17:09:45 -0700</date>
            <delta_ts>2012-10-09 09:58:43 -0700</delta_ts>
            <desc>Added Radar reference to ChangeLog</desc>
            <filename>98693-2.patch</filename>
            <type>text/plain</type>
            <size>1639</size>
            <attacher name="Michael Saboff">msaboff</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTMwNjg5KQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtM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NTdHJpbmcu
Y3BwCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT0KLS0tIFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9BUEkvT3BhcXVlSlNTdHJp
bmcuY3BwCShyZXZpc2lvbiAxMzA2NjQpCisrKyBTb3VyY2UvSmF2YVNjcmlwdENvcmUvQVBJL09w
YXF1ZUpTU3RyaW5nLmNwcAkod29ya2luZyBjb3B5KQpAQCAtNDQsNSArNDQsOCBAQCBJZGVudGlm
aWVyIE9wYXF1ZUpTU3RyaW5nOjppZGVudGlmaWVyKEpTCiAgICAgaWYgKCF0aGlzIHx8ICFtX3N0
cmluZy5sZW5ndGgoKSkKICAgICAgICAgcmV0dXJuIElkZW50aWZpZXIoZ2xvYmFsRGF0YSwgc3Rh
dGljX2Nhc3Q8Y29uc3QgY2hhcio+KDApKTsKIAotICAgIHJldHVybiBJZGVudGlmaWVyKGdsb2Jh
bERhdGEsIG1fc3RyaW5nKTsKKyAgICBpZiAobV9zdHJpbmcuaXM4Qml0KCkpCisgICAgICAgIHJl
dHVybiBJZGVudGlmaWVyKGdsb2JhbERhdGEsIG1fc3RyaW5nLmNoYXJhY3RlcnM4KCksIG1fc3Ry
aW5nLmxlbmd0aCgpKTsKKworICAgIHJldHVybiBJZGVudGlmaWVyKGdsb2JhbERhdGEsIG1fc3Ry
aW5nLmNoYXJhY3RlcnMxNigpLCBtX3N0cmluZy5sZW5ndGgoKSk7CiB9Cg==
</data>
<flag name="review"
          id="180382"
          type_id="1"
          status="+"
          setter="mrowe"
    />
          </attachment>
      

    </bug>

</bugzilla>