<?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>19853</bug_id>
          
          <creation_ts>2008-07-02 02:38:27 -0700</creation_ts>
          <short_desc>REGRESSION (r34838): Crash when visiting http://www.thewebsiteisdown.com/salesguy.html</short_desc>
          <delta_ts>2008-07-03 11:14:32 -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>Mac</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.thewebsiteisdown.com/salesguy.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yazz D. Atlas">yazz</reporter>
          <assigned_to name="Cameron Zwarich (cpst)">zwarich</assigned_to>
          <cc>ap</cc>
    
    <cc>dev+webkit</cc>
    
    <cc>ggaren</cc>
    
    <cc>ian.grant</cc>
    
    <cc>zwarich</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>84965</commentid>
    <comment_count>0</comment_count>
    <who name="Yazz D. Atlas">yazz</who>
    <bug_when>2008-07-02 02:38:27 -0700</bug_when>
    <thetext>Visit http://www.thewebsiteisdown.com/salesguy.html with July 2nd nightly build causes a crash.  System running  Mac OS X 10.5.4</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85049</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-07-03 04:21:51 -0700</bug_when>
    <thetext>Looks like there are two issues here: (1) Machine::privateExecute has started returning 0, and (2), _NPN_Invoke not being prepared to see 0 as the returned JSValue*.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85050</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-07-03 04:27:32 -0700</bug_when>
    <thetext>This didn&apos;t crash in r34824, so it&apos;s a recent regression - sadly, there was a large gap between nighlies this time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85052</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-07-03 04:37:59 -0700</bug_when>
    <thetext>*** Bug 19856 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85054</commentid>
    <comment_count>4</comment_count>
    <who name="Cameron Zwarich (cpst)">zwarich</who>
    <bug_when>2008-07-03 04:57:38 -0700</bug_when>
    <thetext>This seems like it is caused by r34838:

http://trac.webkit.org/changeset/34838

I am testing this now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85057</commentid>
    <comment_count>5</comment_count>
    <who name="Cameron Zwarich (cpst)">zwarich</who>
    <bug_when>2008-07-03 05:38:57 -0700</bug_when>
    <thetext>I can confirm that the crash described in this bug is caused by r34838. However, in r34837, both sites still cause assertion failures, thanks to bug 19736. I have a fix for that bug, but I got a bit sidetracked writing the plugin test code.

I am going to remove the assignment of this to myself, because Geoff is likely the best person to fix it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85061</commentid>
    <comment_count>6</comment_count>
    <who name="Cameron Zwarich (cpst)">zwarich</who>
    <bug_when>2008-07-03 06:25:46 -0700</bug_when>
    <thetext>As Alexey mentioned, the problem is _NPN_Invoke not being able to handle a 0 return value from Machine::execute(). The particular 0 in question is coming from

    Register* r = slideRegisterWindowForCall(exec, newCodeBlock, &amp;m_registerFile, m_registerFile.base(), callFrame, argv, argc, *exception);
    if (*exception) {
        m_registerFile.shrink(oldSize);
        return 0;
    }

However, the call to slideRegisterWindowForCall() does not set an exception, so the exception must be sitting around from before. Indeed, it was set by _NPN_SetException(). The fix for bug 19736 is to simply remove the body of _NPN_SetException() because it is completely incorrect and not doing anything useful at the moment. The question of how to properly handle exceptions from the NPAPI is somewhat thorny, because of compatibility issues.

I&apos;m marking this as a duplicate.

*** This bug has been marked as a duplicate of 19736 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85063</commentid>
    <comment_count>7</comment_count>
    <who name="Cameron Zwarich (cpst)">zwarich</who>
    <bug_when>2008-07-03 06:27:04 -0700</bug_when>
    <thetext>Actually, this bug is easier to reproduce, so I will swap the duplicate status. Sorry!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85066</commentid>
    <comment_count>8</comment_count>
    <who name="Cameron Zwarich (cpst)">zwarich</who>
    <bug_when>2008-07-03 06:27:25 -0700</bug_when>
    <thetext>*** Bug 19736 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85074</commentid>
    <comment_count>9</comment_count>
      <attachid>22064</attachid>
    <who name="Cameron Zwarich (cpst)">zwarich</who>
    <bug_when>2008-07-03 06:44:53 -0700</bug_when>
    <thetext>Created attachment 22064
Proposed patch

Here is a patch that fixes the bug. I should be able to reproduce this in a layout test by adding a test to the test plugin, but I might not be able to get around to it until later in the day.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85083</commentid>
    <comment_count>10</comment_count>
      <attachid>22064</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-07-03 07:25:06 -0700</bug_when>
    <thetext>Comment on attachment 22064
Proposed patch

