RFR: 8305352: updateIconImages may lead to deadlock after JDK-8276849

Dmitry Cherepanov dcherepanov at openjdk.org
Mon Apr 3 10:03:24 UTC 2023


On Fri, 31 Mar 2023 19:00:32 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java line 605:
>> 
>>> 603:         if (((Window)target).isVisible()) {
>>> 604:             updateIconImages();
>>> 605:         }
>> 
>> Will we call "updateIconImages" when later we show the window or an update of the icons will be missed if the notification come when the window is invisible?
>> 
>> Are you sure that it is not possible to trigger the next "trace" in the application w/o using "updateIconImages"?
>> 
>> 	at sun.java2d.loops.GraphicsPrimitiveMgr.initIDs(java.desktop at 21-ea/Native Method)
>> 	- waiting on the Class initialization monitor for sun.java2d.loops.Blit
>> 	at sun.java2d.loops.GraphicsPrimitiveMgr.<clinit>(java.desktop at 21-ea/GraphicsPrimitiveMgr.java:56)
>> 	at sun.java2d.loops.DrawLine.locate(java.desktop at 21-ea/DrawLine.java:51)
>> 	at sun.java2d.SurfaceData.makeRenderLoops(java.desktop at 21-ea/SurfaceData.java:884)
>> 	at sun.awt.image.BufImgSurfaceData.getSolidLoops(java.desktop at 21-ea/BufImgSurfaceData.java:412)
>> 	- locked <0x00000000c3fdd920> (a java.lang.Class for sun.awt.image.BufImgSurfaceData)
>> 	at sun.awt.image.BufImgSurfaceData.initSolidLoops(java.desktop at 21-ea/BufImgSurfaceData.java:397)
>> 	at sun.awt.image.BufImgSurfaceData.createData(java.desktop at 21-ea/BufImgSurfaceData.java:256)
>> 	at sun.awt.image.BufImgSurfaceData.createData(java.desktop at 21-ea/BufImgSurfaceData.java:74)
>> 	at sun.awt.image.BufImgSurfaceManager.<init>(java.desktop at 21-ea/BufImgSurfaceManager.java:55)
>> 	at sun.awt.image.SurfaceManager.getManager(java.desktop at 21-ea/SurfaceManager.java:79)
>> 	at sun.java2d.SurfaceData.getPrimarySurfaceData(java.desktop at 21-ea/SurfaceData.java:275)
>> 	at sun.java2d.SunGraphicsEnvironment.createGraphics(java.desktop at 21-ea/SunGraphicsEnvironment.java:132)
>> 	at java.awt.image.BufferedImage.createGraphics(java.desktop at 21-ea/BufferedImage.java:1183)
>> 	at sun.awt.SunToolkit.getScaledIconImage(java.desktop at 21-ea/SunToolkit.java:1032)
>> 	at sun.awt.SunToolkit.getScaledIconData(java.desktop at 21-ea/SunToolkit.java:1046)
>> 	at sun.awt.windows.WWindowPeer.updateIconImages(java.desktop at 21-ea/WWindowPeer.java:468)
>> 	at sun.awt.windows.WWindowPeer.updateGC(java.desktop at 21-ea/WWindowPeer.java:603)
>
> It seems that the root cause is a cyclic dependency between GraphicsPrimitiveMgr and Blit during static initialization

> Will we call "updateIconImages" when later we show the window or an update of the icons will be missed if the notification come when the window is invisible?

updateIconImages() will still be called from WWindowPeer.initialize() when we show a new window

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/13263#discussion_r1155745077



More information about the client-libs-dev mailing list