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.

Bug 46981 - Deadlock closing some files
Summary: Deadlock closing some files
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 4.x
Hardware: PC Linux
: P1 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: THREAD
: 47153 47773 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-08-06 22:53 UTC by Jesse Glick
Modified: 2008-12-22 21:06 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread dump (15.85 KB, text/plain)
2004-08-06 22:53 UTC, Jesse Glick
Details
Deadlock simulated. Now there is a question, what to do with it? (8.12 KB, patch)
2004-08-12 13:30 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2004-08-06 22:53:26 UTC
Dev sources, 1.4.2_04, Metal. Was closing some
documents open from a freeform project. No idea
how to reproduce.
Comment 1 Jesse Glick 2004-08-06 22:53:51 UTC
Created attachment 16681 [details]
Thread dump
Comment 2 Miloslav Metelka 2004-08-11 11:13:56 UTC
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.
Comment 3 Jaroslav Tulach 2004-08-12 12:40:49 UTC
I'll investigate this. So far the issue seems to be similar to issue
40766.
Comment 4 Miloslav Metelka 2004-08-12 12:56:08 UTC
*** Issue 47153 has been marked as a duplicate of this issue. ***
Comment 5 Miloslav Metelka 2004-08-12 12:58:16 UTC
Raising to P1 as Jirka entered the dup as P1 against editor.
Comment 6 Jaroslav Tulach 2004-08-12 13:30:54 UTC
Created attachment 16773 [details]
Deadlock simulated. Now there is a question, what to do with it?
Comment 7 Jaroslav Tulach 2004-08-12 14:29:30 UTC
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
Comment 8 Jiri Skrivanek 2004-08-13 08:39:06 UTC
It no more appears in tests on continuous build, so verifying.
Comment 9 Jaroslav Tulach 2004-08-24 16:52:02 UTC
*** Issue 47773 has been marked as a duplicate of this issue. ***