Bug 6089
Summary: | Javascript infinite loop hangs browser indefinitely | ||
---|---|---|---|
Product: | WebKit | Reporter: | Brian Palmer <bugzilla> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | ||
Priority: | P2 | ||
Version: | 420+ | ||
Hardware: | All | ||
OS: | All |
Brian Palmer
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. Gecko-based browsers (Camino & Firefox
tested) let the script run away for a few seconds, then present a warning dialog asking whether the
script should be allowed to continue. Perhaps something similar would be appropriate for Webkit and
Safari? Opera seems to allow the script to go on indefinitely, but via threading the script doesn't take
over the whole browser or seem to use as much CPU.
Something as simple as this works:
{{{
<script>
function doIt() {
var i = 0;
while( i < 50 ) {
}
}
</script>
<button onclick="doIt();">Drink Me</button>
}}}
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
This report has been filed earlier, but the future of this issue seems to be with bug 7080 :)
*** This bug has been marked as a duplicate of 7080 ***