[Webkit-unassigned] [Bug 6089] New: Javascript infinite loop hangs browser indefinitely

bugzilla-daemon at opendarwin.org bugzilla-daemon at opendarwin.org
Wed Dec 14 21:09:11 PST 2005


           Summary: Javascript infinite loop hangs browser indefinitely
           Product: WebKit
           Version: 412+
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: JavaScript
        AssignedTo: webkit-unassigned at opendarwin.org
        ReportedBy: bpalmer at cs.utah.edu

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:

function doIt() {
  var i = 0;
  while( i < 50 ) {
<button onclick="doIt();">Drink Me</button>

Configure bugmail: http://bugzilla.opendarwin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the webkit-unassigned mailing list