So, do we want to fix _NPN_Invoke as well?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85099</commentid>
    <comment_count>11</comment_count>
    <who name="Cameron Zwarich (cpst)">zwarich</who>
    <bug_when>2008-07-03 10:17:26 -0700</bug_when>
    <thetext>(In reply to comment #10)
&gt; (From update of attachment 22064 [edit])
&gt; So, do we want to fix _NPN_Invoke as well?

A 0 return value from Machine::execute() means complete failure. Why do we want to continue execution?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85100</commentid>
    <comment_count>12</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2008-07-03 10:20:21 -0700</bug_when>
    <thetext>There are actually a few places in our code that are not capable of handling a 0 JSValue*. It would be nice to fix all our code so that it didn&apos;t try to use a JSValue* returned from a function that threw an exception. However, in the short term, I think we should just change Machine::privateExecute to return jsNull() in exception cases instead of 0 (in addition to the patch Cameron posted).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85101</commentid>
    <comment_count>13</comment_count>
      <attachid>22064</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2008-07-03 10:21:14 -0700</bug_when>
    <thetext>Comment on attachment 22064
Proposed patch

I&apos;ll r+ this since it fixes part of the bug. Cameron, can you add  comment with a bug #, please, before landing?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85103</commentid>
    <comment_count>14</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-07-03 10:28:21 -0700</bug_when>
    <thetext>(In reply to comment #11)
&gt; A 0 return value from Machine::execute() means complete failure. Why do we want
&gt; to continue execution?

Getting JS stack overflow doesn&apos;t mean WebKit should crash, does it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85106</commentid>
    <comment_count>15</comment_count>
    <who name="Cameron Zwarich (cpst)">zwarich</who>
    <bug_when>2008-07-03 11:00:28 -0700</bug_when>
    <thetext>(In reply to comment #13)
&gt; (From update of attachment 22064 [edit])
&gt; I&apos;ll r+ this since it fixes part of the bug. Cameron, can you add  comment with
&gt; a bug #, please, before landing?

There&apos;s already one in the ChangeLog for this bug, so I imagine you mean a bug # for implementing _NPN_SetException() correctly?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85108</commentid>
    <comment_count>16</comment_count>
    <who name="Cameron Zwarich (cpst)">zwarich</who>
    <bug_when>2008-07-03 11:14:32 -0700</bug_when>
    <thetext>Landed in r34982.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>22064</attachid>
            <date>2008-07-03 06:44:53 -0700</date>
            <delta_ts>2008-07-03 10:21:14 -0700</delta_ts>
            <desc>Proposed patch</desc>
            <filename>plugin.diff</filename>
            <type>text/plain</type>
            <size>1915</size>
            <attacher name="Cameron Zwarich (cpst)">zwarich</attacher>
            
              <data encoding="base64">SW5kZXg6IENoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBDaGFuZ2VMb2cJKHJldmlzaW9uIDM0OTgw
KQorKysgQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMjAgQEAKKzIwMDgtMDct
MDMgIENhbWVyb24gWndhcmljaCAgPGN3endhcmljaEB1d2F0ZXJsb28uY2E+CisKKyAgICAgICAg
UmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgQnVnIDE5ODUzOiBSRUdSRVNT
SU9OIChyMzQ4MzgpOiBDcmFzaCB3aGVuIHZpc2l0aW5nIGh0dHA6Ly93d3cudGhld2Vic2l0ZWlz
ZG93bi5jb20vc2FsZXNndXkuaHRtbAorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9z
aG93X2J1Zy5jZ2k/aWQ9MTk4NTMKKworICAgICAgICBSZW1vdmUgdGhlIGJvZHkgb2YgX05QTl9T
ZXRFeGNlcHRpb24oKSwgYmVjYXVzZSBpdCB3YXMgc2ltcGx5IGNhbGxpbmcKKyAgICAgICAgdGhy
b3dFcnJvcigpLCB3aGljaCBzZXRzIGFuIGV4Y2VwdGlvbiBvbiBhbiBFeGVjU3RhdGUgYnV0IGRv
ZXMg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2FnZSkKK3ZvaWQgX05QTl9TZXRFeGNlcHRpb24oTlBPYmplY3Qq
LCBjb25zdCBOUFVURjgqKQogewotICAgIGlmIChvLT5fY2xhc3MgPT0gTlBTY3JpcHRPYmplY3RD
bGFzcykgewotICAgICAgICBKYXZhU2NyaXB0T2JqZWN0KiBvYmogPSAoSmF2YVNjcmlwdE9iamVj
dCopbzsgCi0gICAgICAgIFJvb3RPYmplY3QqIHJvb3RPYmplY3QgPSBvYmotPnJvb3RPYmplY3Q7
Ci0gICAgICAgIGlmICghcm9vdE9iamVjdCB8fCAhcm9vdE9iamVjdC0+aXNWYWxpZCgpKQotICAg
ICAgICAgICAgcmV0dXJuOwotCi0gICAgICAgIEV4ZWNTdGF0ZSogZXhlYyA9IHJvb3RPYmplY3Qt
Pmdsb2JhbE9iamVjdCgpLT5nbG9iYWxFeGVjKCk7Ci0gICAgICAgIEpTTG9jayBsb2NrKGZhbHNl
KTsKLSAgICAgICAgdGhyb3dFcnJvcihleGVjLCBHZW5lcmFsRXJyb3IsIG1lc3NhZ2UpOwotICAg
IH0KIH0KIAogYm9vbCBfTlBOX0VudW1lcmF0ZShOUFAsIE5QT2JqZWN0ICpvLCBOUElkZW50aWZp
ZXIgKippZGVudGlmaWVyLCB1aW50MzJfdCAqY291bnQpCg==
</data>
<flag name="review"
          id="9714"
          type_id="1"
          status="+"
          setter="ggaren"
    />
          </attachment>
      

    </bug>

</bugzilla>