<?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>129969</bug_id>
          
          <creation_ts>2014-03-08 08:15:44 -0800</creation_ts>
          <short_desc>32-bit x86 handleUncaughtException returns to wrong location after a stack overflow</short_desc>
          <delta_ts>2014-03-08 11:17:17 -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>
          
          <blocked>129318</blocked>
          <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>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>988557</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2014-03-08 08:15:44 -0800</bug_when>
    <thetext>I haven&apos;t isolated the root cause yet, but here&apos;s what I&apos;m seeing while running stress/recurse-infinitely-on-getter.js test with the JIT enable (it runs fine with only the LLINT):

Stack trace 1: before handleUncaughtException returns:

(lldb) bt 15
* thread #1: tid = 0xaadf21, 0x006164eb JavaScriptCore`handleUncaughtException + 39, queue = &apos;com.apple.main-thread&apos;, stop reason = instruction step into
  * frame #0: 0x006164eb JavaScriptCore`handleUncaughtException + 39
    frame #1: 0xbfc1fa10
    frame #2: 0x0048ccca JavaScriptCore`JSC::Interpreter::executeCall(this=0x03839b20, callFrame=0xbfc1fe58, function=0x01f8dc10, callType=CallTypeJS, callData=0xbfc1fbe0, thisValue=JSValue at 0xbfc1fb14, args=0xbfc1fbc0) + 1482 at Interpreter.cpp:994
    frame #3: 0x000f816d JavaScriptCore`JSC::call(exec=0xbfc1fe58, functionObject=JSValue at 0xbfc1fb84, callType=CallTypeJS, callData=0xbfc1fbe0, thisValue=JSValue at 0xbfc1fb94, args=0xbfc1fbc0) + 253 at CallData.cpp:39
    frame #4: 0x004112e9 JavaScriptCore`JSC::callGetter(exec=0xbfc1fe58, base=JSValue at 0xbfc1fc14, getterSetter=JSValue at 0xbfc1fc1c) + 313 at GetterSetter.cpp:61
    frame #5: 0x007548f2 JavaScriptCore`JSC::PropertySlot::functionGetter(this=0xbfc1fdb8, exec=0xbfc1fe58) const + 194 at PropertySlot.cpp:32
    frame #6: 0x0006e59f JavaScriptCore`JSC::PropertySlot::getValue(this=0xbfc1fdb8, exec=0xbfc1fe58, propertyName=PropertyName at 0xbfc1fce8) const + 239 at JSObject.h:1564
    frame #7: 0x00092f15 JavaScriptCore`JSC::JSValue::get(this=0xbfc1fdd8, exec=0xbfc1fe58, propertyName=PropertyName at 0xbfc1fd58, slot=0xbfc1fdb8) const + 357 at JSCJSValueInlines.h:670
    frame #8: 0x004c1240 JavaScriptCore`operationGetByIdBuildList(exec=0xbfc1fe58, stubInfo=0x01a33120, base=-21441347712, uid=0x0383aa60) + 256 at JITOperations.cpp:140
    frame #9: 0x01f649b1
    frame #10: 0x00615dc4 JavaScriptCore`callToJavaScript + 292
    frame #11: 0x004afd60 JavaScriptCore`JSC::JITCode::execute(this=0x01a33740, vm=0x022b5600, protoCallFrame=0xbfc20010) + 64 at JITCode.cpp:47
    frame #12: 0x0048ccca JavaScriptCore`JSC::Interpreter::executeCall(this=0x03839b20, callFrame=0xbfc203f8, function=0x01f8dc10, callType=CallTypeJS, callData=0xbfc20180, thisValue=JSValue at 0xbfc200b4, args=0xbfc20160) + 1482 at Interpreter.cpp:994
    frame #13: 0x000f816d JavaScriptCore`JSC::call(exec=0xbfc203f8, functionObject=JSValue at 0xbfc20124, callType=CallTypeJS, callData=0xbfc20180, thisValue=JSValue at 0xbfc20134, args=0xbfc20160) + 253 at CallData.cpp:39
    frame #14: 0x004112e9 JavaScriptCore`JSC::callGetter(exec=0xbfc203f8, base=JSValue at 0xbfc201b4, getterSetter=JSValue at 0xbfc201bc) + 313 at GetterSetter.cpp:61

Stack trace 2: after handleUncaughtException returns (by stepping thru the &quot;retl&quot; instruction in handleUncaughtException):

