United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6713352 Deadlock in JFileChooser with synchronized custom FileSystemView
JDK-6713352 : Deadlock in JFileChooser with synchronized custom FileSystemView

Details
Type:
Bug
Submit Date:
2008-06-11
Status:
Closed
Updated Date:
2012-10-10
Project Name:
JDK
Resolved Date:
2009-12-30
Component:
client-libs
OS:
windows_vista,linux_2.4,generic,solaris_10,windows_xp,linux_redhat_6.0,windows
Sub-Component:
javax.swing
CPU:
x86,other,unknown,generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
2.0.3.10,2.0.3.13,3.0_sp9,6,6u5,6u10,6u14
Fixed Versions:

Related Reports
Backport:
Backport:
Backport:
Backport:
Duplicate:
Duplicate:
Duplicate:
Duplicate:
Duplicate:
Relates:
Relates:
Relates:
Relates:
Relates:
Relates:

Sub Tasks

Description
If a custom implementation of FileSystemView forwarding any calls to the COM thread from its synchronized methods, is set, it causes a deadlock.
_

                                    

Comments
WORK AROUND

Avoid invocation of Win32ShellFolder2's methods forwarding their execution to the COM thread, from within custom FileSystemView's synchronized methods. For example, use getAbsolutePath() instead of getAbsoluteFile().
                                     
2008-06-11
EVALUATION

Synchronized methods of the custom FileSystemView can be invoked from both EDT and COM threads. Logically, it's the single control flow, but from the security subsystem's point of view, it's not allowed to enter a synchronized method from the COM thread till another synchronized method invoked from the EDT, is finished.
                                     
2008-06-11
EVALUATION

ComThread should be used ONLY in our classes. We should avoid invocation of external code (like FileSystemView implementation) from ComThread. The fix of this CR is moving invocations of FileSystemView from ComThread to another thread. I also fixed here synchronized methods in Win32ShellFolder2, because it's another cause of deadlock.
                                     
2009-05-15
WORK AROUND

Almost all Win32ShellFolder2 methods can produce deadlock. E.g. listFiles, getDisplayName, getFolderType, isFileSystem, isDirectory isHidden and many other.
                                     
2009-06-01



Hardware and Software, Engineered to Work Together