Bug 8949 - [S60] Javascript (onClick event) infinite loop hangs browser indefinitely
Summary: [S60] Javascript (onClick event) infinite loop hangs browser indefinitely
Status: CLOSED DUPLICATE of bug 7080
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 312.x
Hardware: S60 Hardware S60 3rd edition
: P2 Critical
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-16 16:50 PDT by Krishna
Modified: 2007-01-12 14:17 PST (History)
3 users (show)

See Also:


Attachments
onClick() Javascript infinite loop (660 bytes, text/html)
2006-05-16 17:21 PDT, Krishna
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Krishna 2006-05-16 16:50:11 PDT
+++ 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 "Force Quit..." on OS X to get Safari to stop hogging all the CPU.

Try the following test case:

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

	<p>	
		<a href="#" onClick="startLoop()">Start Loop</a><br/>
		<form><input/></form>
	</p>

</body>
</html>
Comment 1 Krishna 2006-05-16 17:03:07 PDT
How to reproduce:
Load the test case provided in the description.
Click the link "Start Loop"

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't do another operaton on the browser.

*** This bug has been marked as a duplicate of 7080 ***
Comment 2 Krishna 2006-05-16 17:21:31 PDT
Created attachment 8358 [details]
onClick() Javascript infinite loop

The source code of this test file is already available in the description.
Comment 3 Krishna 2006-05-30 10:33:11 PDT
TSW Error ID: EQWU-6KZ9QR
Comment 4 Krishna 2007-01-12 14:13:49 PST
Closed.