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

STD: Evaluating AWT variables hangs jdb

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.3.0
    • 1.1.3, 1.1.4, 1.1.7
    • core-svc
    • beta
    • generic, other, x86
    • generic, windows_nt
    • Not verified



      Name: diC59631 Date: 11/06/97


      Save the following to MyApplet.java:
      ----
      import java.applet.*;
      import java.awt.*;
      import java.applet.Applet;

      public class MyApplet extends java.applet.Applet
      {
      public void init()
      {
      super.init();

      setBackground( new Color(0xc0c0c0) );
      setLayout( null );

      button = new java.awt.Button();
      button.setLocation( 29, 17 );
      button.setSize( 100, 50 );
      add( button );
      button.setLabel( "Button" );

      list = new java.awt.List();
      list.setLocation( 328, 32 );
      list.setSize( 100, 200 );
      add( list );

      textfield = new java.awt.TextField();
      textfield.setLocation( 57, 160 );
      textfield.setSize( 200, 40 );
      add( textfield );

      actionAdaptor0 = new ActionAdaptor0();
      button.addActionListener(actionAdaptor0);
      }

      java.awt.Button button;
      java.awt.List list;
      java.awt.TextField textfield;

      ActionAdaptor0 actionAdaptor0;
      class ActionAdaptor0 implements java.awt.event.ActionListener
      {
      public void actionPerformed(java.awt.event.ActionEvent event)
      {
      list.addItem(textfield.getText());
      }
      }
      }
      ----

      Save the following to MyApplet.html:
      ----
      <HTML>
      <APPLET CODE="MyApplet.class" ALT="The MyApplet Applet" NAME="MyApplet" WIDTH="460" HEIGHT="260" ALIGN="TOP">
      </APPLET>
      </HTML>
      ----

      DOS% jdb
      Initializing jdb...
      > stop at MyApplet$ActionAdaptor0:43
      Breakpoint set at MyApplet$ActionAdaptor0:43
      > run sun.applet.AppletViewer MyApplet.html
      running ...
      main[1]
      {Go to appletviewer and click on the button}
      Breakpoint Hit: MyApplet$ActionAdaptor0.actionPerformed (MyApplet$ActionAdaptor0:43)
      AWT-EventQueue-0[1] print this$0.component
      this$0.component = {jdb hangs}

      Analysis:

      The AWT-EventQueue and AWT-Windows threads are entering
      and exiting the AWT_LOCK all the time, so suspending
      either one of them (explicitly or with a breakpoint)
      and then asking for information about an AWT object
      runs the risk of causing a hang.

      Fix:

      Not allowing the debugger to suspend a thread that
      owns the AWT lock.
      (Review ID: 19783)
      ======================================================================

            ghirschsunw Gordon Hirsch (Inactive)
            dindrigo Daniel Indrigo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: