JDK-6472901 : GTK Theme change and JTextField can/will crash Java
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_10
  • CPU: x86
  • Submitted: 2006-09-20
  • Updated: 2011-03-07
  • Resolved: 2011-03-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u1Fixed 7 b03Fixed
Description
FULL PRODUCT VERSION :
java version "1.6.0-rc"
Java(TM) SE Runtime Environment (build 1.6.0-rc-b95)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b95, mixed mode, sharing)


ADDITIONAL OS VERSION INFORMATION :
Solaris

A DESCRIPTION OF THE PROBLEM :
When switching themes in GTK and a JTextField is being used, Java can/will crash.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the testcase.
Begin switching the themes.  At some point, maybe early on maybe after a couple of switches  java will crash.  My most recent attempt at switching themes took only 2 switches to cause the crash.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
no crash
ACTUAL -
a crash

ERROR MESSAGES/STACK TRACES THAT OCCUR :
(<unknown>:10076): Gtk-WARNING **: GtkEntry - did not receive focus-out-event. If you
connect a handler to this signal, it must return
FALSE so the entry gets the event as well

Gtk-ERROR **: file gtkentry.c: line 4671: assertion failed: (GTK_WIDGET_HAS_FOCUS (entry))
aborting...
zsh: IOT instruction (core dumped)  java GTK_JTextField


REPRODUCIBILITY :
This bug can be reproduced always.

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

public class GTK_JTextField implements Runnable{

    public void run(){
        JFrame jf = new JFrame();
        JTextComponent jtf1 = new JTextField(20);
        jf.add(jtf1);
        jf.pack();
        jf.setVisible(true);
    }

    public static void main(String ... args){
        try{
	    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch(Exception x){}
        SwingUtilities.invokeLater(new GTK_JTextField());
    }

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

CUSTOMER SUBMITTED WORKAROUND :
don't change themes.

Comments
EVALUATION Contribution forum : https://jdk-collaboration.dev.java.net/servlets/ProjectForumMessageView?forumID=1463&messageID=15676
26-09-2006

EVALUATION gtk-cursor-blink setting for gtk_entry should be switched off to avoid generation cursor_blink timer actions.
26-09-2006

EVALUATION GtkEntry selection should be handled in native code correctly.
20-09-2006

SUGGESTED FIX When there are many other widgets try to switch the focus to another widget that text area.
20-09-2006