<?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>129134</bug_id>
          
          <creation_ts>2014-02-20 17:55:20 -0800</creation_ts>
          <short_desc>virtualForWithFunction() should not throw an exception with a partially initialized frame</short_desc>
          <delta_ts>2014-02-20 22:02:21 -0800</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>InRadar</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>commit-queue</cc>
    
    <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>mhahnenberg</cc>
    
    <cc>mmirman</cc>
    
    <cc>msaboff</cc>
    
    <cc>oliver</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>983055</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2014-02-20 17:55:20 -0800</bug_when>
    <thetext>Currently, when JITOperations.cpp’s virtualForWithFunction() fails to prepare the callee function for execution, it proceeds to throw the exception using the callee frame which is only partially initialized thus far.  Instead, we should be throwing the exception using the caller frame because:
1.  the error happened &quot;in&quot; the caller while preparing the callee for execution i.e. the caller frame is the top fully initialized frame on the stack.
2. the callee frame is not fully initialized yet, and the unwind mechanism cannot depend on the data in it.

This patch will provide the fix.  I’ll work on creating a regression test in another bug.  I’ve been encountering some difficulty composing a regression test for the issue.  So, I’m going to defer it till later.  In the meantime, we can manually test this fix by navigating to jsfiddle.net with a debug build.  It will crash with an assertion almost instantly.

ref: &lt;rdar://problem/15843028&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>983060</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2014-02-20 17:59:34 -0800</bug_when>
    <thetext>bug for writing the regression test: &lt;https://webkit.org/b/129136&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>983076</commentid>
    <comment_count>2</comment_count>
      <attachid>224822</attachid>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2014-02-20 19:52:31 -0800</bug_when>
    <thetext>Created attachment 224822
The patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>983106</commentid>
    <comment_count>3</comment_count>
      <attachid>224822</attachid>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2014-02-20 21:30:46 -0800</bug_when>
    <thetext>Comment on attachment 224822
The patch

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>983110</commentid>
    <comment_count>4</comment_count>
      <attachid>224822</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-02-20 22:02:18 -0800</bug_when>
    <thetext>Comment on attachment 224822
The patch

Clearing flags on attachment: 224822

Committed r164472: &lt;http://trac.webkit.org/changeset/164472&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>983111</commentid>
    <comment_count>5</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-02-20 22:02:21 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>224822</attachid>
            <date>2014-02-20 19:52:31 -0800</date>
            <delta_ts>2014-02-20 22:02:18 -0800</delta_ts>
            <desc>The patch</desc>
            <filename>bug-129134.patch</filename>
            <type>text/plain</type>
            <size>2000</size>
            <attacher name="Mark Lam">mark.lam</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTY0NDYzKQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDIzIEBA
CisyMDE0LTAyLTIwICBNYXJrIExhbSAgPG1hcmsubGFtQGFwcGxlLmNvbT4KKworICAgICAgICB2
aXJ0dWFsRm9yV2l0aEZ1bmN0aW9uKCkgc2hvdWxkIG5vdCB0aHJvdyBhbiBleGNlcHRpb24gd2l0
aCBhIHBhcnRpYWxseSBpbml0aWFsaXplZCBmcmFtZS4KKyAgICAgICAgPGh0dHBzOi8vd2Via2l0
Lm9yZy9iLzEyOTEzND4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKwor
ICAgICAgICBDdXJyZW50bHksIHdoZW4gSklUT3BlcmF0aW9ucy5jcHAncyB2aXJ0dWFsRm9yV2l0
aEZ1bmN0aW9uKCkgZmFpbHMgdG8KKyAgICAgICAgcHJlcGFyZSB0aGUgY2FsbGVlIGZ1bmN0aW9u
IGZvciBleGVjdXRpb24sIGl0IHByb2NlZWRzIHRvIHRocm93IHRoZQorICAgICAgICBleGNlcHRp
b24gdXNpbmcgdGhlIGNhbGxlZSBmcmFtZSB3aGljaCBpcyBvbmx5IHBhcnRpYWxseSBpbml0aWFs
aXplZAorICAgICAgICB0aHVzIGZhci4gSW5zdGVhZCwgaXQ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
IGlubGluZSBjaGFyKiB2aXJ0dWFsRm9yV2l0aEZ1bmN0aW9uKAogICAgICAgICBKU09iamVjdCog
ZXJyb3IgPSBmdW5jdGlvbkV4ZWN1dGFibGUtPnByZXBhcmVGb3JFeGVjdXRpb24oZXhlY0NhbGxl
ZSwgZnVuY3Rpb24sICZzY29wZSwga2luZCk7CiAgICAgICAgIGV4ZWNDYWxsZWUtPnNldFNjb3Bl
KHNjb3BlKTsKICAgICAgICAgaWYgKGVycm9yKSB7Ci0gICAgICAgICAgICBleGVjLT52bSgpLnRo
cm93RXhjZXB0aW9uKGV4ZWNDYWxsZWUsIGVycm9yKTsKKyAgICAgICAgICAgIGV4ZWMtPnZtKCku
dGhyb3dFeGNlcHRpb24oZXhlYywgZXJyb3IpOwogICAgICAgICAgICAgcmV0dXJuIHJlaW50ZXJw
cmV0X2Nhc3Q8Y2hhcio+KHZtLT5nZXRDVElTdHViKHRocm93RXhjZXB0aW9uRnJvbUNhbGxTbG93
UGF0aEdlbmVyYXRvcikuY29kZSgpLmV4ZWN1dGFibGVBZGRyZXNzKCkpOwogICAgICAgICB9CiAg
ICAgfQo=
</data>

          </attachment>
      

    </bug>

</bugzilla>