<?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>6089</bug_id>
          
          <creation_ts>2005-12-14 21:09:10 -0800</creation_ts>
          <short_desc>Javascript infinite loop hangs browser indefinitely</short_desc>
          <delta_ts>2006-02-07 13:30:36 -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>420+</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</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>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Brian Palmer">bugzilla</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>25980</commentid>
    <comment_count>0</comment_count>
    <who name="Brian Palmer">bugzilla</who>
    <bug_when>2005-12-14 21:09:10 -0800</bug_when>
    <thetext>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.  Gecko-based browsers (Camino &amp; 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&apos;t take 
over the whole browser or seem to use as much CPU.

Something as simple as this works:

{{{
&lt;script&gt;
function doIt() {
  var i = 0;
  while( i &lt; 50 ) {
  }
}
&lt;/script&gt;
&lt;button onclick=&quot;doIt();&quot;&gt;Drink Me&lt;/button&gt;
}}}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31757</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2006-02-07 13:30:36 -0800</bug_when>
    <thetext>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 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>