<?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>98433</bug_id>
          
          <creation_ts>2012-10-04 11:34:33 -0700</creation_ts>
          <short_desc>Crash in Safari at com.apple.JavaScriptCore: WTF::StringImpl::is8Bit const + 12</short_desc>
          <delta_ts>2012-10-10 10:16:44 -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>734876</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2012-10-04 11:34:33 -0700</bug_when>
    <thetext>Crash running safari extension tests.

Looks like is8Bit() is called on a String without a StringImpl.

&lt;rdar://problem/12433701&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>734896</commentid>
    <comment_count>1</comment_count>
      <attachid>167152</attachid>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2012-10-04 11:48:15 -0700</bug_when>
    <thetext>Created attachment 167152
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>734903</commentid>
    <comment_count>2</comment_count>
      <attachid>167152</attachid>
    <who name="Jessie Berlin">jberlin</who>
    <bug_when>2012-10-04 11:51:15 -0700</bug_when>
    <thetext>Comment on attachment 167152
Patch

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

&gt; Source/JavaScriptCore/ChangeLog:11
&gt; +        (JSValueMakeFromJSONString):

You should also mention that characters16() does the is8Bit() check, which is why you changed it to characters().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>734965</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2012-10-04 13:27:35 -0700</bug_when>
    <thetext>Committed r130424: &lt;http://trac.webkit.org/changeset/130424&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>735186</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2012-10-04 17:42:59 -0700</bug_when>
    <thetext>This is actually fixing the symptom of a problem in &lt;http://trac.webkit.org/changeset/130344&gt; and the follow-on &lt;http://trac.webkit.org/changeset/130413&gt;.  It appears that we are turning a null string into an empty string in OpaqueJSString.cpp.  See https://bugs.webkit.org/show_bug.cgi?id=98417.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>739060</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2012-10-10 10:16:44 -0700</bug_when>
    <thetext>Reopened because https://bugs.webkit.org/show_bug.cgi?id=98417 &quot;After r130344, OpaqueJSString() creates an empty string which should be a null string&quot; was the source of this particular crash.  However the change in this patch (r130424) is actually needed.

Consider the case:

    JSStringRef nullJSON = JSStringCreateWithUTF8CString(0);
    JSValueRef nullJSONObject = JSValueMakeFromJSONString(context, nullJSON);

nullJSON will have a null string which would cause the code before this patch to crash.

The case above has been added to testapi.c in r130832: &lt;http://trac.webkit.org/changeset/130832&gt;.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>167152</attachid>
            <date>2012-10-04 11:48:15 -0700</date>
            <delta_ts>2012-10-04 11:51:15 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>98433.patch</filename>
            <type>text/plain</type>
            <size>1671</size>
            <attacher name="Michael Saboff">msaboff</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTMwNDExKQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE1IEBA
CisyMDEyLTEwLTA0ICBNaWNoYWVsIFNhYm9mZiAgPG1zYWJvZmZAYXBwbGUuY29tPgorCisgICAg
ICAgIENyYXNoIGluIFNhZmFyaSBhdCBjb20uYXBwbGUuSmF2YVNjcmlwdENvcmU6IFdURjo6U3Ry
aW5nSW1wbDo6aXM4Qml0IGNvbnN0ICsgMTIKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5v
cmcvc2hvd19idWcuY2dpP2lkPTk4NDMzCisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChP
T1BTISkuCisKKyAgICAgICAgQWRkZWQgYSBsZW5ndGggY2hlY2sgYmVmb3JlIHRoZSBpczhCaXQo
KSBjaGVjay4KKworICAgICAgICAqIEFQSS9KU1ZhbHVlUmVmLmNwcDoKKyAgICAgICAgKEpTVmFs
dWVNYWtlRnJvbUpTT05TdHJpbmcpOgorCiAyMDEyLTEwLTA0ICBDc2FiYSBPc3p0cm9nb27DoWMg
IDxvc3N5QHdlYmtpdC5vcmc+CiAKICAgICAgICAgW1F0XSBBZGQgbWlzc2luZyBMTEludCBkZXBl
bmRlbmNpZXMgdG8gdGhlIG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HN0ci5sZW5ndGgoKSwgU3RyaWN0SlNPTik7Cisg
ICAgTGl0ZXJhbFBhcnNlcjxVQ2hhcj4gcGFyc2VyKGV4ZWMsIHN0ci5jaGFyYWN0ZXJzKCksIGxl
bmd0aCwgU3RyaWN0SlNPTik7CiAgICAgcmV0dXJuIHRvUmVmKGV4ZWMsIHBhcnNlci50cnlMaXRl
cmFsUGFyc2UoKSk7CiB9CiAK
</data>
<flag name="review"
          id="179725"
          type_id="1"
          status="+"
          setter="jberlin"
    />
          </attachment>
      

    </bug>

</bugzilla>