Summary: | JOGL WebStart Applications using GLCanvas/AWT may Deadlock by two AWT-EDT on Java >= 1.8.0_45 | ||
---|---|---|---|
Product: | [JogAmp] Jogl | Reporter: | Sven Gothel <sgothel> |
Component: | awt | Assignee: | Sven Gothel <sgothel> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | P2 | ||
Version: | 2.3.2 | ||
Hardware: | pc_all | ||
OS: | linux | ||
Type: | DEFECT | SCM Refs: |
b0af5159bc6100a6262afe6b52f9092a207ac2b3
|
Workaround: | --- | ||
Bug Depends on: | 1184 | ||
Bug Blocks: |
Description
Sven Gothel
2015-07-26 04:45:03 CEST
Found one Java-level deadlock: ============================= "AWT-EventQueue-2": waiting to lock monitor 0x00007fca300048a8 (object 0x00000006c6204248, a java.awt.Component$AWTTreeLock), which is held by "AWT-EventQueue-1" ^^ JAWTWindow trying to get monitor AWT-TreeLock, but holds lock SunToolkit.awtLock (0x00000006c64ba3f8), see below. ++ "AWT-EventQueue-1": waiting for ownable synchronizer 0x00000006c64ba3f8, (a java.util.concurrent.locks.ReentrantLock$NonfairSync), which is held by "AWT-EventQueue-2" Trying to acquire lock SunToolkit.awtLock (0x00000006c64ba3f8), but holds monitor AWT-TreeLock (0x00007fca300048a8). Root cause: - AWT Toolkit global Lock Our locking scheme (AWT-EDT-1): - Surface Lock - sun.awt.SunToolkit.awtLock() - Component.getGraphicsConfiguration() -> synchronized(Component.getTreeLock()) Other AWT-EDT-2 by Webstart: - synchronized(Component.getTreeLock()) - sun.awt.SunToolkit.awtLock() Results in a deadlock. Solution: - Issue Component.getGraphicsConfiguration() before awtLock() +++ Further code analysis commit b0af5159bc6100a6262afe6b52f9092a207ac2b3 - Issue Component.getGraphicsConfiguration() before awtLock(), where Component.getGraphicsConfiguration() is being used to detect possible reconfiguration. - Also use updated AWTGraphicsConfiguration's GraphicsConfiguration if no 'new' detection is required. |