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

applet crashes while exiting the window after menu selection

XMLWordPrintable

    • 1.1.6
    • sparc
    • solaris_2.5.1, solaris_2.6
    • Verified

        lobal reference lock: <unowned>
            BinClass lock: <unowned>
            Class loading lock: <unowned>
            Java stack lock: <unowned>
            Code rewrite lock: <unowned>
            Heap lock: <unowned>
            Has finalization queue lock: <unowned>
            Finalize me queue lock: <unowned>
                Waiting to be notified:
                    "Finalizer thread" (0xee2c1db8)
            Monitor IO lock: <unowned>
            Child death monitor: <unowned>
            Event monitor: <unowned>
            I/O monitor: <unowned>
            Alarm monitor: <unowned>
                Waiting to be notified:
                    "Clock" (0xee3f1db8)
            Sbrk lock: <unowned>
            Monitor registry: owner "AWT-Motif" (0xedf11db8, 1 entry)
        Thread Alarm Q:
        Abort - core dumped
         

        ingrid.yao@Eng 1997-12-17

        Problem abstract: Applet crashes while exiting the window after menu
                          selection.

        JDK version: JDK1.1.5K
        Platform: Solaris 2.5.1

        Steps:
        ========
          0. Compile the code:
             javac SimpleWindowTest.java
          1. Run the applet:
             appletviewer SimpleWindowTest.html
          2. Invoke as many windows as you can by randomly clicking 'Show Menu Test 1,
             'Show Menu Test 2', Show Menu Test 3'.
          3. Go to one of the three menus your have invoked in step 2, and randomly
             go to any one of menu pulldowns (File, Edit, Option1, Option2, or Option3)
             and select menu items inside the menu pulldown. Don't pay attention to the
             widgets shown in window. They are there just to take up space!
             You need to close the window by selecting File--> Quit.
             The active window should go away.
             At some point when you close the window the applet will crash!
          4. If applet doesn't crash and you run out of windows to test,
             repeat step 2.
             It may take a couple tries to crash the applet so be patient:-)

           Also if you move the mouse quickly will be easier to reproduce the crash.

        Test case:
        ===========
        //
        //SimpleWindowTest.java
        //
        import java.applet.Applet;
        import java.awt.*;
        import java.awt.event.*;
         
        public class SimpleWindowTest extends Applet
        {
                private mySimpleCanvas clock;
                private rectCanvas rect;
        private TextField txt;
        private Scrollbar horiz;
        private Scrollbar vert;
        private ScrollPane sp;
                public int cnt;
         
        Button launchButton = new Button("Show Menu Test 1...");
        Button launchButton2 = new Button("Show Menu Test 2...");
        Button launchButton3 = new Button("Show Menu Test 3...");
         
        public void init()
                {
        add(launchButton);
        add(launchButton2);
        add(launchButton3);
         
        launchButton.addActionListener(new ActionListener()
                    {
        public void actionPerformed(ActionEvent event)
                        {
                            MenuTest frame = new MenuTest("Menu Test 1");
                            ++cnt;
        showStatus("# windows created: " + cnt);
                            frame.setBounds(300,300,300,300);
                            frame.show();
        }
        });
        launchButton2.addActionListener(new ActionListener()
                    {
        public void actionPerformed(ActionEvent event)
                        {
                            MenuTest frame = new MenuTest("Menu Test 2");
         
                            Button closeButton = new Button("Close");
         
                            Panel X = new Panel();
                            X.setLayout(new BorderLayout());
         
                            Panel topPanel = new Panel();
                            Panel bottomPanel = new Panel();
         
        bottomPanel.add(closeButton);
         
        vert = new Scrollbar(Scrollbar.VERTICAL);
        horiz = new Scrollbar(Scrollbar.HORIZONTAL);
        horiz.setValues(horiz.getValue(), 0,0, 50);
        vert.setValues(vert.getValue(), 0,0, 50);
        topPanel.setLayout(new BorderLayout());
        topPanel.add(vert, "East");
        topPanel.add(horiz, "South");
         
                            X.add(topPanel, "North");
                            X.add(bottomPanel, "South");
        frame.add(X, "South");
                            frame.setBounds(350,350,300,250);
         
                            frame.show();
                            ++cnt;
        showStatus("# windows created: " + cnt);
        }
        });
         
        launchButton3.addActionListener(new ActionListener()
                    {
        public void actionPerformed(ActionEvent event)
                        {
                            MenuTest frame = new MenuTest("Menu Test 3");
                            frame.setBounds(400,400,300,300);
         
                            clock = new mySimpleCanvas();
                            frame.add(clock, "Center");
         
                            Panel p = new Panel();
                            Button closeButton = new Button("Close");
                            p.add(closeButton);
          
                            p.add(new Label("Label"));
                            txt = new TextField(8);
                            p.add(txt);
        add(p, "East");
         
                            frame.add(p,"South");
                            frame.show();
         
                            ++cnt;
        showStatus("# windows created: " + cnt);
        }
        });
        }
         
                class rectCanvas extends Canvas
                {
        private int h1, w1;
                    public void paint(Graphics g)
                    {
        g.drawRect(0, 0, 100, 100);
        }
                }
         
                class mySimpleCanvas extends Canvas
                {
                    public void paint(Graphics g)
                    {
                         g.drawOval(0, 0, 100, 100);
                         g.drawOval(2, 2, 100, 100);
                         g.drawOval(4, 4, 100, 100);
                   }
               }
        }

        //
        //MenuTest.java
        //
        import java.awt.*;
        import java.awt.event.*;
        import java.util.Vector;
         
        public class MenuTest extends Frame
        {
            private MenuItem quitItem;
            private MenuBar mbar = new MenuBar();
            private MenuItem item1, item2, item3, item4;
            private Panel cards;
            private CardLayout layout;
         
            public MenuTest(String s)
            {
                super(s);
                createMenus(mbar);
                setMenuBar(mbar);
         
                cards = new Panel();
                layout = new CardLayout();
                cards.setLayout(layout);
         
        cards.add(new MyPanelOne("Options"), "Options");
        cards.add(new MyRectCanvas(), "MyRectCanvas");
        cards.add(new MycircleCanvas(), "MyCircleCanvas");
         
        add(cards, "Center");
            }
            public void createMenus(MenuBar mbar)
            {
        mbar.add(createFileMenu());
        mbar.add(createEditMenu());
        mbar.add(createOptionMenu1());
        mbar.add(createOptionMenu2());
        mbar.add(createOptionMenu3());
        mbar.add(createOptionMenu4());
            }
            private Menu createFileMenu()
            {
        Menu fileMenu = new Menu("File");
        fileMenu.add(quitItem = new MenuItem("Quit"));
         
        quitItem.addActionListener(new ActionListener()
                {
        public void actionPerformed(ActionEvent event)
                    {
                        MenuItem item = (MenuItem)event.getSource();
        if(item == quitItem)
                        {
        dispose();
        }
        }
        });
        return fileMenu;
            }
         
            private Menu createEditMenu()
            {
        Menu editMenu = new Menu("Edit");
         
        editMenu.add("Cut");
        editMenu.add("Copy");
        editMenu.add("Paste");
        editMenu.addSeparator();
        editMenu.add("Select all");
        editMenu.addSeparator();
        editMenu.add("Find");
        editMenu.add("Find again");
         
        return editMenu;
            }
            private Menu createOptionMenu1()
            {
        Menu optionMenu1 = new Menu("Option1");
         
        optionMenu1.add(item1 = new MenuItem("Item1"));
        optionMenu1.add(item2 = new MenuItem("Item2"));
        optionMenu1.add(item3 = new MenuItem("Item3"));
         
        item1.addActionListener(new ActionListener()
                {
        public void actionPerformed(ActionEvent event)
                    {
                        MenuItem mItem = (MenuItem)event.getSource();
        if(mItem == item1)
                        {
                            layout.show(cards, "Options");
        }
                    }
        });
        item2.addActionListener(new ActionListener()
                {
        public void actionPerformed(ActionEvent event)
                    {
                        MenuItem mItem = (MenuItem)event.getSource();
        if(mItem == item2)
                        {
                            layout.show(cards, "MyRectCanvas");
        }
        }
        });
        item3.addActionListener(new ActionListener()
                {
        public void actionPerformed(ActionEvent event)
                    {
                        MenuItem mItem = (MenuItem)event.getSource();
        if(mItem == item3)
                        {
                            layout.show(cards, "MyCircleCanvas");
        }
        }
        });
        return optionMenu1;
            }
            private Menu createOptionMenu2()
            {
        Menu optionMenu2 = new Menu("Option2");
         
        optionMenu2.add("Item1");
        optionMenu2.add("Item2");
         
        return optionMenu2;
            }
            private Menu createOptionMenu3()
            {
        Menu optionMenu3 = new Menu("Option3");
         
        optionMenu3.add("Item1");
        optionMenu3.add("Item2");
        optionMenu3.add("Item3");
        optionMenu3.add("Item4");
         
        return optionMenu3;
            }
            private Menu createOptionMenu4()
            {
        Menu optionMenu4 = new Menu("Option3");
         
        optionMenu4.add("Item1");
        optionMenu4.add("Item2");
        optionMenu4.add("Item3");
         
        return optionMenu4;
            }
        }
         
        class MyRectCanvas extends Canvas
        {
                 public void paint(Graphics g)
                 {
                     g.drawRect(0, 0, 100, 100);
                 }
        }
         
        class MyPanelOne extends Panel
        {
           MyPanelOne(String name)
           {
               add(new Label(name + " panel goes here"));
           }
        }
         
        class MycircleCanvas extends Canvas
        {
            public void paint(Graphics g)
            {
                 g.drawOval(0, 0, 100, 100);
                 g.drawOval(2, 2, 100, 100);
                 g.drawOval(4, 4, 100, 100);
           }
        }

        crash stack trace:
        =====================
         
        SIGSEGV 11* segmentation violation
            si_signo [11]: SIGSEGV 11* segmentation violation
            si_errno [0]: Error 0
            si_code [1]: SEGV_MAPERR [addr: 0x14]
                stackbase=EDF12000, stackpointer=EDF11398
        Full thread dump:
            "CursorIdler" (TID:0xee7257b0, sys_thread_t:0xeddc1db8, state:R) prio=4
                oracle.ewt.timer.Timer.accurateSleep(Timer.java)
                oracle.ewt.timer.Timer.run(Timer.java)
                java.lang.Thread.run(Thread.java)
            "Forms-StreamMessageWriter" (TID:0xee7169a0, sys_thread_t:0xeddf1db8,
        state
                java.lang.Object.wait(Object.java)
               
        oracle.forms.uiClient.v1_4.net.SingleAccessorQueue.get(SingleAccessorQu
               
        oracle.forms.uiClient.v1_4.net.StreamMessageWriter.run(StreamMessageWri
            "Forms-StreamMessageReader" (TID:0xee708b80, sys_thread_t:0xede21db8,
        state
                java.net.SocketInputStream.read(SocketInputStream.java:92)
               
        oracle.forms.uiClient.v1_4.net.EncryptedInputStream.fill(EncryptedInput
               
        oracle.forms.uiClient.v1_4.net.EncryptedInputStream.read(EncryptedInput
                java.io.DataInputStream.readUnsignedShort(DataInputStream.java)
               
        oracle.forms.uiClient.v1_4.engine.Message.readDetails(Message.java:697)
               
        oracle.forms.uiClient.v1_4.net.StreamMessageReader.run(StreamMessageRea
            "AWT-Finalizer" (TID:0xee716df8, sys_thread_t:0xede51db8, state:CW)
        prio=9
                java.lang.Object.wait(Object.java)
                sun.awt.AWTFinalizer.run(AWTFinalizer.java:48)
            "Thread-5" (TID:0xee710eb8, sys_thread_t:0xede81db8, state:CW) prio=4
                java.lang.Object.wait(Object.java)
                oracle.forms.uiClient.v1_4.engine.FlushQueue.run(FlushQueue.java:63)
                java.lang.Thread.run(Thread.java)
            "Forms-Runform-1" (TID:0xee710128, sys_thread_t:0xedeb1db8, state:CW)
        prio=
                java.lang.Object.wait(Object.java)
               
        oracle.forms.uiClient.v1_4.engine.Runform.startRunform(Runform.java:611
                oracle.forms.uiClient.v1_4.engine.Runform.run(Runform.java:522)
                java.lang.Thread.run(Thread.java)
            "Screen Updater" (TID:0xee70c118, sys_thread_t:0xedee1db8, state:R)
        prio=4
                java.lang.Thread.setPriority(Thread.java)
                sun.awt.ScreenUpdater.run(ScreenUpdater.java:97)
            "AWT-Motif" (TID:0xee70b2b0, sys_thread_t:0xedf11db8, state:R) prio=5
        *curr
                java.lang.Thread.run(Thread.java)
            "AWT-Input" (TID:0xee70b018, sys_thread_t:0xedf41db8, state:CW) prio=5
            "AWT-EventQueue-0" (TID:0xee70b030, sys_thread_t:0xedf71db8, state:MW)
        prio
                sun.awt.motif.MMenuPeer.<init>(MMenuPeer.java:48)
                sun.awt.motif.MToolkit.createMenu(MToolkit.java:165)
                java.awt.Menu.addNotify(Menu.java:111)
                java.awt.MenuBar.add(MenuBar.java:166)
                oracle.forms.uiClient.v1_4.ui.FormMenu.<init>(FormMenu.java:300)
               
        oracle.forms.uiClient.v1_4.ui.MenuInfo.createUIMenu(MenuInfo.java:407)
               
        oracle.forms.uiClient.v1_4.ui.MenuInfo.modifyItem(MenuInfo.java:1116)
                oracle.forms.uiClient.v1_4.ui.MenuInfo.onUpdate(MenuInfo.java:994)
                oracle.forms.uiClient.v1_4.ui.MenuInfo.onUpdate(MenuInfo.java:575)
               
        oracle.forms.uiClient.v1_4.engine.Runform.onUpdateHandler(Runform.java:
               
        oracle.forms.uiClient.v1_4.engine.Runform.processMessage(Runform.java:2
               
        oracle.forms.uiClient.v1_4.engine.Runform.processSet(Runform.java:2413)
               
        oracle.forms.uiClient.v1_4.engine.Runform.onMessageReal(Runform.java:21
               
        oracle.forms.uiClient.v1_4.engine.Runform.onMessage(Runform.java:1849)
               
        oracle.forms.uiClient.v1_4.ui.FormMenu.handleEvent(FormMenu.java:891)
               
        oracle.forms.uiClient.v1_4.ui.FormMenu.actionPerformed(FormMenu.java:94
                java.awt.MenuItem.processActionEvent(MenuItem.java:434)
                java.awt.MenuItem.processEvent(MenuItem.java:398)
                java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:174)
                java.awt.MenuComponent.dispatchEvent(MenuComponent.java:166)
            "thread applet-oracle.forms.uiClient.v1_4.engine.Main" (TID:0xee70a288,
        sys
                java.lang.Object.wait(Object.java)
                sun.applet.AppletPanel.getNextEvent(AppletPanel.java:220)
                sun.applet.AppletPanel.run(AppletPanel.java:244)
                java.lang.Thread.run(Thread.java)
            "Finalizer thread" (TID:0xee700220, sys_thread_t:0xee2c1db8, state:CW)
        prio
            "Async Garbage Collector" (TID:0xee700268, sys_thread_t:0xee2f1db8,
        state:R
            "Idle thread" (TID:0xee7002b0, sys_thread_t:0xee3c1db8, state:R) prio=0
            "Clock" (TID:0xee700088, sys_thread_t:0xee3f1db8, state:CW) prio=12
            "main" (TID:0xee7000b0, sys_thread_t:0x69458, state:CW) prio=5
        Monitor Cache Dump:
            <unknown key> (0xeddc1db8): owner "CursorIdler" (0xeddc1db8, 1 entry)
            java.awt.MenuBar@EE71F0E0/EE77B660: owner "AWT-EventQueue-0"
        (0xedf71db8, 1
            oracle.forms.uiClient.v1_4.net.EncryptedInputStream@EE716D98/EE771750:
        owne
            oracle.forms.uiClient.v1_4.engine.Runform@EE70F210/EE76CDA0: <unowned>
                Waiting to be notified:
                    "Forms-Runform-1" (0xedeb1db8)
            java.lang.Object@EE7165A8/EE772EC8: <unowned>
                Waiting to be notified:
                    "Forms-StreamMessageWriter" (0xeddf1db8)
            oracle.forms.uiClient.v1_4.ui.MenuInfo@EE718910/EE7F03F8: owner
        "AWT-EventQ
            sun.awt.AWTFinalizer@EE716DF8/EE771B18: <unowned>
                Waiting to be notified:
                    "AWT-Finalizer" (0xede51db8)
            sun.applet.AppletViewerPanel@EE70A0F0/EE75F958: <unowned>
                Waiting to be notified:
                    "thread applet-oracle.forms.uiClient.v1_4.engine.Main"
        (0xee221db8)
            oracle.forms.uiClient.v1_4.engine.FlushQueue@EE710F10/EE76E298:
        <unowned>
                Waiting to be notified:
                    "Thread-5" (0xede81db8)
            sun.awt.motif.MToolkit@EE70B0B0/EE762A10: owner "AWT-Motif" (0xedf11db8,
        1
                Waiting to enter:
                    "AWT-EventQueue-0" (0xedf71db8)
                Waiting to be notified:
                    "AWT-Input" (0xedf41db8)
        Registered Monitor Dump:
            Verifier lock: <unowned>
            Thread queue lock: <unowned>
                Waiting to be notified:
                    "main" (0x69458)
            Name and type hash table lock: <unowned>
            String intern lock: <unowned>
            JNI pinning lock: <unowned>
            JNI g

              mbronsonsunw Mike Bronson (Inactive)
              tyao Ting-Yun Ingrid Yao (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: