<AWT Dev> [11] Review Request: 8189604 possible hang in sun.awt.shell.Win32ShellFolder2$KnownFolderDefinition::<clinit>

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Mon Jun 25 08:50:30 UTC 2018

Please review the fix for jdk11.

Bug: https://bugs.openjdk.java.net/browse/JDK-8189604
Webrev: http://cr.openjdk.java.net/~serb/8189604/webrev.00

We have a cyclic dependency in Win32ShellFolder2$KnownFolderDefinition, 
which can cause a deadlock if this class is initialized on "non-COM" thread.

1. - Static initialization of Win32ShellFolder2$KnownFolderDefinition
2. -- Win32ShellFolder2.getLibraries();
3. --- invoke Win32ShellFolder2.loadKnownFolders() on "COM-thread" and wait
4. ---- in the native call 
5. ---- deadlock. because initialization of KnownFolderDefinition was 
blocked at step 3.

In the fix this dependency is broken, so the new class KnownLibraries is 
not depends from its own initialization.

Best regards, Sergey.

More information about the awt-dev mailing list