JDK-7166433 : Hang during theme change on gnome 3
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux_ubuntu
  • CPU: x86
  • Submitted: 2012-05-04
  • Updated: 2012-06-01
  • Resolved: 2012-06-01
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 8
8Resolved
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.7.0_03"
OpenJDK Runtime Environment (IcedTea7 2.1.1pre) (7~u3-2.1.1~pre1-1ubuntu3)
OpenJDK 64-Bit Server VM (build 22.0-b10, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Linux AIVAS-I 3.2.0-24-generic #38-Ubuntu SMP Tue May 1 16:18:50 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux


A DESCRIPTION OF THE PROBLEM :
When you change the gtk theme on gnome 3 with the appearance utility, any swing application hangs at AWT-EventQueue-0 at the method com.sun.java.swing.plaf.gtk.GTKEngine.native_switch_theme(Native Method)
(it happens in my application and in netbeans too)
I have created a minimal test case too, without additional code, and add the sigquit signal stacktrace







STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
run the testcase, open the appearance utility in gnome 3, change the theme, app is hang.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
keep running

ERROR MESSAGES/STACK TRACES THAT OCCUR :
2012-05-04 12:15:26
Full thread dump OpenJDK 64-Bit Server VM (22.0-b10 mixed mode):

"DestroyJavaVM" prio=10 tid=0x00007f4944007800 nid=0x1a78 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"AWT-EventQueue-0" prio=10 tid=0x00007f49442ad000 nid=0x1a86 runnable [0x00007f490ec01000]
   java.lang.Thread.State: RUNNABLE
	at com.sun.java.swing.plaf.gtk.GTKEngine.native_switch_theme(Native Method)
	at com.sun.java.swing.plaf.gtk.GTKEngine.themeChanged(GTKEngine.java:614)
	- locked <0x00000000eb71ca50> (a java.lang.Object)
	at com.sun.java.swing.plaf.gtk.GTKLookAndFeel$WeakPCL$1.run(GTKLookAndFeel.java:1517)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
	at java.awt.EventQueue.access$000(EventQueue.java:101)
	at java.awt.EventQueue$3.run(EventQueue.java:666)
	at java.awt.EventQueue$3.run(EventQueue.java:664)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

"AWT-Shutdown" prio=10 tid=0x00007f49442ab000 nid=0x1a85 in Object.wait() [0x00007f490ed03000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x00000000eb77e7c0> (a java.lang.Object)
	at java.lang.Object.wait(Object.java:503)
	at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:287)
	- locked <0x00000000eb77e7c0> (a java.lang.Object)
	at java.lang.Thread.run(Thread.java:722)

"AWT-XAWT" daemon prio=10 tid=0x00007f49442a9000 nid=0x1a84 runnable [0x00007f490ee04000]
   java.lang.Thread.State: RUNNABLE
	at sun.awt.X11.XToolkit.waitForEvents(Native Method)
	at sun.awt.X11.XToolkit.run(XToolkit.java:631)
	at sun.awt.X11.XToolkit.run(XToolkit.java:595)
	at java.lang.Thread.run(Thread.java:722)

"Java2D Disposer" daemon prio=10 tid=0x00007f4944274000 nid=0x1a83 in Object.wait() [0x00007f490ef05000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x00000000eb76ac60> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:135)
	- locked <0x00000000eb76ac60> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151)
	at sun.java2d.Disposer.run(Disposer.java:145)
	at java.lang.Thread.run(Thread.java:722)

"Service Thread" daemon prio=10 tid=0x00007f494412b000 nid=0x1a81 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" daemon prio=10 tid=0x00007f4944128800 nid=0x1a80 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" daemon prio=10 tid=0x00007f4944125800 nid=0x1a7f waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" daemon prio=10 tid=0x00007f4944123800 nid=0x1a7e waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" daemon prio=10 tid=0x00007f49440cc800 nid=0x1a7d in Object.wait() [0x00007f493b8de000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x00000000eb6b5780> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:135)
	- locked <0x00000000eb6b5780> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151)
	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:177)

"Reference Handler" daemon prio=10 tid=0x00007f49440ca000 nid=0x1a7c in Object.wait() [0x00007f493b9df000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x00000000eb6b5300> (a java.lang.ref.Reference$Lock)
	at java.lang.Object.wait(Object.java:503)
	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:133)
	- locked <0x00000000eb6b5300> (a java.lang.ref.Reference$Lock)

"VM Thread" prio=10 tid=0x00007f49440c2000 nid=0x1a7b runnable

"GC task thread#0 (ParallelGC)" prio=10 tid=0x00007f4944012800 nid=0x1a79 runnable

"GC task thread#1 (ParallelGC)" prio=10 tid=0x00007f4944014800 nid=0x1a7a runnable

"VM Periodic Task Thread" prio=10 tid=0x00007f4944135800 nid=0x1a82 waiting on condition

JNI global references: 329

Heap
 PSYoungGen      total 18432K, used 7332K [0x00000000eb6b0000, 0x00000000ecb40000, 0x0000000100000000)
  eden space 15808K, 46% used [0x00000000eb6b0000,0x00000000ebdd9220,0x00000000ec620000)
  from space 2624K, 0% used [0x00000000ec8b0000,0x00000000ec8b0000,0x00000000ecb40000)
  to   space 2624K, 0% used [0x00000000ec620000,0x00000000ec620000,0x00000000ec8b0000)
 PSOldGen        total 42176K, used 0K [0x00000000c2400000, 0x00000000c4d30000, 0x00000000eb6b0000)
  object space 42176K, 0% used [0x00000000c2400000,0x00000000c2400000,0x00000000c4d30000)
 PSPermGen       total 21248K, used 10281K [0x00000000b7e00000, 0x00000000b92c0000, 0x00000000c2400000)
  object space 21248K, 48% used [0x00000000b7e00000,0x00000000b880a510,0x00000000b92c0000)


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package test;

import java.awt.EventQueue;
import javax.swing.UIManager;
import java.util.logging.Logger;
import java.util.logging.Level;
import javax.swing.JButton;
import javax.swing.JFrame;


public class Test implements Runnable {

    public static JFrame app;

    public Test() {
    }

    @Override
    public void run() {
        setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        app = new JFrame();
        app.add(new JButton("test"));
        app.pack();
        app.setVisible(true);
    }

    public static void main(final String[] args) {
        EventQueue.invokeLater(new Test());
    }


    private void setLookAndFeel(String lafName) {
        try {
            UIManager.setLookAndFeel(lafName);
        } catch (Exception ex) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "Couldn't set look and feel", ex);
        }
    }
}

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
don't change the theme.