This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
[S1S5 rc7 + striker patches] I had mounted a PVCS/Webmodule filesystem and tried to edit a non writable JSP file. Just after I hit the keyboard the IDE froze. Threaddump is attached.
Created attachment 12337 [details] Thread dump
Well, this is actually a problem in vcscore module => moving to vcscore. The first thing is, that FileObject.lock() is called in AWT thread. This is not really nice, but it seems it's not forbidden. The next thing is, that you had to type in *very* fast (at least 3 times) Enter into the Editor: One Enter key made an attempt to modify a file. This has created a confirmation dialog, that ask you whether you want to get a writable file. This dialog was confirmed immediately by the second Enter, but then another Enter was trying to modify the file. This leads to deadlock in VcsFileSystem.lock() method. It waits in a lock until the EDIT command is customized, but in the mean time lock() method was entered again in AWT thread and waited on the lock. Because this is in AWT, the command customization could never proceed. I was able to reproduce this state. 1) Either you will type Enter into Editor very fast at least 4-5 times 2) Or you will simply press Enter and let the keyboard repeater do the work.
The solution can be to reduce the synchronization on the map of running EDIT and LOCK commands. This synchronization was created to assure that the user will not get multiple questions while the command is still running. But there seems to be a lock for that also in CloneableEditorSupport.
Just to track the history of this problem: This deadlock is caused by the fix of issue #23407 - waiting for other EDIT and LOCK commands to finish.
See also issue #37596 for the problem of calling VcsFileSystem.lock() and UserQuestionException.confirmed() in AWT thread. If these calls are combined, you get this deadlock. I'll concentrate on issue #37596 first.
The problem is fixed in the main trunk. VcsFileSystem.lock() method was refactored, there's less synchronization now: /cvs/vcscore/src/org/netbeans/modules/vcscore/VcsFileSystem.java,v <-- VcsFileSystem.java new revision: 1.239; previous revision: 1.238
Created attachment 14471 [details] .StringIndexOutOfBoundsException
The attachment doesn't belong to this issue.
Verified in NetBeans 3.6 NetBeans IDE Dev (Build 200404191800)