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 12557

Summary: Deadlock while modifying just loading source.
Product: platform Reporter: _ pkuzel <pkuzel>
Component: -- Other --Assignee: Peter Zavadsky <pzavadsky>
Severity: blocker CC: jtulach, mmetelka, non_migrated_user
Priority: P2    
Version: 3.x   
Hardware: PC   
OS: Unix   
Issue Type: DEFECT Exception Reporter:
Attachments: Thread dump
Proposed patch to avoid deadlock.

Description _ pkuzel 2001-06-01 17:03:17 UTC

Comment 1 _ pkuzel 2001-06-01 17:03:54 UTC
Created attachment 1479 [details]
Thread dump
Comment 2 Svata Dedic 2001-06-01 17:09:46 UTC
Seems like openide (PositionManager / CloneableEditorSupport) problem. Please
reassign back if not.
Comment 3 Jan Zajicek 2001-06-05 15:40:52 UTC
Marek, can you check this.
Comment 4 mslama 2001-06-08 13:25:34 UTC
Please could you tell me what version of IDE is it? (What build?)
Comment 5 Miloslav Metelka 2001-06-08 14:22:51 UTC
(Assuming it is the same document) it's wrong to try to modify the document that
is just being loaded, isn't it?
Comment 6 mslama 2001-06-08 15:37:59 UTC
Yes I agree but as you can see it is possible. Is there any way how to prevent
it in CloneableEditorSupport or in editor? I will try to solve it between
org.openide.text.NbDocument and org.openide.text.CloneableEditorSupport.
Comment 7 _ pkuzel 2001-06-08 15:57:14 UTC
It is Netbeans 3.2 FCS
Comment 8 mslama 2001-10-15 11:10:00 UTC
Reassign to new owner of openide/editor
Comment 9 Jesse Glick 2001-10-25 21:27:30 UTC
Assign this to me if you have no time to work on it (but I am not sure
I would know what to do with it...).
Comment 10 Peter Zavadsky 2001-10-26 07:25:47 UTC
I'm already working on it. Sorry didn't marked.

But if you would like to help, you are welcome, the solution seems not
to be easy one, see the thread:
[openide-dev] Could sb revise fix for #12557. Deadlock while reloading
Comment 11 _ ttran 2001-11-26 16:02:52 UTC
postponed the fix for a release after NB 3.3.x.  Peter please attach
your proposed patch here so it won't get lost.
Comment 12 Peter Zavadsky 2001-11-27 08:20:02 UTC
Created attachment 3587 [details]
Proposed patch to avoid deadlock.
Comment 13 Peter Zavadsky 2001-11-27 08:29:40 UTC
You can test the presence of the sync gap and the patch with 

I guess the patch is not 100%. It avoids the deadlock succesfully, but
loses data trying to be put in the document from the second thread
while the first one has already started to perform reloading from
file. The data loading from file replace the changes made by the
second thread.

I'm not sure if that behaviour is correct. But if not there seems to
be quite complicated to prevent the data made by the second thread if
done during that time.
Comment 14 Peter Zavadsky 2001-11-27 08:41:08 UTC
Marked as 3.3.0 waiver.
It wont be fixed due to risky change in sync of editor support and
also due to a reason the possibility to occure this issue is very low.
We have just one report for last about 2 years, since the editor
support sync is implemented this way.
 Prefer to fix this issue at the beginnig of next dev cycle so there
could be a long time to test and approve it.
Comment 15 _ ttran 2002-01-14 15:56:02 UTC
the situation hasn't change since 3.3.0
Comment 16 Jan Chalupa 2002-01-16 09:48:11 UTC
Waiver for 3.3.1 approved by QA.
Comment 17 Peter Zavadsky 2002-01-28 15:09:27 UTC
Fixed in [main-trunk]

openide/../text/ [1.43]

The deadlock is solved by this fix. Then remains less priority issue,
what to do with the modification tried to make to the old content of
the document, i.e. it should be reflexed in the new reloaded content,
see #19845.
Comment 18 Jan Chalupa 2002-04-09 13:48:00 UTC
Risky change. Will not be fixed for FFJ 4.0 (Orion).
Comment 19 Jan Chalupa 2002-05-02 10:40:58 UTC
Waiver approved.
Comment 20 jay chen 2002-06-24 09:30:47 UTC
Created attachment 1479 [details]
Thread dump
Comment 21 Peter Zavadsky 2002-06-24 09:46:36 UTC
You are using older builds than 3.4 (it's clear from the stack trace
line numbers), where there was still the old synch used. 
See above, this issue was approved as waiwer for 3.3 and ffj40, it is
fixed just in 3.4. Thanks. Closing as fixed.
Comment 22 pzajac 2003-08-18 14:52:41 UTC
long time not changed
Comment 23 Quality Engineering 2011-12-17 16:47:40 UTC
Integrated into 'main-golden'
User: Jesse Glick <>
Log: Not actually functional since afa36000f36f, since T2 aborts early (yet test passed anyway).
T2: Thus will acquire CES lock and wait on doc write lock.
Exception in thread "Thread-1" java.lang.AssertionError: CloneableEditorSupport.getOpenedPanes() must be called from AWT thread only
	at org.openide.text.CloneableEditorSupport.getOpenedPanes(
	at org.openide.text.CloneableEditorSupport.reloadDocument(
	at org.openide.text.ReloadDeadlockTest$
END of deadlock test, see issue #12557.