Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6185367

100% cpu usage when calling Java/Javascript invovling HTML repaint.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0
    • Component/s: deploy
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_2000, windows_xp

      Description

      FULL PRODUCT VERSION :
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)

      ADDITIONAL OS VERSION INFORMATION :
      Windows 2000 - all MS updates applied

      A DESCRIPTION OF THE PROBLEM :

      Running the attached testcase resulting in the CPU sitting at 100 usage and IE locking up.

      The test case involves calling from Java to JavaScript, which inserts a HTML 'Select' Element.



      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :

      Press CTL-Alt-Del and minize to show the CPU usage in the task bar.

      Click on the HTML file to load the file into IE.
      Click on the button and watch the CPU usage.

      Right click on the IE icon in the task bar to release the CPU and unlock IE.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -

      Was not expecting CPU to lock at 100%.
      Was not expecting IE to lock up.
      ACTUAL -

      Expecting a select option to repaint correctly.
      Expecting CPU not to reach 100 usuage.
      Expecting IE not to lock up.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      // SOURCE CODE & HTML INCLUDED....

      import netscape.javascript.JSObject;

      import javax.swing.JApplet;
      import java.util.List;
      import java.util.ArrayList;

      public class TestApplet extends JApplet
      {
      public List foo() throws InterruptedException
      {
      Thread.sleep(1000);
      JSObject.getWindow(this).call("reenter",new Object[]{System.currentTimeMillis()+""});
      Thread.sleep(1000);
      ArrayList ret = new ArrayList();
      ret.add(new String(System.currentTimeMillis()+""));
      System.out.println(ret);
      return ret;
      }
      }





      /// ********************************************************************
      <HTML>
      <HEAD>
      <SCRIPT TYPE="text/javascript" language="JavaScript">
      function onClickTestButton()
      {
      var _applet = window.document.body.all.testApplet;
      var table = document.body.all.test;
      while (table.rows.length>0)
      {
      table.deleteRow(0);
      }
      var row = table.insertRow();
      var cell = row.insertCell(0);
      cell.innerHTML ="<select size='10' id='testSelect'></select>";
      var selectElement = document.getElementById('testSelect');
      var opt = document.createElement("option");
      opt.text = _applet.foo();
      selectElement.options.add(opt);
      }

      function reenter(test)
      {
      alert(test);
      }

      </SCRIPT>
      </HEAD>
      <BODY>
      <table id="test"></table>
      <button onClick="onClickTestButton()">click here first</button>
      <OBJECT ID="testApplet" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" codebase = "http://java.sun.com/products/plugin/autodl/jinstall-1_4_2-windows-i586.cab#Version=1,4,2,0" WIDTH = "0" HEIGHT = "0" >
      <PARAM NAME="name" VALUE="testApplet"></PARAM>
      <PARAM NAME="CODE" VALUE = "TestApplet.class" ></PARAM>
      <PARAM NAME="type" VALUE = "application/x-java-applet;jpi-version=1.4.2"></PARAM>
      <PARAM NAME="scriptable" VALUE = "true"></PARAM>
      </OBJECT>
      </BODY>
      </HTML>

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      None.

      Clicking on the IE icon in the task bar releases the CPU from its locked state.
      ###@###.### 10/27/04 18:51 GMT

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              gmanwanisunw Girish Manwani (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: