<?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>8949</bug_id>
          
          <creation_ts>2006-05-16 16:50:11 -0700</creation_ts>
          <short_desc>[S60] Javascript (onClick event) infinite loop hangs browser indefinitely</short_desc>
          <delta_ts>2007-01-12 14:17: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>312.x</version>
          <rep_platform>S60 Hardware</rep_platform>
          <op_sys>S60 3rd edition</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>7080</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Krishna">krishnamurty.podipireddy</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugzilla</cc>
    
    <cc>darin</cc>
    
    <cc>S60webkit</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>42666</commentid>
    <comment_count>0</comment_count>
    <who name="Krishna">krishnamurty.podipireddy</who>
    <bug_when>2006-05-16 16:50:11 -0700</bug_when>
    <thetext>+++ This bug was initially created as a clone of Bug #7080 +++

At current, infinite javascript loops are really infinite, we need a way to detect and stop them.
This currently occurs in:

- bug 3552
- bug 6693
- bug 6958

Any sort of infinite loop in a javascript method will take over the entire
browser, and requires a &quot;Force Quit...&quot; on OS X to get Safari to stop hogging all the CPU.

Try the following test case:

&lt;html&gt;
&lt;head&gt; 
	&lt;title&gt;Abort Feature 1&lt;/title&gt;
	&lt;script type=&quot;text/javascript&quot;&gt;
	    var run = true;
	    var a = 1;
            function startLoop(){
               while(run){
			 a++;
			 document.forms[0].elements[0].value=a;
			}	
               }	
	&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h3&gt;Abort Feature 1&lt;/h3&gt;
	&lt;p&gt;
	Activate the &quot;Start Loop&quot; link below to start an infinite loop by script
	execution.&lt;br/&gt;  Then stop script execution using script cancellation UI feature.
	&lt;/p&gt;

	&lt;p&gt;	
		&lt;a href=&quot;#&quot; onClick=&quot;startLoop()&quot;&gt;Start Loop&lt;/a&gt;&lt;br/&gt;
		&lt;form&gt;&lt;input/&gt;&lt;/form&gt;
	&lt;/p&gt;

&lt;/body&gt;
&lt;/html&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42667</commentid>
    <comment_count>1</comment_count>
    <who name="Krishna">krishnamurty.podipireddy</who>
    <bug_when>2006-05-16 17:03:07 -0700</bug_when>
    <thetext>How to reproduce:
Load the test case provided in the description.
Click the link &quot;Start Loop&quot;

Expected result: 
The script execution should be stopped by cancellation.

Actual result:
The script execution cannot be stopped. After clicking Start Loop, the browser hangs and can&apos;t do another operaton on the browser.

*** This bug has been marked as a duplicate of 7080 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42669</commentid>
    <comment_count>2</comment_count>
      <attachid>8358</attachid>
    <who name="Krishna">krishnamurty.podipireddy</who>
    <bug_when>2006-05-16 17:21:31 -0700</bug_when>
    <thetext>Created attachment 8358
onClick() Javascript infinite loop

The source code of this test file is already available in the description.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44008</commentid>
    <comment_count>3</comment_count>
    <who name="Krishna">krishnamurty.podipireddy</who>
    <bug_when>2006-05-30 10:33:11 -0700</bug_when>
    <thetext>TSW Error ID: EQWU-6KZ9QR</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35324</commentid>
    <comment_count>4</comment_count>
    <who name="Krishna">krishnamurty.podipireddy</who>
    <bug_when>2007-01-12 14:13:49 -0800</bug_when>
    <thetext>
Closed.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>8358</attachid>
            <date>2006-05-16 17:21:31 -0700</date>
            <delta_ts>2006-05-16 17:21:31 -0700</delta_ts>
            <desc>onClick() Javascript infinite loop</desc>
            <filename>abort_feature.html</filename>
            <type>text/html</type>
            <size>660</size>
            <attacher name="Krishna">krishnamurty.podipireddy</attacher>
            
              <data encoding="base64">PGh0bWw+DQoNCjxoZWFkPiANCgk8dGl0bGU+QWJvcnQgRmVhdHVyZSAxPC90aXRsZT4NCg0KCTxz
Y3JpcHQgdHlwZT0idGV4dC9qYXZhc2NyaXB0Ij4NCgkgICAgdmFyIHJ1biA9IHRydWU7DQoJICAg
IHZhciBhID0gMTsNCiAgICAgICAgICAgIGZ1bmN0aW9uIHN0YXJ0TG9vcCgpew0KICAgICAgICAg
ICAgICAgd2hpbGUocnVuKXsNCgkJCSBhKys7DQoJCQkgZG9jdW1lbnQuZm9ybXNbMF0uZWxlbWVu
dHNbMF0udmFsdWU9YTsNCgkJCX0JDQogICAgICAgICAgICAgICAgIA0KICAgICAgICAgICAgICAg
fQkNCg0KDQoJPC9zY3JpcHQ+DQoNCjwvaGVhZD4NCg0KDQo8Ym9keT4NCjxoMz5BYm9ydCBGZWF0
dXJlIDE8L2gzPg0KDQoJDQoJPHA+DQoJQWN0aXZhdGUgdGhlICJTdGFydCBMb29wIiBsaW5rIGJl
bG93IHRvIHN0YXJ0IGFuIGluZmluaXRlIGxvb3AgYnkgc2NyaXB0DQoJZXhlY3V0aW9uLjxici8+
ICBUaGVuIHN0b3Agc2NyaXB0IGV4ZWN1dGlvbiB1c2luZyBzY3JpcHQgY2FuY2VsbGF0aW9uIFVJ
IGZlYXR1cmUuDQoJPC9wPg0KCQ0KDQoJPHA+CQ0KCQk8YSBocmVmPSIjIiBvbkNsaWNrPSJzdGFy
dExvb3AoKSI+U3RhcnQgTG9vcDwvYT48YnIvPg0KCQk8Zm9ybT48aW5wdXQvPjwvZm9ybT4NCgk8
L3A+DQoNCg0KPC9ib2R5Pg0KDQoNCjwvaHRtbD4NCg0K
</data>

          </attachment>
      

    </bug>

</bugzilla>