(lldb) 
Process 25830 stopped
* thread #1: tid = 0xaadf21, 0x006164f5 JavaScriptCore`handleUncaughtException + 49, queue = &apos;com.apple.main-thread&apos;, stop reason = instruction step into
    frame #0: 0x006164f5 JavaScriptCore`handleUncaughtException + 49
JavaScriptCore`handleUncaughtException + 49:
-&gt; 0x6164f5:  retl   

JavaScriptCore`llint_op_enter:
   0x6164f6:  movl   %esp, %ecx
   0x6164f8:  andl   $0xf, %ecx
   0x6164fb:  testl  %ecx, %ecx

(lldb) 
Process 25830 stopped
* thread #1: tid = 0xaadf21, 0x0005ff2f JavaScriptCore`JSC::Heap::heap(cell=0x01f8dc10) + 31 at Heap.h:398, queue = &apos;com.apple.main-thread&apos;, stop reason = instruction step into
    frame #0: 0x0005ff2f JavaScriptCore`JSC::Heap::heap(cell=0x01f8dc10) + 31 at Heap.h:398
   395  
   396      inline Heap* Heap::heap(const JSCell* cell)
   397      {
-&gt; 398          return MarkedBlock::blockFor(cell)-&gt;heap();
   399      }
   400  
   401      inline Heap* Heap::heap(const JSValue v)

(lldb) bt 15
* thread #1: tid = 0xaadf21, 0x0005ff2f JavaScriptCore`JSC::Heap::heap(cell=0x01f8dc10) + 31 at Heap.h:398, queue = &apos;com.apple.main-thread&apos;, stop reason = instruction step into
  * frame #0: 0x0005ff2f JavaScriptCore`JSC::Heap::heap(cell=0x01f8dc10) + 31 at Heap.h:398
    frame #1: 0x0006ec80 JavaScriptCore`JSC::JSCell::classInfo(this=0x00aab93c) const + 64 at JSDestructibleObject.h:36

(lldb) 

The stack pointer appears to be messed up somewhere in the process of getting to handleUncaughtExceptions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>988558</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2014-03-08 08:19:17 -0800</bug_when>
    <thetext>&lt;rdar://problem/16270160&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>988559</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2014-03-08 08:35:32 -0800</bug_when>
    <thetext>Looks like the 32-bit version of handleUncaughtException isn&apos;t handling an edge case for stack overflows that the 64-bit version does.  Now testing the solution.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>988560</commentid>
    <comment_count>3</comment_count>
      <attachid>226215</attachid>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2014-03-08 08:50:04 -0800</bug_when>
    <thetext>Created attachment 226215
the patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>988565</commentid>
    <comment_count>4</comment_count>
      <attachid>226215</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2014-03-08 10:45:18 -0800</bug_when>
    <thetext>Comment on attachment 226215
the patch.

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>988580</commentid>
    <comment_count>5</comment_count>
      <attachid>226215</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-03-08 11:17:14 -0800</bug_when>
    <thetext>Comment on attachment 226215
the patch.

Clearing flags on attachment: 226215

Committed r165334: &lt;http://trac.webkit.org/changeset/165334&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>988581</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-03-08 11:17:17 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>226215</attachid>
            <date>2014-03-08 08:50:04 -0800</date>
            <delta_ts>2014-03-08 11:17:14 -0800</delta_ts>
            <desc>the patch.</desc>
            <filename>bug-129969.patch</filename>
            <type>text/plain</type>
            <size>2157</size>
            <attacher name="Mark Lam">mark.lam</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTY1MzMyKQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE5IEBA
CisyMDE0LTAzLTA4ICBNYXJrIExhbSAgPG1hcmsubGFtQGFwcGxlLmNvbT4KKworICAgICAgICAz
Mi1iaXQgeDg2IGhhbmRsZVVuY2F1Z2h0RXhjZXB0aW9uIHJldHVybnMgdG8gd3JvbmcgbG9jYXRp
b24gYWZ0ZXIgYSBzdGFjayBvdmVyZmxvdy4KKyAgICAgICAgPGh0dHBzOi8vd2Via2l0Lm9yZy9i
LzEyOTk2OT4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAg
ICBUaGUgMzItYml0IHZlcnNpb24gb2YgaGFuZGxlVW5jYXVnaHRFeGNlcHRpb24gd2FzIG1pc3Np
bmcgdGhlIGhhbmRsaW5nIG9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