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.
Dev sources, 1.4.2_04, Metal. Was closing some documents open from a freeform project. No idea how to reproduce.
Created attachment 16681 [details] Thread dump
Well, not sure whether I analyze the situation correctly, but it looks to me that 1) NbJavaFoldManager RP first locks the MDR 2) NbJavaFoldManager RP then locks the document by readlock (this locking order is correct and necessary as the MDR does not know which docs will it need to access) 3) By closing the doc (in AWT) a new doc gets assigned to the text component and the NbJavaFoldManager RP thread which is now in ASTProvider finds the new document and gains a read lock on it and processes the document renderer. The renderer attempts to gain a monitor on CloneableOpenSupport$Listener but that one is already held by AWT. I'm wondering whether we could get rid of replacing of the document by an empty one when the document is being closed (CloneableEditor lines 130 - 144). That could possibly make this problem to go away. Passing to openide/editor for further evaluation.
I'll investigate this. So far the issue seems to be similar to issue 40766.
*** Issue 47153 has been marked as a duplicate of this issue. ***
Raising to P1 as Jirka entered the dup as P1 against editor.
Created attachment 16773 [details] Deadlock simulated. Now there is a question, what to do with it?
cvs/openide/src/org/openide/text/CloneableEditorSupport.java,v <-- CloneableEditorSupport.java new revision: 1.129; previous revision: 1.128 done Processing log script arguments... More commits to come... RCS file: /cvs/openide/test/unit/src/org/openide/text/DocumentCannotBeClosedWhenReadLockedTest.java,v done Checking in test/unit/src/org/openide/text/DocumentCannotBeClosedWhenReadLockedTest.java; /cvs/openide/test/unit/src/org/openide/text/DocumentCannotBeClosedWhenReadLockedTest.java,v <-- DocumentCannotBeClosedWhenReadLockedTest.java initial revision: 1.1
It no more appears in tests on continuous build, so verifying.
*** Issue 47773 has been marked as a duplicate of this issue. ***