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

Java program locks up X server

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.1.6
    • CPU:
      sparc
    • OS:
      solaris_2.6
    • Verification:
      Verified

      Backports

        Description

                Create a Java program which contains a Frame with a Menubar. Set up
        the Java program to monitor some non-user events (such as: a file
        exceeding a certain file size) and pop up a modal dialog when the
        event occurs.

        If the dialog appears when a menu bar menu is displayed, the system
        may lock up. The customer was able to produce the lock-up when the
                dialog contained a button whose role was to dispose of the modal dialog.
        Without the button, the customer got no lock-up.

        Here is a test case which reproduces the problem. It includes two
        files: "Makefile" and "Main.java". To build it, run 'make build'. To
        run it, run 'make run'.

        When the Frame appears, bring up the File menu and leave it up. In a
        few seconds, the modal dialog will appear; push the OK button and your
        system will be locked up. To unlock, be prepared to log in to another
        workstation and kill the JVM process running the test case.
         
        TEST CASE
        ---------

        ------------------------------ Makefile ------------------------------

        JAVA_HOME = /usr/java
        CLASSPATH = .:$(JAVA_HOME)/lib/classes.zip

        JAVAC = $(JAVA_HOME)/bin/javac -classpath $(CLASSPATH)
        JAVA = $(JAVA_HOME)/bin/java
        JAR = $(JAVA_HOME)/bin/jar
        RM = /usr/bin/rm -f

        build:
        $(JAVAC) LockUp.java

        run:
        @JAVA_HOME=$(JAVA_HOME); export JAVA_HOME; CLASSPATH=$(CLASSPATH); export CLASSPATH; $(JAVA) LockUp

        clean:
        $(RM) *.class

        ---------------------------- Lockup.java ----------------------------

        import java.awt.*;
        import java.awt.event.*;

        class LockUp
        {

        public static void
        main(
        String[] args)
        {
        new LockUp();
        }

        LockUp()
        {
        Frame frame = new Frame();

        MenuBar menuBar = new MenuBar();
        frame.setMenuBar(menuBar);

        Menu file = new Menu("File");
        menuBar.add(file);

        MenuItem menuItem = new MenuItem("A Menu Entry");
        file.add(menuItem);

        frame.setSize(600, 400);
        frame.setVisible(true);

        // Allow time to pop up the menu

        try {
        Thread.currentThread().sleep(5000);
        }
        catch (InterruptedException exception) {
        }

        dialog = new Dialog(frame);

        Button button = new Button ("Close");
        dialog.add(button);
        button.addActionListener(
        new ActionListener() {
        public void actionPerformed(ActionEvent e)
        { dialog.dispose(); } }
        );


        dialog.setSize(200, 200);
        dialog.setModal(true);
        dialog.setVisible(true);

        System.out.println("No lock-up occurred");
        System.exit(0);
        }

        private Dialog dialog;

        }

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                xdengsunw Xianfa Deng (Inactive)
                Reporter:
                duke J. Duke (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: