JDK-4424509 : MediaTracker freezes whilst getting a disabled icon
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.3.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2001-03-12
  • Updated: 2001-08-22
  • Resolved: 2001-08-22
Related Reports
Duplicate :  
Description

Name: boT120536			Date: 03/12/2001


java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

I'd like to see bug 4332685 reopened, as I am still seeing it, even though it
has been marked as closed.

Occasionally, perhaps one time in twenty, the JVM will completely freeze, and
have to be killed manually.  Looking through a full stack dump shows that the
MediaTracker class is waiting forever:

"AWT-EventQueue-0" prio=7 tid=0x7748e0 nid=0x5df waiting on monitor [0x8fbf000..0x8fbfdc8]
	at java.lang.Object.wait(Native Method)
	at java.awt.MediaTracker.waitForID(Unknown Source)
	at javax.swing.ImageIcon.loadImage(Unknown Source)
	at javax.swing.ImageIcon.<init>(Unknown Source)
        [snip]
	at java.awt.EventDispatchThread.run(Unknown Source)

The problem has only ever been seen when running our application on a dual
processor NT4 machine.
(Review ID: 118460) 
======================================================================


thomas.lenz@Germany 2001-04-02
------------------------------
Customer seems to have run into the same problem. Application is completely 
hung and has to be "^C"-ed. Here is a snippet from a stacktrace, that was
drawn while hung:

"AWT-EventQueue-0" prio=7 tid=0x778560 nid=0x242 waiting on monitor [0x8fbf000..0x8fbfdc8]
        at java.lang.Object.wait(Native Method)
        at java.awt.MediaTracker.waitForID(MediaTracker.java:632)
        at javax.swing.ImageIcon.loadImage(ImageIcon.java:226)
        at javax.swing.ImageIcon.<init>(ImageIcon.java:161)
        at javax.swing.AbstractButton.getDisabledIcon(AbstractButton.java:542)
        at javax.swing.plaf.basic.BasicButtonUI.paintIcon(BasicButtonUI.java:284)
        at javax.swing.plaf.basic.BasicButtonUI.paint(BasicButtonUI.java:252)
        at javax.swing.plaf.ComponentUI.update(ComponentUI.java:39)
        at javax.swing.JComponent.paintComponent(JComponent.java:398)
        at javax.swing.JComponent.paint(JComponent.java:739)
        at javax.swing.JComponent.paintChildren(JComponent.java:523)
        at javax.swing.JComponent.paint(JComponent.java:748)
        at javax.swing.JComponent.paintChildren(JComponent.java:523)
        at javax.swing.JComponent.paint(JComponent.java:748)
        at javax.swing.JComponent.paintWithBuffer(JComponent.java:4393)
        at javax.swing.JComponent._paintImmediately(JComponent.java:4336)
        at javax.swing.JComponent.paintImmediately(JComponent.java:4187)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:370)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:205)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:154)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:317)
        at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)


All other theads named "Thread-<n>" show: "waiting on monitor"


Comments
EVALUATION 4332685 is assigned to classes_2D. eric.hawkes@eng 2001-03-12 I've included a workaround from a different bug 4480705 Java SWING EventQueue thread deadlocks with animated GIFs which looks similar to this one - try it out. Unfortunately the description of this bug is incomplete: I need full stack trace dump for all threads, not only the EDT. Also, if possible, it would be nice to have the test application included. ###@###.### 2001-08-14 Considering the response from the customer I'm going to close this bug as a duplicate of 4480705: Java SWING EventQueue thread deadlocks with animated GIFs I'm aware that this bug is older than 4480705 but the latter has a complete evaluation (it also has higher priority). ###@###.### 2001-08-22
22-08-2001

WORK AROUND Name: boT120536 Date: 03/12/2001 Someone suggested subclassing JButton, to provide an alternative getDisabledIcon method, but that didn't help ====================================================================== Here is the workaround: set the disabled icon for all the labels. You can use the same image as for the normal icon. I've attached a modified minimal testcase which reproduces the problem. Uncomment lines // l.setDisabledIcon(printing); // l2.setDisabledIcon(faulted); to workaround the problem. This prevents loading of the image in getDisaledIcon() called from imageUpdate, which happens on the Animator thread (which is the cause of the bug). This works for all affected jdks. ###@###.### 2001-08-14
14-08-2001