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

GTK, JButton and Crux Theme: large buttons causes java to crash

    XMLWordPrintable

    Details

      Description

      FULL PRODUCT VERSION :
      java version "1.6.0-rc"
      Java(TM) SE Runtime Environment (build 1.6.0-rc-b95)


      ADDITIONAL OS VERSION INFORMATION :
      SunOS ahum2 5.10 Generic i86pc i386 i86pc

      A DESCRIPTION OF THE PROBLEM :
      When testing a JComboBox/GTK bug I discovered that java will crash when a button is sized to a certain point and the GTK theme is Crux. Upon testing, it appears to be when the width and height reach around 350 each in the enclosing frame. Sizing one dimension does not appear to cause the crash. Also, the error messages can be different dependant upon the resizing procedure:
      1. Timer based programatically changing size:
      zsh: segmentation fault (core dumped) java GTKComboBoxBug

      2. Using a small size 100/100/ width/height and resizing the frame:
      #
      # An unexpected error has been detected by Java Runtime Environment:
      #
      # SIGSEGV (0xb) at pc=0xfb4dc075, pid=1240, tid=13
      #
      # Java VM: Java HotSpot(TM) Client VM (1.6.0-rc-b95 mixed mode, sharing)
      # Problematic frame:
      # C [libcrux-engine.so+0xc075]
      #
      # An error report file with more information is saved as hs_err_pid1240.log
      #
      # If you would like to submit a bug report, please visit:
      # http://java.sun.com/webapps/bugreport/crash.jsp
      #

      3. Setting size to frame at 500/500 width/height:
      zsh: segmentation fault (core dumped) java GTKComboBoxBug 1



      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Switch theme to Crux Run this test, choose 1 of 3 options:
      java GTKButtonBug 0 --> does Timer resizing
      java GTKButtonBug 1 --> does size 500,500
      java GTKButtonBug 2 --> does size 100,100 do manual resizing

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      a big button that doesn't crash
      ACTUAL -
      core dumps

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      #
      # An unexpected error has been detected by Java Runtime Environment:
      #
      # SIGSEGV (0xb) at pc=0xfb4dc075, pid=1240, tid=13
      #
      # Java VM: Java HotSpot(TM) Client VM (1.6.0-rc-b95 mixed mode, sharing)
      # Problematic frame:
      # C [libcrux-engine.so+0xc075]
      #
      # An error report file with more information is saved as hs_err_pid1240.log
      #
      # If you would like to submit a bug report, please visit:
      # http://java.sun.com/webapps/bugreport/crash.jsp
      #

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;
      import java.awt.*;
      import java.awt.event.*;

      public class GTKButtonBug implements Runnable, ActionListener{
          static int which;
          JFrame jf;
          public void run(){
              Object[] data = new Object[]{1,2,3,4,5,6,7,8,9};
              //JComboBox jcb = new JComboBox(data);
              //for(Component c: jcb.getComponents()){
      // System.out.println(c.getClass());
              // if(c instanceof JButton)
      // jcb.remove(c);
              //}
              JButton jb = new JButton("hi");
              //JLabel jl = new JLabel("hi");
              //JTextField jtf = new JTextField(10);
              jf = new JFrame();
              jf.add(jb);
              if(which == 0 || which == 2)
                  jf.setSize(100,100);
              else if(which == 1)
                  jf.setSize(500,500);
              jf.setVisible(true);
              if(which == 0){
                  Timer t = new Timer(10, this);
                  t.start();
              }
          }

          public void actionPerformed(ActionEvent e){
              Dimension size = jf.getSize();
              size.width += 1;
              size.height += 1;
              System.out.println(size);
              jf.setSize(size);

          }

          public static void main(String ... args){
              try{
                  which = Integer.parseInt(args[0]);
              } catch(Exception x){}
              try{
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              } catch(Exception x){}
              SwingUtilities.invokeLater(new GTKButtonBug());
          }

      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      None that I know of

        Attachments

          Activity

            People

            Assignee:
            stayer Kirill Kirichenko (Inactive)
            Reporter:
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: