Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6626580
Votes 0
Synopsis D3D: WComponentPeer.destroyBuffers should not be synchronized
Category java:classes_2d
Reported Against
Release Fixed 6u10(b08)
State 10-Fix Delivered, Verified, bug
Priority: 3-Medium
Related Bugs
Submit Date 06-NOV-2007
Description
I've ran into the following deadlock when switching from
full-screen to windowed mode in Firestarter:
Found one Java-level deadlock:
=============================
"Thread-4":
  waiting to lock monitor 0x0c5dd26c ( customer  0x04a31cd8, a java.awt.Component$AWTTreeLock),
  which is held by "AWT-EventQueue-0"
"AWT-EventQueue-0":
  waiting to lock monitor 0x0c5dd204 ( customer  0x04a2c990, a sun.awt.windows.WFramePeer),
  which is held by "Thread-4"

Java stack information for the threads listed above:
===================================================
"Thread-4":
        at sun.awt.windows.WComponentPeer.replaceSurfaceData(WComponentPeer.java:382)
        - waiting to lock <0x04a31cd8> (a java.awt.Component$AWTTreeLock)
        at sun.awt.windows.WComponentPeer.destroyBuffers(WComponentPeer.java:829)
        - locked <0x04a2c990> (a sun.awt.windows.WFramePeer)
        at java.awt.Component$FlipBufferStrategy.destroyBuffers(Component.java:3700)
        at java.awt.Component$FlipBufferStrategy.dispose(Component.java:3818)
        at java.awt.Component.createBufferStrategy(Component.java:3447)
        at java.awt.Window.createBufferStrategy(Window.java:2968)
        at java.awt.Component.createBufferStrategy(Component.java:3383)
        at java.awt.Window.createBufferStrategy(Window.java:2943)
        at GameFrame.show(Unknown Source)
        at ParticleAnim.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:619)
"AWT-EventQueue-0":
        at sun.awt.windows.WComponentPeer.replaceSurfaceData(WComponentPeer.java:383)
        - waiting to lock <0x04a2c990> (a sun.awt.windows.WFramePeer)
        - locked <0x04a31cd8> (a java.awt.Component$AWTTreeLock)
        at sun.awt.windows.WComponentPeer.replaceSurfaceData(WComponentPeer.java:367)
        at sun.awt.windows.WComponentPeer$2.run(WComponentPeer.java:430)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

Found 1 deadlock.
Posted Date : 2007-11-06 18:48:54.0
Work Around
N/A
Evaluation
The cause of the deadlock is that WComponentPeer.destroyBuffers()
is synchronized, which causes it to take the locks 
in a reversed order from all other places:
it first takes peer lock, then AWTTree lock.

In fact destroyBuffers() shouldn't be synchronized
at all since replaceSurfaceData() already takes
care of synchronization.
Posted Date : 2007-11-06 18:48:54.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang